2022-02-01 15:13:39

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the kspp tree

Hi all,

After merging the kspp tree, today's linux-next build (x86_64
allmodconfig) failed like this:

In file included from include/linux/string.h:253,
from include/linux/bitmap.h:11,
from include/linux/cpumask.h:12,
from arch/x86/include/asm/cpumask.h:5,
from arch/x86/include/asm/msr.h:11,
from arch/x86/include/asm/processor.h:22,
from arch/x86/include/asm/timex.h:5,
from include/linux/timex.h:65,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/skbuff.h:15,
from include/linux/tcp.h:17,
from drivers/net/ethernet/mellanox/mlx5/core/en_tx.c:33:
In function 'fortify_memcpy_chk',
inlined from 'mlx5e_insert_vlan' at drivers/net/ethernet/mellanox/mlx5/core/en_tx.c:211:2,
inlined from 'mlx5e_sq_xmit_wqe' at drivers/net/ethernet/mellanox/mlx5/core/en_tx.c:496:4:
include/linux/fortify-string.h:325:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
325 | __write_overflow_field(p_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/string.h:253,
from include/linux/bitmap.h:11,
from include/linux/cpumask.h:12,
from arch/x86/include/asm/cpumask.h:5,
from arch/x86/include/asm/msr.h:11,
from arch/x86/include/asm/processor.h:22,
from arch/x86/include/asm/timex.h:5,
from include/linux/timex.h:65,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from include/linux/netdevice.h:24,
from include/trace/events/xdp.h:8,
from include/linux/bpf_trace.h:5,
from drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c:33:
In function 'fortify_memcpy_chk',
inlined from 'mlx5e_xmit_xdp_frame' at drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c:344:3:
include/linux/fortify-string.h:325:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
325 | __write_overflow_field(p_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Caused by various commits in the mlx5 driver interacting with the new
memcpy checking.

I have disabled CONFIG_MLX5_CORE_EN for today while this gets sorted
out properly.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2022-02-01 15:22:00

by Kees Cook

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp tree

On Mon, Jan 31, 2022 at 10:09:54AM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> In file included from include/linux/string.h:253,
> from include/linux/bitmap.h:11,
> from include/linux/cpumask.h:12,
> from arch/x86/include/asm/cpumask.h:5,
> from arch/x86/include/asm/msr.h:11,
> from arch/x86/include/asm/processor.h:22,
> from arch/x86/include/asm/timex.h:5,
> from include/linux/timex.h:65,
> from include/linux/time32.h:13,
> from include/linux/time.h:60,
> from include/linux/skbuff.h:15,
> from include/linux/tcp.h:17,
> from drivers/net/ethernet/mellanox/mlx5/core/en_tx.c:33:
> In function 'fortify_memcpy_chk',
> inlined from 'mlx5e_insert_vlan' at drivers/net/ethernet/mellanox/mlx5/core/en_tx.c:211:2,
> inlined from 'mlx5e_sq_xmit_wqe' at drivers/net/ethernet/mellanox/mlx5/core/en_tx.c:496:4:
> include/linux/fortify-string.h:325:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
> 325 | __write_overflow_field(p_size_field, size);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This should be fixed by:
https://lore.kernel.org/linux-hardening/[email protected]/
(I was expecting this to be in netdev by now.)

> In file included from include/linux/string.h:253,
> from include/linux/bitmap.h:11,
> from include/linux/cpumask.h:12,
> from arch/x86/include/asm/cpumask.h:5,
> from arch/x86/include/asm/msr.h:11,
> from arch/x86/include/asm/processor.h:22,
> from arch/x86/include/asm/timex.h:5,
> from include/linux/timex.h:65,
> from include/linux/time32.h:13,
> from include/linux/time.h:60,
> from include/linux/ktime.h:24,
> from include/linux/timer.h:6,
> from include/linux/netdevice.h:24,
> from include/trace/events/xdp.h:8,
> from include/linux/bpf_trace.h:5,
> from drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c:33:
> In function 'fortify_memcpy_chk',
> inlined from 'mlx5e_xmit_xdp_frame' at drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c:344:3:
> include/linux/fortify-string.h:325:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
> 325 | __write_overflow_field(p_size_field, size);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This should be fixed in:
https://lore.kernel.org/linux-hardening/[email protected]/
(Again, this was expected to be in netdev by now.)

> Caused by various commits in the mlx5 driver interacting with the new
> memcpy checking.
>
> I have disabled CONFIG_MLX5_CORE_EN for today while this gets sorted
> out properly.

Thanks!

-Kees

--
Kees Cook

2022-02-01 15:25:03

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp tree

Hi Kees,

On Sun, 30 Jan 2022 20:04:00 -0800 Kees Cook <[email protected]> wrote:
>
> This should be fixed by:
> https://lore.kernel.org/linux-hardening/[email protected]/
> (I was expecting this to be in netdev by now.)
>
> This should be fixed in:
> https://lore.kernel.org/linux-hardening/[email protected]/
> (Again, this was expected to be in netdev by now.)
>

yeah, neither has made it yet. However, it would not have helped as I
am merging the kspp tree very early so that new bugs get fixed in the
trees that introduce them. These 2 are in Linus tree (for a long time)
and so it would be better if these fixes went int the net tree and then
Linus' tree as bug fixes.

I will use these in the merge of the kspp tree from tomorrow until they
appear earlier (or you could put them back in your tree). Cross tree
dependencies are a pain :-( BTW Linus would have the same problem I
am having if he merges your tree during the merge window before he
merges the net-next tree ...

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2022-02-01 15:28:45

by Kees Cook

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp tree

On Mon, Jan 31, 2022 at 03:59:32PM +1100, Stephen Rothwell wrote:
> On Sun, 30 Jan 2022 20:04:00 -0800 Kees Cook <[email protected]> wrote:
> >
> > This should be fixed by:
> > https://lore.kernel.org/linux-hardening/[email protected]/
> > (I was expecting this to be in netdev by now.)
> >
> > This should be fixed in:
> > https://lore.kernel.org/linux-hardening/[email protected]/
> > (Again, this was expected to be in netdev by now.)
> >
>
> yeah, neither has made it yet. However, it would not have helped as I
> am merging the kspp tree very early so that new bugs get fixed in the
> trees that introduce them. These 2 are in Linus tree (for a long time)
> and so it would be better if these fixes went int the net tree and then
> Linus' tree as bug fixes.

Okay, understood. I'll leave them in my tree until I see them duplicated
in their respective trees (or in Linus's tree).

> I will use these in the merge of the kspp tree from tomorrow until they
> appear earlier (or you could put them back in your tree). Cross tree
> dependencies are a pain :-( BTW Linus would have the same problem I
> am having if he merges your tree during the merge window before he
> merges the net-next tree ...

Yeah, I'm used to going "late" in the -rc1 from these kinds of things. :)

Thanks!

--
Kees Cook

2022-02-01 20:49:31

by Saeed Mahameed

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp tree

On 30 Jan 22:19, Kees Cook wrote:
>On Mon, Jan 31, 2022 at 03:59:32PM +1100, Stephen Rothwell wrote:
>> On Sun, 30 Jan 2022 20:04:00 -0800 Kees Cook <[email protected]> wrote:
>> >
>> > This should be fixed by:
>> > https://lore.kernel.org/linux-hardening/[email protected]/
>> > (I was expecting this to be in netdev by now.)
>> >
>> > This should be fixed in:
>> > https://lore.kernel.org/linux-hardening/[email protected]/
>> > (Again, this was expected to be in netdev by now.)
>> >
>>
>> yeah, neither has made it yet. However, it would not have helped as I
>> am merging the kspp tree very early so that new bugs get fixed in the
>> trees that introduce them. These 2 are in Linus tree (for a long time)
>> and so it would be better if these fixes went int the net tree and then
>> Linus' tree as bug fixes.
>

I need proper fixes tags to submit to net, can you provide ?

another option is to use a shared branch with those fixes and pull it to
both net-next and kspp.

let me know what option do you prefer.

-Saeed.

2022-02-01 20:51:05

by Kees Cook

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp tree

On Mon, Jan 31, 2022 at 11:10:19AM -0800, Saeed Mahameed wrote:
> On 30 Jan 22:19, Kees Cook wrote:
> > On Mon, Jan 31, 2022 at 03:59:32PM +1100, Stephen Rothwell wrote:
> > > On Sun, 30 Jan 2022 20:04:00 -0800 Kees Cook <[email protected]> wrote:
> > > > https://lore.kernel.org/linux-hardening/[email protected]/

Fixes: 34802a42b352 ("net/mlx5e: Do not modify the TX SKB")

> > > > https://lore.kernel.org/linux-hardening/[email protected]/

Fixes: b5503b994ed5 ("net/mlx5e: XDP TX forwarding support")

> > > yeah, neither has made it yet. However, it would not have helped as I
> > > am merging the kspp tree very early so that new bugs get fixed in the
> > > trees that introduce them. These 2 are in Linus tree (for a long time)
> > > and so it would be better if these fixes went int the net tree and then
> > > Linus' tree as bug fixes.
>
> I need proper fixes tags to submit to net, can you provide ?

Sure! See above.

> another option is to use a shared branch with those fixes and pull it to
> both net-next and kspp.

It's just a handful left now, so I think we'll avoid this for now.

Thanks!

--
Kees Cook