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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHC9VhTr0=WGvacsCGgpwiPwU_ziQeThV88ZqZRdVXqO+HafYQ@mail.gmail.com>
Date:   Sun, 28 Feb 2021 13:37:41 -0500
From:   Paul Moore <paul@...l-moore.com>
To:     Alexey Dobriyan <adobriyan@...il.com>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
        Stephen Smalley <stephen.smalley.work@...il.com>,
        Eric Paris <eparis@...isplace.org>, selinux@...r.kernel.org
Subject: Re: [PATCH 09/11] pragma once: convert scripts/selinux/genheaders/genheaders.c

On Sun, Feb 28, 2021 at 12:04 PM Alexey Dobriyan <adobriyan@...il.com> wrote:
>
> From 097f2c8b2af7d9e88cff59376ea0ad51b95341cb Mon Sep 17 00:00:00 2001
> From: Alexey Dobriyan <adobriyan@...il.com>
> Date: Tue, 9 Feb 2021 00:39:23 +0300
> Subject: [PATCH 09/11] pragma once: convert scripts/selinux/genheaders/genheaders.c
>
> Generate security/selinux/flask.h and security/selinux/av_permissions.h
> without include guards.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
> ---
>  scripts/selinux/genheaders/genheaders.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

My LKML subscription must have died at some point due to mail bounces,
or maybe I dopped it (?), because I'm not seeing the rest of this
patchset for context.

However, unless the rest of the kernel transitions to this, or there
is some other big win that I'm missing, I don't see much of a reason
for this; can you provide some compelling reason for why we should
make this change?  A quick search on "#pragma once" seems to indicate
it is non-standard, so why replace the simple #ifdef/#define solution
for this?

> diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c
> index f355b3e0e968..e13ee4221993 100644
> --- a/scripts/selinux/genheaders/genheaders.c
> +++ b/scripts/selinux/genheaders/genheaders.c
> @@ -74,8 +74,8 @@ int main(int argc, char *argv[])
>                         initial_sid_to_string[i] = stoupperx(s);
>         }
>
> +       fprintf(fout, "#pragma once\n");
>         fprintf(fout, "/* This file is automatically generated.  Do not edit. */\n");
> -       fprintf(fout, "#ifndef _SELINUX_FLASK_H_\n#define _SELINUX_FLASK_H_\n\n");
>
>         for (i = 0; secclass_map[i].name; i++) {
>                 struct security_class_mapping *map = &secclass_map[i];
> @@ -109,7 +109,6 @@ int main(int argc, char *argv[])
>         fprintf(fout, "\treturn sock;\n");
>         fprintf(fout, "}\n");
>
> -       fprintf(fout, "\n#endif\n");
>         fclose(fout);
>
>         fout = fopen(argv[2], "w");
> @@ -119,8 +118,8 @@ int main(int argc, char *argv[])
>                 exit(4);
>         }
>
> +       fprintf(fout, "#pragma once\n");
>         fprintf(fout, "/* This file is automatically generated.  Do not edit. */\n");
> -       fprintf(fout, "#ifndef _SELINUX_AV_PERMISSIONS_H_\n#define _SELINUX_AV_PERMISSIONS_H_\n\n");
>
>         for (i = 0; secclass_map[i].name; i++) {
>                 struct security_class_mapping *map = &secclass_map[i];
> @@ -136,7 +135,6 @@ int main(int argc, char *argv[])
>                 }
>         }
>
> -       fprintf(fout, "\n#endif\n");
>         fclose(fout);
>         exit(0);
>  }
> --
> 2.29.2

-- 
paul moore
www.paul-moore.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ