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


Groups > linux.kernel > #1546000 > unrolled thread

Patch to include/linux/kernel.h breaks 3rd party modules.

Started byValdis Kletnieks <Valdis.Kletnieks@vt.edu>
First post2016-12-21 21:50 +0100
Last post2016-12-22 11:50 +0100
Articles 5 — 5 participants

Back to article view | Back to linux.kernel


Contents

  Patch to include/linux/kernel.h breaks 3rd party modules. Valdis Kletnieks <Valdis.Kletnieks@vt.edu> - 2016-12-21 21:50 +0100
    Re: Patch to include/linux/kernel.h breaks 3rd party modules. Jessica Yu <jeyu@redhat.com> - 2016-12-21 22:30 +0100
    Re: Patch to include/linux/kernel.h breaks 3rd party modules. Al Viro <viro@ZenIV.linux.org.uk> - 2016-12-22 02:00 +0100
    Re: Patch to include/linux/kernel.h breaks 3rd party modules. Christoph Hellwig <hch@infradead.org> - 2016-12-22 07:30 +0100
    Re: Patch to include/linux/kernel.h breaks 3rd party modules. Petr Mladek <pmladek@suse.com> - 2016-12-22 11:50 +0100

#1546000 — Patch to include/linux/kernel.h breaks 3rd party modules.

FromValdis Kletnieks <Valdis.Kletnieks@vt.edu>
Date2016-12-21 21:50 +0100
SubjectPatch to include/linux/kernel.h breaks 3rd party modules.
Message-ID<sQVZL-8cd-5@gated-at.bofh.it>

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

Yes, I know that usually out-of-tree modules are on their own.
However, this one may require a rethink..

(Sorry for not catching this sooner, I hadn't tried to deal with the
affected module since this patch hit linux-next in next-20161128)

commit 7fd8329ba502ef76dd91db561c7aed696b2c7720
Author: Petr Mladek <pmladek@suse.com>
Date:   Wed Sep 21 13:47:22 2016 +0200

    taint/module: Clean up global and module taint flags handling

Contains this chunk:

--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -506,6 +506,15 @@ extern enum system_states {
 #define TAINT_UNSIGNED_MODULE          13
 #define TAINT_SOFTLOCKUP               14
 #define TAINT_LIVEPATCH                        15
+#define TAINT_FLAGS_COUNT              16
+
+struct taint_flag {
+       char true;      /* character printed when tainted */
+       char false;     /* character printed when not tainted */
+       bool module;    /* also show as a per-module taint flag */
+};

and hilarity ensues when an out-of-tree module has this:

# ifndef true
#  define true  (1)
# endif
# ifndef false
#  define false (0)
# endif

My proposed fix: change true/false to tainted/untainted.  If this
is agreeable, I'll code and submit the fix.


[toc] | [next] | [standalone]


#1546004

FromJessica Yu <jeyu@redhat.com>
Date2016-12-21 22:30 +0100
Message-ID<sQWCu-fm-15@gated-at.bofh.it>
In reply to#1546000
+++ Valdis Kletnieks [21/12/16 15:42 -0500]:
>Yes, I know that usually out-of-tree modules are on their own.
>However, this one may require a rethink..
>
>(Sorry for not catching this sooner, I hadn't tried to deal with the
>affected module since this patch hit linux-next in next-20161128)
>
>commit 7fd8329ba502ef76dd91db561c7aed696b2c7720
>Author: Petr Mladek <pmladek@suse.com>
>Date:   Wed Sep 21 13:47:22 2016 +0200
>
>    taint/module: Clean up global and module taint flags handling
>
>Contains this chunk:
>
>--- a/include/linux/kernel.h
>+++ b/include/linux/kernel.h
>@@ -506,6 +506,15 @@ extern enum system_states {
> #define TAINT_UNSIGNED_MODULE          13
> #define TAINT_SOFTLOCKUP               14
> #define TAINT_LIVEPATCH                        15
>+#define TAINT_FLAGS_COUNT              16
>+
>+struct taint_flag {
>+       char true;      /* character printed when tainted */
>+       char false;     /* character printed when not tainted */
>+       bool module;    /* also show as a per-module taint flag */
>+};
>
>and hilarity ensues when an out-of-tree module has this:
>
># ifndef true
>#  define true  (1)
># endif
># ifndef false
>#  define false (0)
># endif
>
>My proposed fix: change true/false to tainted/untainted.  If this
>is agreeable, I'll code and submit the fix.

Sure, that's fine with me.

Jessica

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


#1546092

FromAl Viro <viro@ZenIV.linux.org.uk>
Date2016-12-22 02:00 +0100
Message-ID<sQZTM-2ao-3@gated-at.bofh.it>
In reply to#1546000
On Wed, Dec 21, 2016 at 03:42:05PM -0500, Valdis Kletnieks wrote:
> Yes, I know that usually out-of-tree modules are on their own.
> However, this one may require a rethink..
> 
> (Sorry for not catching this sooner, I hadn't tried to deal with the
> affected module since this patch hit linux-next in next-20161128)
> 
> commit 7fd8329ba502ef76dd91db561c7aed696b2c7720
> Author: Petr Mladek <pmladek@suse.com>
> Date:   Wed Sep 21 13:47:22 2016 +0200
> 
>     taint/module: Clean up global and module taint flags handling
> 
> Contains this chunk:
> 
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -506,6 +506,15 @@ extern enum system_states {
>  #define TAINT_UNSIGNED_MODULE          13
>  #define TAINT_SOFTLOCKUP               14
>  #define TAINT_LIVEPATCH                        15
> +#define TAINT_FLAGS_COUNT              16
> +
> +struct taint_flag {
> +       char true;      /* character printed when tainted */
> +       char false;     /* character printed when not tainted */
> +       bool module;    /* also show as a per-module taint flag */
> +};
> 
> and hilarity ensues when an out-of-tree module has this:
> 
> # ifndef true
> #  define true  (1)
> # endif
> # ifndef false
> #  define false (0)
> # endif
> 
> My proposed fix: change true/false to tainted/untainted.  If this
> is agreeable, I'll code and submit the fix.

That certainly makes sense, but this kind of macros really ought to be
killed off.  In-tree there are only two such places - arch/powerpc/boot/types.h
(no idea what's the environment there, but seeing that it starts with
#include <stdbool.h>...) and fs/cifs/smbencrypt.c.

BTW, looking at arch/powerpc/boot/types.h...  How does it manage to survive,
anyway?  gcc stdbool.h has #define bool _Bool, so that typedef int bool; in
there would turn into typedef int _Bool, which should *not* be accepted by
any C compiler.  Or does it define __stdcplusplus somehow?  Confused...

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


#1546192

FromChristoph Hellwig <hch@infradead.org>
Date2016-12-22 07:30 +0100
Message-ID<sR533-5Hu-7@gated-at.bofh.it>
In reply to#1546000
On Wed, Dec 21, 2016 at 03:42:05PM -0500, Valdis Kletnieks wrote:
> Yes, I know that usually out-of-tree modules are on their own.
> However, this one may require a rethink..
> 
> (Sorry for not catching this sooner, I hadn't tried to deal with the
> affected module since this patch hit linux-next in next-20161128)

So fix your out of tree module.

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


#1546273

FromPetr Mladek <pmladek@suse.com>
Date2016-12-22 11:50 +0100
Message-ID<sR96G-8mu-17@gated-at.bofh.it>
In reply to#1546000
On Wed 2016-12-21 15:42:05, Valdis Kletnieks wrote:
> Yes, I know that usually out-of-tree modules are on their own.
> However, this one may require a rethink..
> 
> (Sorry for not catching this sooner, I hadn't tried to deal with the
> affected module since this patch hit linux-next in next-20161128)
> 
> commit 7fd8329ba502ef76dd91db561c7aed696b2c7720
> Author: Petr Mladek <pmladek@suse.com>
> Date:   Wed Sep 21 13:47:22 2016 +0200
> 
>     taint/module: Clean up global and module taint flags handling
> 
> Contains this chunk:
> 
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -506,6 +506,15 @@ extern enum system_states {
>  #define TAINT_UNSIGNED_MODULE          13
>  #define TAINT_SOFTLOCKUP               14
>  #define TAINT_LIVEPATCH                        15
> +#define TAINT_FLAGS_COUNT              16
> +
> +struct taint_flag {
> +       char true;      /* character printed when tainted */
> +       char false;     /* character printed when not tainted */
> +       bool module;    /* also show as a per-module taint flag */
> +};
> 
> and hilarity ensues when an out-of-tree module has this:
> 
> # ifndef true
> #  define true  (1)
> # endif
> # ifndef false
> #  define false (0)
> # endif
> 
> My proposed fix: change true/false to tainted/untainted.  If this
> is agreeable, I'll code and submit the fix.

Great catch! I did not have a good feeling about the names. But
I did not found this problem and kept them to reduce changes
in the code.

If we change it, I would go even further and make the purpose
clear, e.g. use char_tainted/char_untainted. The names feel
like booleans wihtout the char_ prefix.

Best Regards,
Petr

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web