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


Groups > linux.kernel > #1642935 > unrolled thread

linux-next: build failure after merge of the netfilter tree

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2017-05-17 05:50 +0200
Last post2017-05-18 01:20 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  linux-next: build failure after merge of the netfilter tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-05-17 05:50 +0200
    Re: linux-next: build failure after merge of the netfilter tree Willem de Bruijn <willemdebruijn.kernel@gmail.com> - 2017-05-17 07:10 +0200
      Re: linux-next: build failure after merge of the netfilter tree Willem de Bruijn <willemdebruijn.kernel@gmail.com> - 2017-05-17 17:40 +0200
        Re: linux-next: build failure after merge of the netfilter tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-05-18 01:20 +0200

#1642935 — linux-next: build failure after merge of the netfilter tree

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2017-05-17 05:50 +0200
Subjectlinux-next: build failure after merge of the netfilter tree
Message-ID<tHY8h-6fJ-5@gated-at.bofh.it>
Hi all,

After merging the netfilter tree, today's linux-next build (i386
defconfig) failed like this:

net/netfilter/x_tables.c: In function 'xt_match_to_user':
net/netfilter/x_tables.c:303:13: error: implicit declaration of function 'COMPAT_XT_ALIGN' [-Werror=implicit-function-declaration]
    C_SIZE ? COMPAT_XT_ALIGN(C_SIZE) :  \
             ^
net/netfilter/x_tables.c:310:9: note: in expansion of macro 'XT_DATA_TO_USER'
         XT_DATA_TO_USER(u, m, match, 0);
         ^

Caused by commit

  324318f0248c ("netfilter: xtables: zero padding in data_to_user")

In the !CONFIG_COMPAT case C_SIZE will always be zero, but the compiler
is still looking for the macro :-(

I added this cludge patch (I am sure it can be done better):

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 17 May 2017 13:36:26 +1000
Subject: [PATCH] netfilter: xtables: fix for zero padding in data_to_user

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 net/netfilter/x_tables.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index d17769599c10..2b1785993a92 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -296,12 +296,20 @@ int xt_data_to_user(void __user *dst, const void *src,
 }
 EXPORT_SYMBOL_GPL(xt_data_to_user);
 
+#ifdef CONFIG_COMPAT
 #define XT_DATA_TO_USER(U, K, TYPE, C_SIZE)				\
 	xt_data_to_user(U->data, K->data,				\
 			K->u.kernel.TYPE->usersize,			\
 			C_SIZE ? : K->u.kernel.TYPE->TYPE##size,	\
 			C_SIZE ? COMPAT_XT_ALIGN(C_SIZE) :		\
 				 XT_ALIGN(K->u.kernel.TYPE->TYPE##size))
+#else
+#define XT_DATA_TO_USER(U, K, TYPE, C_SIZE)				\
+	xt_data_to_user(U->data, K->data,				\
+			K->u.kernel.TYPE->usersize,			\
+			C_SIZE ? : K->u.kernel.TYPE->TYPE##size,	\
+			C_SIZE ? : XT_ALIGN(K->u.kernel.TYPE->TYPE##size))
+#endif
 
 int xt_match_to_user(const struct xt_entry_match *m,
 		     struct xt_entry_match __user *u)

-- 
Cheers,
Stephen Rothwell

[toc] | [next] | [standalone]


#1642977

FromWillem de Bruijn <willemdebruijn.kernel@gmail.com>
Date2017-05-17 07:10 +0200
Message-ID<tHZnH-7gf-1@gated-at.bofh.it>
In reply to#1642935
On Tue, May 16, 2017 at 11:45 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> After merging the netfilter tree, today's linux-next build (i386
> defconfig) failed like this:
>
> net/netfilter/x_tables.c: In function 'xt_match_to_user':
> net/netfilter/x_tables.c:303:13: error: implicit declaration of function 'COMPAT_XT_ALIGN' [-Werror=implicit-function-declaration]
>     C_SIZE ? COMPAT_XT_ALIGN(C_SIZE) :  \
>              ^
> net/netfilter/x_tables.c:310:9: note: in expansion of macro 'XT_DATA_TO_USER'
>          XT_DATA_TO_USER(u, m, match, 0);
>          ^
>
> Caused by commit
>
>   324318f0248c ("netfilter: xtables: zero padding in data_to_user")
>
> In the !CONFIG_COMPAT case C_SIZE will always be zero, but the compiler
> is still looking for the macro :-(

Apologies for the breakage.

> I added this cludge patch (I am sure it can be done better):
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Wed, 17 May 2017 13:36:26 +1000
> Subject: [PATCH] netfilter: xtables: fix for zero padding in data_to_user
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  net/netfilter/x_tables.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
> index d17769599c10..2b1785993a92 100644
> --- a/net/netfilter/x_tables.c
> +++ b/net/netfilter/x_tables.c
> @@ -296,12 +296,20 @@ int xt_data_to_user(void __user *dst, const void *src,
>  }
>  EXPORT_SYMBOL_GPL(xt_data_to_user);
>
> +#ifdef CONFIG_COMPAT
>  #define XT_DATA_TO_USER(U, K, TYPE, C_SIZE)                            \
>         xt_data_to_user(U->data, K->data,                               \
>                         K->u.kernel.TYPE->usersize,                     \
>                         C_SIZE ? : K->u.kernel.TYPE->TYPE##size,        \
>                         C_SIZE ? COMPAT_XT_ALIGN(C_SIZE) :              \
>                                  XT_ALIGN(K->u.kernel.TYPE->TYPE##size))
> +#else
> +#define XT_DATA_TO_USER(U, K, TYPE, C_SIZE)                            \
> +       xt_data_to_user(U->data, K->data,                               \
> +                       K->u.kernel.TYPE->usersize,                     \
> +                       C_SIZE ? : K->u.kernel.TYPE->TYPE##size,        \
> +                       C_SIZE ? : XT_ALIGN(K->u.kernel.TYPE->TYPE##size))
> +#endif
>

I will send a patch to the netfilter to define a separate
COMPAT_XT_DATA_TO_USER inside the CONFIG_COMPAT region further down
the file. This also allows simplifying XT_DATA_TO_USER by removing
those ternary statements.

-#define XT_DATA_TO_USER(U, K, TYPE, C_SIZE)                            \
+#define XT_DATA_TO_USER(U, K, TYPE)                                    \
        xt_data_to_user(U->data, K->data,                               \
                        K->u.kernel.TYPE->usersize,                     \
-                       C_SIZE ? : K->u.kernel.TYPE->TYPE##size,        \
-                       C_SIZE ? COMPAT_XT_ALIGN(C_SIZE) :              \
-                                XT_ALIGN(K->u.kernel.TYPE->TYPE##size))
+                       K->u.kernel.TYPE->TYPE##size,                   \
+                       XT_ALIGN(K->u.kernel.TYPE->TYPE##size))

and

+#define COMPAT_XT_DATA_TO_USER(U, K, TYPE, C_SIZE)                     \
+       xt_data_to_user(U->data, K->data,                               \
+                       K->u.kernel.TYPE->usersize,                     \
+                       C_SIZE,                                         \
+                       COMPAT_XT_ALIGN(C_SIZE))
+

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


#1643471

FromWillem de Bruijn <willemdebruijn.kernel@gmail.com>
Date2017-05-17 17:40 +0200
Message-ID<tI9dn-4QL-5@gated-at.bofh.it>
In reply to#1642977
On Wed, May 17, 2017 at 1:02 AM, Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
> On Tue, May 16, 2017 at 11:45 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>> Hi all,
>>
>> After merging the netfilter tree, today's linux-next build (i386
>> defconfig) failed like this:
>>
>> net/netfilter/x_tables.c: In function 'xt_match_to_user':
>> net/netfilter/x_tables.c:303:13: error: implicit declaration of function 'COMPAT_XT_ALIGN' [-Werror=implicit-function-declaration]
>>     C_SIZE ? COMPAT_XT_ALIGN(C_SIZE) :  \
>>              ^
>> net/netfilter/x_tables.c:310:9: note: in expansion of macro 'XT_DATA_TO_USER'
>>          XT_DATA_TO_USER(u, m, match, 0);
>>          ^
>>
>> Caused by commit
>>
>>   324318f0248c ("netfilter: xtables: zero padding in data_to_user")
>>
>> In the !CONFIG_COMPAT case C_SIZE will always be zero, but the compiler
>> is still looking for the macro :-(
>
> Apologies for the breakage.
>
>> I added this cludge patch (I am sure it can be done better):
>>
>> From: Stephen Rothwell <sfr@canb.auug.org.au>
>> Date: Wed, 17 May 2017 13:36:26 +1000
>> Subject: [PATCH] netfilter: xtables: fix for zero padding in data_to_user
>>
>> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
>> ---
>>  net/netfilter/x_tables.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
>> index d17769599c10..2b1785993a92 100644
>> --- a/net/netfilter/x_tables.c
>> +++ b/net/netfilter/x_tables.c
>> @@ -296,12 +296,20 @@ int xt_data_to_user(void __user *dst, const void *src,
>>  }
>>  EXPORT_SYMBOL_GPL(xt_data_to_user);
>>
>> +#ifdef CONFIG_COMPAT
>>  #define XT_DATA_TO_USER(U, K, TYPE, C_SIZE)                            \
>>         xt_data_to_user(U->data, K->data,                               \
>>                         K->u.kernel.TYPE->usersize,                     \
>>                         C_SIZE ? : K->u.kernel.TYPE->TYPE##size,        \
>>                         C_SIZE ? COMPAT_XT_ALIGN(C_SIZE) :              \
>>                                  XT_ALIGN(K->u.kernel.TYPE->TYPE##size))
>> +#else
>> +#define XT_DATA_TO_USER(U, K, TYPE, C_SIZE)                            \
>> +       xt_data_to_user(U->data, K->data,                               \
>> +                       K->u.kernel.TYPE->usersize,                     \
>> +                       C_SIZE ? : K->u.kernel.TYPE->TYPE##size,        \
>> +                       C_SIZE ? : XT_ALIGN(K->u.kernel.TYPE->TYPE##size))
>> +#endif
>>
>
> I will send a patch to the netfilter to define a separate
> COMPAT_XT_DATA_TO_USER inside the CONFIG_COMPAT region further down
> the file. This also allows simplifying XT_DATA_TO_USER by removing
> those ternary statements.

Full patch out for review at http://patchwork.ozlabs.org/patch/763655/

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


#1643690

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2017-05-18 01:20 +0200
Message-ID<tIgox-1cf-9@gated-at.bofh.it>
In reply to#1643471
Hi Willem,

On Wed, 17 May 2017 11:29:19 -0400 Willem de Bruijn <willemdebruijn.kernel@gmail.com> wrote:
>
> Full patch out for review at http://patchwork.ozlabs.org/patch/763655/

I have used that in linux-next today instead of my cludge.

-- 
Cheers,
Stephen Rothwell

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web