lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210211075206.GA295123@x1>
Date:   Wed, 10 Feb 2021 23:52:06 -0800
From:   Drew Fustini <drew@...gleboard.org>
To:     Joe Perches <joe@...ches.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Tony Lindgren <tony@...mide.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
        Jason Kridner <jkridner@...gleboard.org>,
        Robert Nelson <robertcnelson@...gleboard.org>,
        Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH v4 1/2] pinctrl: use to octal permissions for debugfs
 files

On Wed, Feb 10, 2021 at 11:36:39PM -0800, Joe Perches wrote:
> On Wed, 2021-02-10 at 14:28 -0800, Drew Fustini wrote:
> > Switch over pinctrl debugfs files to use octal permissions as they are
> > preferred over symbolic permissions. Refer to commit f90774e1fd27
> > ("checkpatch: look for symbolic permissions and suggest octal instead").
> > 
> > Note: S_IFREG flag is added to the mode by __debugfs_create_file()
> > in fs/debugfs/inode.c
> > 
> > Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
> > Signed-off-by: Drew Fustini <drew@...gleboard.org>
> > ---
> >  drivers/pinctrl/core.c    | 6 +++---
> >  drivers/pinctrl/pinconf.c | 4 ++--
> >  drivers/pinctrl/pinmux.c  | 4 ++--
> >  3 files changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> > index 3663d87f51a0..02f8710afb9c 100644
> > --- a/drivers/pinctrl/core.c
> > +++ b/drivers/pinctrl/core.c
> > @@ -1914,11 +1914,11 @@ static void pinctrl_init_debugfs(void)
> >  		return;
> >  	}
> >  
> > 
> > -	debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO,
> > +	debugfs_create_file("pinctrl-devices", 0444,
> >  			    debugfs_root, NULL, &pinctrl_devices_fops);
> > -	debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO,
> > +	debugfs_create_file("pinctrl-maps", 0444,
> >  			    debugfs_root, NULL, &pinctrl_maps_fops);
> > -	debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO,
> > +	debugfs_create_file("pinctrl-handles", 0444,
> >  			    debugfs_root, NULL, &pinctrl_fops);
> >  }
> 
> Why aren't you also converting this block in the same file?
> 
> @@ -1890,11 +1890,11 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev)
>                         dev_name(pctldev->dev));
>                 return;
>         }
> -       debugfs_create_file("pins", S_IFREG | S_IRUGO,
> +       debugfs_create_file("pins", S_IFREG | 0444,
>                             device_root, pctldev, &pinctrl_pins_fops);
> -       debugfs_create_file("pingroups", S_IFREG | S_IRUGO,
> +       debugfs_create_file("pingroups", S_IFREG | 0444,
>                             device_root, pctldev, &pinctrl_groups_fops);
> -       debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO,
> +       debugfs_create_file("gpio-ranges", S_IFREG | 0444,
>                             device_root, pctldev, &pinctrl_gpioranges_fops);
>         if (pctldev->desc->pmxops)
>                 pinmux_init_device_debugfs(device_root, pctldev);
> 
> 
> 

Thank you, that is a very good point.  I should have included those
calls to debugfs_create_file() in the patch as well.  I will fix that
in the next revision.  It looks like I also need to change how sscanf()
is being handle per the other thread of discussion.

Thanks,
Drew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ