Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1703747 > unrolled thread

[PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters

Started byMichal Simek <michal.simek@xilinx.com>
First post2017-08-04 09:40 +0200
Last post2017-08-04 16:00 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters Michal Simek <michal.simek@xilinx.com> - 2017-08-04 09:40 +0200
    Re: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module  parameters Guenter Roeck <linux@roeck-us.net> - 2017-08-04 15:50 +0200
      Re: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module  parameters Michal Simek <monstr@monstr.eu> - 2017-08-04 16:00 +0200

#1703747 — [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters

FromMichal Simek <michal.simek@xilinx.com>
Date2017-08-04 09:40 +0200
Subject[PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters
Message-ID<uaFnb-42L-13@gated-at.bofh.it>
Give read access to module parameters to all and write access to root.
This change also improves driver error path testing.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Please let me know what you think - I can use macros from stat.h if
required

---
 drivers/watchdog/cadence_wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index 05c000081e9d..dadd3b0c2d49 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -52,12 +52,12 @@
 static int wdt_timeout;
 static int nowayout = WATCHDOG_NOWAYOUT;
 
-module_param(wdt_timeout, int, 0);
+module_param(wdt_timeout, int, 0644);
 MODULE_PARM_DESC(wdt_timeout,
 		 "Watchdog time in seconds. (default="
 		 __MODULE_STRING(CDNS_WDT_DEFAULT_TIMEOUT) ")");
 
-module_param(nowayout, int, 0);
+module_param(nowayout, int, 0644);
 MODULE_PARM_DESC(nowayout,
 		 "Watchdog cannot be stopped once started (default="
 		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-- 
1.9.1

[toc] | [next] | [standalone]


#1703999 — Re: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters

FromGuenter Roeck <linux@roeck-us.net>
Date2017-08-04 15:50 +0200
SubjectRe: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters
Message-ID<uaL9f-7DN-13@gated-at.bofh.it>
In reply to#1703747
On 08/04/2017 12:39 AM, Michal Simek wrote:
> Give read access to module parameters to all and write access to root.
> This change also improves driver error path testing.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
> Please let me know what you think - I can use macros from stat.h if
> required
> 

Seems to be quite pointless and misleading, since the values are only read
at probe time. Am I missing something ?

Guenter

> ---
>   drivers/watchdog/cadence_wdt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index 05c000081e9d..dadd3b0c2d49 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -52,12 +52,12 @@
>   static int wdt_timeout;
>   static int nowayout = WATCHDOG_NOWAYOUT;
>   
> -module_param(wdt_timeout, int, 0);
> +module_param(wdt_timeout, int, 0644);
>   MODULE_PARM_DESC(wdt_timeout,
>   		 "Watchdog time in seconds. (default="
>   		 __MODULE_STRING(CDNS_WDT_DEFAULT_TIMEOUT) ")");
>   
> -module_param(nowayout, int, 0);
> +module_param(nowayout, int, 0644);
>   MODULE_PARM_DESC(nowayout,
>   		 "Watchdog cannot be stopped once started (default="
>   		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> 

[toc] | [prev] | [next] | [standalone]


#1704011 — Re: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters

FromMichal Simek <monstr@monstr.eu>
Date2017-08-04 16:00 +0200
SubjectRe: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters
Message-ID<uaLiW-7Hs-15@gated-at.bofh.it>
In reply to#1703999

[Multipart message — attachments visible in raw view] — view raw

On 4.8.2017 15:45, Guenter Roeck wrote:
> On 08/04/2017 12:39 AM, Michal Simek wrote:
>> Give read access to module parameters to all and write access to root.
>> This change also improves driver error path testing.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> Please let me know what you think - I can use macros from stat.h if
>> required
>>
> 
> Seems to be quite pointless and misleading, since the values are only read
> at probe time. Am I missing something ?

You can unbind device and bind that device again. If you want to use it
or test with different parameters you need to have an access to these
module parameters.
For testing purpose if you setup for example timeout to 1000s which is
more than CDNS_WDT_MAX_TIMEOUT probe will fail and you have better
driver coverage.

I see that a lot of watchdog drivers are using 0 there - means no sysfs
access to these modules parameters. Some of them are using 0644 or 0444
that's why I want to know if there is any for example security reason to
disable access to these parameters.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs


[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web