linux-next: build failure after merge of the block tree
Mark Brown
maintainerHi all,
After merging the block tree, today's linux-next build (x86 allmodconfig) failed like this:
In file included from /tmp/next/build/include/linux/string.h:386,
from /tmp/next/build/include/linux/bitmap.h:13,
from /tmp/next/build/include/linux/cpumask.h:11,
from /tmp/next/build/arch/x86/include/asm/paravirt.h:21,
from /tmp/next/build/arch/x86/include/asm/cpuid/api.h:57,
from /tmp/next/build/arch/x86/include/asm/processor.h:19,
from /tmp/next/build/include/linux/sched.h:13,
from /tmp/next/build/include/linux/io_uring.h:5,
from /tmp/next/build/io_uring/bpf_filter.c:7:
In function 'fortify_memset_chk',
inlined from 'io_uring_populate_bpf_ctx' at /tmp/next/build/io_uring/bpf_filter.c:33:2:
/tmp/next/build/include/linux/fortify-string.h:480: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]
480 | __write_overflow_field(p_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
Caused by commit
f1e3672e49e2c (io_uring: add support for BPF filtering for opcode restrictions)
I have used the tree from 20260122 instead.
Quoted 19 lines · Mark Brown
Hi all,
After merging the block tree, today's linux-next build (x86 allmodconfig) failed like this:
In file included from
/tmp/next/build/include/linux/string.h:386,from /tmp/next/build/include/linux/bitmap.h:13, from /tmp/next/build/include/linux/cpumask.h:11, from /tmp/next/build/arch/x86/include/asm/paravirt.h:21, from /tmp/next/build/arch/x86/include/asm/cpuid/api.h:57, from /tmp/next/build/arch/x86/include/asm/processor.h:19, from /tmp/next/build/include/linux/sched.h:13, from /tmp/next/build/include/linux/io_uring.h:5, from /tmp/next/build/io_uring/bpf_filter.c:7: In function 'fortify_memset_chk', inlined from 'io_uring_populate_bpf_ctx' at /tmp/next/build/io_uring/bpf_filter.c:33:2: /tmp/next/build/include/linux/fortify-string.h:480: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] 480 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 5 lines
cc1: all warnings being treated as errors
Caused by commit
f1e3672e49e2c(io_uring: add support for BPF filtering for opcode restrictions)
Huh, that am I missing here? The struct looks as follows:
struct io_uring_bpf_ctx {
__u64 user_data;
__u8 opcode;
__u8 sqe_flags;
__u8 pad[6];
union {
__u64 resv[6];
struct {
__u32 family;
__u32 type;
__u32 protocol;
} socket;
struct {
__u64 flags;
__u64 mode;
__u64 resolve;
} open;
};
};and the offending line is:
memset(bctx->pad, 0, sizeof(bctx->pad) + sizeof(bctx->resv));
which should clear from offset 10 (start of pad) for a total of 6 + 48 bytes, which is 54 bytes. The size of the struct is 64b.
I guess the part it doesn't like is that it thinks we're clearing the pad field, which would of course be way overwriting it. Guess we can do something ala:
memset((void *) bctx + offsetof(struct io_uring_bpf_ctx, pad), 0,
sizeof(bctx->pad) + sizeof(bctx->resv));
to make it happier.
Signature · 1 line
Jens Axboe
Quoted 55 lines · Jens Axboe
Quoted 19 lines · Mark Brown
Hi all,
After merging the block tree, today's linux-next build (x86 allmodconfig) failed like this:
In file included from
/tmp/next/build/include/linux/string.h:386,from /tmp/next/build/include/linux/bitmap.h:13, from /tmp/next/build/include/linux/cpumask.h:11, from /tmp/next/build/arch/x86/include/asm/paravirt.h:21, from /tmp/next/build/arch/x86/include/asm/cpuid/api.h:57, from /tmp/next/build/arch/x86/include/asm/processor.h:19, from /tmp/next/build/include/linux/sched.h:13, from /tmp/next/build/include/linux/io_uring.h:5, from /tmp/next/build/io_uring/bpf_filter.c:7: In function 'fortify_memset_chk', inlined from 'io_uring_populate_bpf_ctx' at /tmp/next/build/io_uring/bpf_filter.c:33:2: /tmp/next/build/include/linux/fortify-string.h:480: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] 480 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Quoted 5 lines
cc1: all warnings being treated as errors
Caused by commit
f1e3672e49e2c(io_uring: add support for BPF filtering for opcode restrictions)Huh, that am I missing here? The struct looks as follows:
struct io_uring_bpf_ctx { __u64 user_data; __u8 opcode; __u8 sqe_flags; __u8 pad[6]; union { __u64 resv[6]; struct { __u32 family; __u32 type; __u32 protocol; } socket; struct { __u64 flags; __u64 mode; __u64 resolve; } open; }; };and the offending line is:
memset(bctx->pad, 0, sizeof(bctx->pad) + sizeof(bctx->resv));which should clear from offset 10 (start of pad) for a total of 6 + 48 bytes, which is 54 bytes. The size of the struct is 64b.
Quoted 8 lines
I guess the part it doesn't like is that it thinks we're clearing the pad field, which would of course be way overwriting it. Guess we can do something ala:
memset((void *) bctx +
offsetof(struct io_uring_bpf_ctx, pad), 0,sizeof(bctx->pad) + sizeof(bctx->resv));to make it happier.
Folded that in and pushed it out, should be happy for you now. I wonder if we have a helper for that...
Signature · 1 line
Jens Axboe
Hi Jens,
Quoted 61 lines · On Fri, 23 Jan 2026 11:06:43 -0700 Jens Axboe <[email protected]> wrote:
Quoted 59 lines · Jens Axboe
Quoted 19 lines · Mark Brown
Hi all,
After merging the block tree, today's linux-next build (x86 allmodconfig) failed like this:
In file included from
/tmp/next/build/include/linux/string.h:386,from /tmp/next/build/include/linux/bitmap.h:13, from /tmp/next/build/include/linux/cpumask.h:11, from /tmp/next/build/arch/x86/include/asm/paravirt.h:21, from /tmp/next/build/arch/x86/include/asm/cpuid/api.h:57, from /tmp/next/build/arch/x86/include/asm/processor.h:19, from /tmp/next/build/include/linux/sched.h:13, from /tmp/next/build/include/linux/io_uring.h:5, from /tmp/next/build/io_uring/bpf_filter.c:7: In function 'fortify_memset_chk', inlined from 'io_uring_populate_bpf_ctx' at /tmp/next/build/io_uring/bpf_filter.c:33:2: /tmp/next/build/include/linux/fortify-string.h:480: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] 480 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Quoted 5 lines
cc1: all warnings being treated as errors
Caused by commit
f1e3672e49e2c(io_uring: add support for BPF filtering for opcode restrictions)Huh, that am I missing here? The struct looks as follows:
struct io_uring_bpf_ctx { __u64 user_data; __u8 opcode; __u8 sqe_flags; __u8 pad[6]; union { __u64 resv[6]; struct { __u32 family; __u32 type; __u32 protocol; } socket; struct { __u64 flags; __u64 mode; __u64 resolve; } open; }; };and the offending line is:
memset(bctx->pad, 0, sizeof(bctx->pad) + sizeof(bctx->resv));which should clear from offset 10 (start of pad) for a total of 6 + 48 bytes, which is 54 bytes. The size of the struct is 64b.
I guess the part it doesn't like is that it thinks we're clearing the pad field, which would of course be way overwriting it. Guess we can do something ala:
Quoted 7 lines
Quoted 4 lines
memset((void *) bctx +
offsetof(struct io_uring_bpf_ctx, pad), 0,sizeof(bctx->pad) + sizeof(bctx->resv));to make it happier.
Folded that in and pushed it out, should be happy for you now. I wonder if we have a helper for that...
The origin warning did suggest using struct_group().
Signature · 2 lines
Cheers, Stephen Rothwell
Quoted 67 lines · Stephen Rothwell
Hi Jens,
Quoted 64 lines · On Fri, 23 Jan 2026 11:06:43 -0700 Jens Axboe <[email protected]> wrote:
Quoted 62 lines · Jens Axboe
Quoted 19 lines · Mark Brown
Hi all,
After merging the block tree, today's linux-next build (x86 allmodconfig) failed like this:
In file included from
/tmp/next/build/include/linux/string.h:386,from /tmp/next/build/include/linux/bitmap.h:13, from /tmp/next/build/include/linux/cpumask.h:11, from /tmp/next/build/arch/x86/include/asm/paravirt.h:21, from /tmp/next/build/arch/x86/include/asm/cpuid/api.h:57, from /tmp/next/build/arch/x86/include/asm/processor.h:19, from /tmp/next/build/include/linux/sched.h:13, from /tmp/next/build/include/linux/io_uring.h:5, from /tmp/next/build/io_uring/bpf_filter.c:7: In function 'fortify_memset_chk', inlined from 'io_uring_populate_bpf_ctx' at /tmp/next/build/io_uring/bpf_filter.c:33:2: /tmp/next/build/include/linux/fortify-string.h:480: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] 480 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Quoted 5 lines
cc1: all warnings being treated as errors
Caused by commit
f1e3672e49e2c(io_uring: add support for BPF filtering for opcode restrictions)Huh, that am I missing here? The struct looks as follows:
struct io_uring_bpf_ctx { __u64 user_data; __u8 opcode; __u8 sqe_flags; __u8 pad[6]; union { __u64 resv[6]; struct { __u32 family; __u32 type; __u32 protocol; } socket; struct { __u64 flags; __u64 mode; __u64 resolve; } open; }; };and the offending line is:
memset(bctx->pad, 0, sizeof(bctx->pad) + sizeof(bctx->resv));which should clear from offset 10 (start of pad) for a total of 6 + 48 bytes, which is 54 bytes. The size of the struct is 64b.
I guess the part it doesn't like is that it thinks we're clearing the pad field, which would of course be way overwriting it. Guess we can do something ala:
memset((void *) bctx +
offsetof(struct io_uring_bpf_ctx, pad), 0,sizeof(bctx->pad) + sizeof(bctx->resv));
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
to make it happier.
Folded that in and pushed it out, should be happy for you now. I wonder if we have a helper for that...
The origin warning did suggest using
struct_group().
Right, and I do use that in io_uring in other spots already, but it's pretty ugly for user facing structs. Both because they are harder to read, and because it's bleeding internal detail into userspace. So don't really like that for this use case.
Signature · 1 line
Jens Axboe
Mark Brown
maintainerQuoted 6 lines · Jens Axboe
Quoted 4 lines · Mark Brown
inlined from '
io_uring_populate_bpf_ctx' at/tmp/next/build/io_uring/bpf_filter.c:33:2:/tmp/next/build/include/linux/fortify-string.h:480:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe usestruct_group()? [-Werror=attribute-warning]480 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
Quoted 4 lines
memset(bctx->pad, 0, sizeof(bctx->pad) + sizeof(bctx->resv));which should clear from offset 10 (start of pad) for a total of 6 + 48 bytes, which is 54 bytes. The size of the struct is 64b.
I think so, it's checking that you're not overflowing the field you specified rather than the struct containing the field.
Quoted 8 lines
I guess the part it doesn't like is that it thinks we're clearing the pad field, which would of course be way overwriting it. Guess we can do something ala:
memset((void *) bctx +
offsetof(struct io_uring_bpf_ctx, pad), 0,sizeof(bctx->pad) + sizeof(bctx->resv));to make it happier.
Lovely.