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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 03 Feb 2017 23:27:46 -0800
From:   Joe Perches <>
To:     Guenter Roeck <>,
        Derek Robson <>,
        Julia Lawall <>
Subject: Re: Staging: speakup - syle fix permissions to octal

(adding Julia Lawall)

On Fri, 2017-02-03 at 20:44 -0800, Guenter Roeck wrote:
> On Sat, Jan 28, 2017 at 07:05:09PM +1300, Derek Robson wrote:
> > A style fix across whole driver.
> > changed permissions to octal style, found using checkpatch
> > 
> > Signed-off-by: Derek Robson <>
> FWIW, I think changes like this are best done using coccinelle.

I think checkpatch does it reasonably well.

Julia?  Can coccinelle do this?

I believe cocinelle doesn't handle the substitution
and octal addition very well when multiple flags
are used.

> That ensures that the results can be reproduced and are well defined.
> As it is, someone will have to check each line of your patches to ensure
> that the conversion is correct.
> It would also ensure (hopefully) that we don't end up with constructs
> such as 
> > -#define USER_R (S_IFREG|S_IRUGO)
> > -#define USER_W (S_IFREG|S_IWUGO)
> > +#define USER_R (S_IFREG|0444)
> > +#define USER_W (S_IFREG|0666)
> which really defeat the purpose of the whole exercise.

Why do you think mixing file specific attributes
with octal permissions is a bad thing?

$ git log -1 f90774e1fd2700d
commit f90774e1fd2700de4a6e0d62866d34a26c544bd0
Author: Joe Perches <>
Date:   Tue Oct 11 13:51:47 2016 -0700

    checkpatch: look for symbolic permissions and suggest octal instead
    S_<FOO> uses should be avoided where octal is more intelligible.
    Linus didst say:
    : It's *much* easier to parse and understand the octal numbers, while the
    : symbolic macro names are just random line noise and hard as hell to
    : understand.  You really have to think about it.
    : So we should rather go the other way: convert existing bad symbolic
    : permission bit macro use to just use the octal numbers.
    : The symbolic names are good for the *other* bits (ie sticky bit, and the
    : inode mode _type_ numbers etc), but for the permission bits, the symbolic
    : names are just insane crap.  Nobody sane should ever use them.  Not in the
    : kernel, not in user space.
    Signed-off-by: Joe Perches <>
    Cc: Linus Torvalds <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>

Powered by blists - more mailing lists