* linux-next: build warning after merge of the kspp-gustavo tree
@ 2021-09-29 23:53 Stephen Rothwell
2021-09-30 0:05 ` Gustavo A. R. Silva
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2021-09-29 23:53 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Kees Cook, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 11037 bytes --]
Hi all,
After merging the kspp-gustavo tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:
kernel/trace/ftrace.c: In function 'ftrace_ops_get_list_func':
kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
| ^
kernel/trace/ftrace.c:174:10: note: in expansion of macro 'ftrace_ops_list_func'
174 | return ftrace_ops_list_func;
| ^~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c: In function 'update_ftrace_function':
kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
| ^
kernel/trace/ftrace.c:207:10: note: in expansion of macro 'ftrace_ops_list_func'
207 | func = ftrace_ops_list_func;
| ^~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
| ^
kernel/trace/ftrace.c:220:14: note: in expansion of macro 'ftrace_ops_list_func'
220 | if (func == ftrace_ops_list_func) {
| ^~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c: In function 'ftrace_modify_all_code':
kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
| ^
kernel/trace/ftrace.c:2698:35: note: in expansion of macro 'ftrace_ops_list_func'
2698 | err = ftrace_update_ftrace_func(ftrace_ops_list_func);
| ^~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
| ^
kernel/trace/ftrace.c:2708:41: note: in expansion of macro 'ftrace_ops_list_func'
2708 | if (update && ftrace_trace_function != ftrace_ops_list_func) {
| ^~~~~~~~~~~~~~~~~~~~
In file included from kernel/bpf/hashtab.c:8:
kernel/bpf/hashtab.c: In function 'htab_map_gen_lookup':
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'void * (*)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
include/linux/filter.h:374:14: note: in definition of macro 'BPF_EMIT_CALL'
374 | .imm = ((FUNC) - __bpf_call_base) })
| ^~~~
kernel/bpf/hashtab.c:671:26: note: in expansion of macro 'BPF_CAST_CALL'
671 | *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem));
| ^~~~~~~~~~~~~
kernel/bpf/hashtab.c: In function 'htab_lru_map_gen_lookup':
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'void * (*)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
include/linux/filter.h:374:14: note: in definition of macro 'BPF_EMIT_CALL'
374 | .imm = ((FUNC) - __bpf_call_base) })
| ^~~~
kernel/bpf/hashtab.c:712:26: note: in expansion of macro 'BPF_CAST_CALL'
712 | *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem));
| ^~~~~~~~~~~~~
kernel/bpf/hashtab.c: In function 'htab_of_map_gen_lookup':
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'void * (*)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
include/linux/filter.h:374:14: note: in definition of macro 'BPF_EMIT_CALL'
374 | .imm = ((FUNC) - __bpf_call_base) })
| ^~~~
kernel/bpf/hashtab.c:2400:26: note: in expansion of macro 'BPF_CAST_CALL'
2400 | *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem));
| ^~~~~~~~~~~~~
In file included from include/linux/bpf_verifier.h:9,
from kernel/bpf/verifier.c:12:
kernel/bpf/verifier.c: In function 'jit_subprogs':
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'unsigned int (*)(const void *, const struct bpf_insn *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:12472:16: note: in expansion of macro 'BPF_CAST_CALL'
12472 | insn->imm = BPF_CAST_CALL(func[subprog]->bpf_func) -
| ^~~~~~~~~~~~~
kernel/bpf/verifier.c: In function 'do_misc_fixups':
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'void * (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:12953:17: note: in expansion of macro 'BPF_CAST_CALL'
12953 | insn->imm = BPF_CAST_CALL(ops->map_lookup_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *, void *, u64)' {aka 'int (* const)(struct bpf_map *, void *, void *, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:12957:17: note: in expansion of macro 'BPF_CAST_CALL'
12957 | insn->imm = BPF_CAST_CALL(ops->map_update_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:12961:17: note: in expansion of macro 'BPF_CAST_CALL'
12961 | insn->imm = BPF_CAST_CALL(ops->map_delete_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *, u64)' {aka 'int (* const)(struct bpf_map *, void *, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:12965:17: note: in expansion of macro 'BPF_CAST_CALL'
12965 | insn->imm = BPF_CAST_CALL(ops->map_push_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:12969:17: note: in expansion of macro 'BPF_CAST_CALL'
12969 | insn->imm = BPF_CAST_CALL(ops->map_pop_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:12973:17: note: in expansion of macro 'BPF_CAST_CALL'
12973 | insn->imm = BPF_CAST_CALL(ops->map_peek_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, u32, u64)' {aka 'int (* const)(struct bpf_map *, unsigned int, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:12977:17: note: in expansion of macro 'BPF_CAST_CALL'
12977 | insn->imm = BPF_CAST_CALL(ops->map_redirect) -
| ^~~~~~~~~~~~~
Introduced by commit
ffea83dd8823 ("Makefile: Enable -Wcast-function-type")
Please either fix all these or revert that commit for now.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2021-09-29 23:53 linux-next: build warning after merge of the kspp-gustavo tree Stephen Rothwell
@ 2021-09-30 0:05 ` Gustavo A. R. Silva
0 siblings, 0 replies; 17+ messages in thread
From: Gustavo A. R. Silva @ 2021-09-30 0:05 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Gustavo A. R. Silva, Kees Cook, Linux Kernel Mailing List,
Linux Next Mailing List
On Thu, Sep 30, 2021 at 09:53:00AM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp-gustavo tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> kernel/trace/ftrace.c: In function 'ftrace_ops_get_list_func':
> kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
> 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
> | ^
> kernel/trace/ftrace.c:174:10: note: in expansion of macro 'ftrace_ops_list_func'
> 174 | return ftrace_ops_list_func;
> | ^~~~~~~~~~~~~~~~~~~~
> kernel/trace/ftrace.c: In function 'update_ftrace_function':
> kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
> 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
> | ^
> kernel/trace/ftrace.c:207:10: note: in expansion of macro 'ftrace_ops_list_func'
> 207 | func = ftrace_ops_list_func;
> | ^~~~~~~~~~~~~~~~~~~~
> kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
> 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
> | ^
> kernel/trace/ftrace.c:220:14: note: in expansion of macro 'ftrace_ops_list_func'
> 220 | if (func == ftrace_ops_list_func) {
> | ^~~~~~~~~~~~~~~~~~~~
> kernel/trace/ftrace.c: In function 'ftrace_modify_all_code':
> kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
> 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
> | ^
> kernel/trace/ftrace.c:2698:35: note: in expansion of macro 'ftrace_ops_list_func'
> 2698 | err = ftrace_update_ftrace_func(ftrace_ops_list_func);
> | ^~~~~~~~~~~~~~~~~~~~
> kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type]
> 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
> | ^
> kernel/trace/ftrace.c:2708:41: note: in expansion of macro 'ftrace_ops_list_func'
> 2708 | if (update && ftrace_trace_function != ftrace_ops_list_func) {
> | ^~~~~~~~~~~~~~~~~~~~
The above are new to me, thanks for the report, Stephen. I'll address
them.
> In file included from kernel/bpf/hashtab.c:8:
> kernel/bpf/hashtab.c: In function 'htab_map_gen_lookup':
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'void * (*)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> include/linux/filter.h:374:14: note: in definition of macro 'BPF_EMIT_CALL'
> 374 | .imm = ((FUNC) - __bpf_call_base) })
> | ^~~~
> kernel/bpf/hashtab.c:671:26: note: in expansion of macro 'BPF_CAST_CALL'
> 671 | *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem));
> | ^~~~~~~~~~~~~
> kernel/bpf/hashtab.c: In function 'htab_lru_map_gen_lookup':
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'void * (*)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> include/linux/filter.h:374:14: note: in definition of macro 'BPF_EMIT_CALL'
> 374 | .imm = ((FUNC) - __bpf_call_base) })
> | ^~~~
> kernel/bpf/hashtab.c:712:26: note: in expansion of macro 'BPF_CAST_CALL'
> 712 | *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem));
> | ^~~~~~~~~~~~~
> kernel/bpf/hashtab.c: In function 'htab_of_map_gen_lookup':
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'void * (*)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> include/linux/filter.h:374:14: note: in definition of macro 'BPF_EMIT_CALL'
> 374 | .imm = ((FUNC) - __bpf_call_base) })
> | ^~~~
> kernel/bpf/hashtab.c:2400:26: note: in expansion of macro 'BPF_CAST_CALL'
> 2400 | *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem));
> | ^~~~~~~~~~~~~
> In file included from include/linux/bpf_verifier.h:9,
> from kernel/bpf/verifier.c:12:
> kernel/bpf/verifier.c: In function 'jit_subprogs':
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'unsigned int (*)(const void *, const struct bpf_insn *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> kernel/bpf/verifier.c:12472:16: note: in expansion of macro 'BPF_CAST_CALL'
> 12472 | insn->imm = BPF_CAST_CALL(func[subprog]->bpf_func) -
> | ^~~~~~~~~~~~~
> kernel/bpf/verifier.c: In function 'do_misc_fixups':
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'void * (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> kernel/bpf/verifier.c:12953:17: note: in expansion of macro 'BPF_CAST_CALL'
> 12953 | insn->imm = BPF_CAST_CALL(ops->map_lookup_elem) -
> | ^~~~~~~~~~~~~
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *, void *, u64)' {aka 'int (* const)(struct bpf_map *, void *, void *, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> kernel/bpf/verifier.c:12957:17: note: in expansion of macro 'BPF_CAST_CALL'
> 12957 | insn->imm = BPF_CAST_CALL(ops->map_update_elem) -
> | ^~~~~~~~~~~~~
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> kernel/bpf/verifier.c:12961:17: note: in expansion of macro 'BPF_CAST_CALL'
> 12961 | insn->imm = BPF_CAST_CALL(ops->map_delete_elem) -
> | ^~~~~~~~~~~~~
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *, u64)' {aka 'int (* const)(struct bpf_map *, void *, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> kernel/bpf/verifier.c:12965:17: note: in expansion of macro 'BPF_CAST_CALL'
> 12965 | insn->imm = BPF_CAST_CALL(ops->map_push_elem) -
> | ^~~~~~~~~~~~~
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> kernel/bpf/verifier.c:12969:17: note: in expansion of macro 'BPF_CAST_CALL'
> 12969 | insn->imm = BPF_CAST_CALL(ops->map_pop_elem) -
> | ^~~~~~~~~~~~~
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> kernel/bpf/verifier.c:12973:17: note: in expansion of macro 'BPF_CAST_CALL'
> 12973 | insn->imm = BPF_CAST_CALL(ops->map_peek_elem) -
> | ^~~~~~~~~~~~~
> include/linux/filter.h:366:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, u32, u64)' {aka 'int (* const)(struct bpf_map *, unsigned int, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
> 366 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
> | ^
> kernel/bpf/verifier.c:12977:17: note: in expansion of macro 'BPF_CAST_CALL'
> 12977 | insn->imm = BPF_CAST_CALL(ops->map_redirect) -
> | ^~~~~~~~~~~~~
All these are already fixed in bpf-next:
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=3d717fad5081b8e3bda76d86907fad95398cbde8
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=102acbacfd9a96d101abd96d1a7a5bf92b7c3e8e
>
> Introduced by commit
>
> ffea83dd8823 ("Makefile: Enable -Wcast-function-type")
>
> Please either fix all these or revert that commit for now.
Yep; I'll remove the commit and go take a look at ftrace.
Thanks for the report!
--
Gustavo
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2023-11-21 23:19 ` Stephen Rothwell
@ 2023-11-21 23:23 ` Gustavo A. R. Silva
0 siblings, 0 replies; 17+ messages in thread
From: Gustavo A. R. Silva @ 2023-11-21 23:23 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Kalle Valo, Linux Kernel Mailing List, Linux Next Mailing List
On 11/21/23 17:19, Stephen Rothwell wrote:
> Hi Gustavo,
>
> On Tue, 21 Nov 2023 17:07:32 -0600 "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>>
>> The fix for that shows up in linux-next already:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ca76817f4c4bbf8f98268772f4eeea8382a34bcd
>
> OK, so if maintainers are putting fixes exposed by this change into
> their own trees, I need to merge your tree last then ...
>
Yep; that seems to be the right way to go. :)
Thank you!
--
Gustavo
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2023-11-21 22:50 Stephen Rothwell
@ 2023-11-21 23:19 ` Gustavo A. R. Silva
0 siblings, 0 replies; 17+ messages in thread
From: Gustavo A. R. Silva @ 2023-11-21 23:19 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Linux Kernel Mailing List, Linux Next Mailing List
On 11/21/23 16:50, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp-gustavo tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> In function 'aspeed_create_fan_tach_channel',
> inlined from 'aspeed_create_fan' at drivers/hwmon/aspeed-pwm-tacho.c:877:2,
> inlined from 'aspeed_pwm_tacho_probe' at drivers/hwmon/aspeed-pwm-tacho.c:936:9:
> drivers/hwmon/aspeed-pwm-tacho.c:751:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
> 751 | priv->fan_tach_ch_source[index] = pwm_source;
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
> drivers/hwmon/aspeed-pwm-tacho.c: In function 'aspeed_pwm_tacho_probe':
> drivers/hwmon/aspeed-pwm-tacho.c:193:12: note: at offset [48, 255] into destination object 'fan_tach_ch_source' of size 16
> 193 | u8 fan_tach_ch_source[16];
> | ^~~~~~~~~~~~~~~~~~
>
> Exposed by commit
>
> 1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally")
>
> This is with your tree on top of Linus' tree (and some fix patches but
> nothing that obviously touches anything relevent) and CONFIG_WERROR
> not set.
>
Hi Stephen,
The fix for this issue is also in linux-next already:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=72cfe7a99c9ea1e64fc532f4f05c99991858dc34
Thanks!
--
Gustavo
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2023-11-21 23:07 ` Gustavo A. R. Silva
@ 2023-11-21 23:19 ` Stephen Rothwell
2023-11-21 23:23 ` Gustavo A. R. Silva
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2023-11-21 23:19 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Kalle Valo, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 450 bytes --]
Hi Gustavo,
On Tue, 21 Nov 2023 17:07:32 -0600 "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>
> The fix for that shows up in linux-next already:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ca76817f4c4bbf8f98268772f4eeea8382a34bcd
OK, so if maintainers are putting fixes exposed by this change into
their own trees, I need to merge your tree last then ...
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2023-11-21 22:47 Stephen Rothwell
@ 2023-11-21 23:07 ` Gustavo A. R. Silva
2023-11-21 23:19 ` Stephen Rothwell
0 siblings, 1 reply; 17+ messages in thread
From: Gustavo A. R. Silva @ 2023-11-21 23:07 UTC (permalink / raw)
To: Stephen Rothwell, Kalle Valo
Cc: Linux Kernel Mailing List, Linux Next Mailing List
On 11/21/23 16:47, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp-gustavo tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> In file included from include/linux/string.h:295,
> from include/linux/bitmap.h:12,
> from include/linux/cpumask.h:12,
> from arch/x86/include/asm/paravirt.h:17,
> from arch/x86/include/asm/cpuid.h:62,
> from arch/x86/include/asm/processor.h:19,
> from arch/x86/include/asm/cpufeature.h:5,
> from arch/x86/include/asm/thread_info.h:53,
> from include/linux/thread_info.h:60,
> from arch/x86/include/asm/preempt.h:9,
> from include/linux/preempt.h:79,
> from include/linux/spinlock.h:56,
> from include/linux/mmzone.h:8,
> from include/linux/gfp.h:7,
> from include/linux/firmware.h:7,
> from drivers/net/wireless/realtek/rtw89/core.h:10,
> from drivers/net/wireless/realtek/rtw89/coex.h:8,
> from drivers/net/wireless/realtek/rtw89/coex.c:5:
> drivers/net/wireless/realtek/rtw89/coex.c: In function '_append_tdma':
> include/linux/fortify-string.h:57:33: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]
> 57 | #define __underlying_memcpy __builtin_memcpy
> | ^
> include/linux/fortify-string.h:644:9: note: in expansion of macro '__underlying_memcpy'
> 644 | __underlying_##op(p, q, __fortify_size); \
> | ^~~~~~~~~~~~~
> include/linux/fortify-string.h:689:26: note: in expansion of macro '__fortify_memcpy_chk'
> 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
> | ^~~~~~~~~~~~~~~~~~~~
> drivers/net/wireless/realtek/rtw89/coex.c:1585:17: note: in expansion of macro 'memcpy'
> 1585 | memcpy(&v3->tdma, &dm->tdma, sizeof(v3->tdma));
> | ^~~~~~
> drivers/net/wireless/realtek/rtw89/core.h:2703:37: note: at offset [5714, 71249] into destination object 'ver' of size 8
> 2703 | const struct rtw89_btc_ver *ver;
> | ^~~
> include/linux/fortify-string.h:57:33: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]
> 57 | #define __underlying_memcpy __builtin_memcpy
> | ^
> include/linux/fortify-string.h:644:9: note: in expansion of macro '__underlying_memcpy'
> 644 | __underlying_##op(p, q, __fortify_size); \
> | ^~~~~~~~~~~~~
> include/linux/fortify-string.h:689:26: note: in expansion of macro '__fortify_memcpy_chk'
> 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
> | ^~~~~~~~~~~~~~~~~~~~
> drivers/net/wireless/realtek/rtw89/coex.c:1579:17: note: in expansion of macro 'memcpy'
> 1579 | memcpy(v, &dm->tdma, sizeof(*v));
> | ^~~~~~
> drivers/net/wireless/realtek/rtw89/core.h:2703:37: note: at offset [5710, 71245] into destination object 'ver' of size 8
> 2703 | const struct rtw89_btc_ver *ver;
> | ^~~
>
> Exposed by commit
>
> 1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally")
>
> This is with your tree on top of Linus' tree (and some fix patches but
> nothing that obviously touches anything relevent) and CONFIG_WERROR
> not set.
Stephen,
The fix for that shows up in linux-next already:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ca76817f4c4bbf8f98268772f4eeea8382a34bcd
Thanks for your help on this. :)
--
Gustavo
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* linux-next: build warning after merge of the kspp-gustavo tree
@ 2023-11-21 22:50 Stephen Rothwell
2023-11-21 23:19 ` Gustavo A. R. Silva
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2023-11-21 22:50 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]
Hi all,
After merging the kspp-gustavo tree, today's linux-next build (x86_64
allmodconfig) produced this warning:
In function 'aspeed_create_fan_tach_channel',
inlined from 'aspeed_create_fan' at drivers/hwmon/aspeed-pwm-tacho.c:877:2,
inlined from 'aspeed_pwm_tacho_probe' at drivers/hwmon/aspeed-pwm-tacho.c:936:9:
drivers/hwmon/aspeed-pwm-tacho.c:751:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
751 | priv->fan_tach_ch_source[index] = pwm_source;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
drivers/hwmon/aspeed-pwm-tacho.c: In function 'aspeed_pwm_tacho_probe':
drivers/hwmon/aspeed-pwm-tacho.c:193:12: note: at offset [48, 255] into destination object 'fan_tach_ch_source' of size 16
193 | u8 fan_tach_ch_source[16];
| ^~~~~~~~~~~~~~~~~~
Exposed by commit
1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally")
This is with your tree on top of Linus' tree (and some fix patches but
nothing that obviously touches anything relevent) and CONFIG_WERROR
not set.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* linux-next: build warning after merge of the kspp-gustavo tree
@ 2023-11-21 22:47 Stephen Rothwell
2023-11-21 23:07 ` Gustavo A. R. Silva
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2023-11-21 22:47 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 3589 bytes --]
Hi all,
After merging the kspp-gustavo tree, today's linux-next build (x86_64
allmodconfig) produced this warning:
In file included from include/linux/string.h:295,
from include/linux/bitmap.h:12,
from include/linux/cpumask.h:12,
from arch/x86/include/asm/paravirt.h:17,
from arch/x86/include/asm/cpuid.h:62,
from arch/x86/include/asm/processor.h:19,
from arch/x86/include/asm/cpufeature.h:5,
from arch/x86/include/asm/thread_info.h:53,
from include/linux/thread_info.h:60,
from arch/x86/include/asm/preempt.h:9,
from include/linux/preempt.h:79,
from include/linux/spinlock.h:56,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:7,
from include/linux/firmware.h:7,
from drivers/net/wireless/realtek/rtw89/core.h:10,
from drivers/net/wireless/realtek/rtw89/coex.h:8,
from drivers/net/wireless/realtek/rtw89/coex.c:5:
drivers/net/wireless/realtek/rtw89/coex.c: In function '_append_tdma':
include/linux/fortify-string.h:57:33: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]
57 | #define __underlying_memcpy __builtin_memcpy
| ^
include/linux/fortify-string.h:644:9: note: in expansion of macro '__underlying_memcpy'
644 | __underlying_##op(p, q, __fortify_size); \
| ^~~~~~~~~~~~~
include/linux/fortify-string.h:689:26: note: in expansion of macro '__fortify_memcpy_chk'
689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtw89/coex.c:1585:17: note: in expansion of macro 'memcpy'
1585 | memcpy(&v3->tdma, &dm->tdma, sizeof(v3->tdma));
| ^~~~~~
drivers/net/wireless/realtek/rtw89/core.h:2703:37: note: at offset [5714, 71249] into destination object 'ver' of size 8
2703 | const struct rtw89_btc_ver *ver;
| ^~~
include/linux/fortify-string.h:57:33: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]
57 | #define __underlying_memcpy __builtin_memcpy
| ^
include/linux/fortify-string.h:644:9: note: in expansion of macro '__underlying_memcpy'
644 | __underlying_##op(p, q, __fortify_size); \
| ^~~~~~~~~~~~~
include/linux/fortify-string.h:689:26: note: in expansion of macro '__fortify_memcpy_chk'
689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtw89/coex.c:1579:17: note: in expansion of macro 'memcpy'
1579 | memcpy(v, &dm->tdma, sizeof(*v));
| ^~~~~~
drivers/net/wireless/realtek/rtw89/core.h:2703:37: note: at offset [5710, 71245] into destination object 'ver' of size 8
2703 | const struct rtw89_btc_ver *ver;
| ^~~
Exposed by commit
1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally")
This is with your tree on top of Linus' tree (and some fix patches but
nothing that obviously touches anything relevent) and CONFIG_WERROR
not set.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2021-07-13 1:10 ` Gustavo A. R. Silva
@ 2021-07-13 2:39 ` Gustavo A. R. Silva
0 siblings, 0 replies; 17+ messages in thread
From: Gustavo A. R. Silva @ 2021-07-13 2:39 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Kees Cook, Jonathan Marek, Rob Clark, Linux Kernel Mailing List,
Linux Next Mailing List
Stephen
On 7/12/21 20:10, Gustavo A. R. Silva wrote:
> Hi Stephen,
>
> On 7/12/21 19:22, Stephen Rothwell wrote:
>> Hi all,
>>
>> After merging the kspp-gustavo tree, today's linux-next build (arm
>> multi_v7_defconfig) produced this warning:
>>
>> /home/sfr/next/next/drivers/gpu/drm/msm/msm_gem.c: In function 'msm_gem_new_impl':
>> /home/sfr/next/next/drivers/gpu/drm/msm/msm_gem.c:1170:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>> 1170 | if (priv->has_cached_coherent)
>> | ^
>> /home/sfr/next/next/drivers/gpu/drm/msm/msm_gem.c:1173:2: note: here
>> 1173 | default:
>> | ^~~~~~~
>>
>> Introduced by commit
>>
>> d12e339044a0 ("drm/msm: add MSM_BO_CACHED_COHERENT")
>>
>> Presumably exposed by commit
>>
>> 73ffc61f4a8b ("Makefile: Enable -Wimplicit-fallthrough for Clang")
>>
>> though I am not sure why since I am building with gcc. The first
>> commit above introduces a new use of /* fallthrough */
>
> We have previously adopted the new pseudo-keyword macro fallthrough; So,
> we want to avoid having more /* fallthrough */ comments being introduced.
> This is also being enforced by commit
>
> 73ffc61f4a8b ("Makefile: Enable -Wimplicit-fallthrough for Clang")
>
> for both GCC and Clang.
>
> So, the fix for this issue is merely to replace the /* fallthrough */ comment
> with fallthrough;
I've already added a fix for this to my -next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?h=for-next/kspp&id=e181ad43887c6b6b5995e9b191666f04242d77eb
Thanks for the report!
--
Gustavo
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2021-07-13 0:22 Stephen Rothwell
@ 2021-07-13 1:10 ` Gustavo A. R. Silva
2021-07-13 2:39 ` Gustavo A. R. Silva
0 siblings, 1 reply; 17+ messages in thread
From: Gustavo A. R. Silva @ 2021-07-13 1:10 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Kees Cook, Jonathan Marek, Rob Clark, Linux Kernel Mailing List,
Linux Next Mailing List
Hi Stephen,
On 7/12/21 19:22, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp-gustavo tree, today's linux-next build (arm
> multi_v7_defconfig) produced this warning:
>
> /home/sfr/next/next/drivers/gpu/drm/msm/msm_gem.c: In function 'msm_gem_new_impl':
> /home/sfr/next/next/drivers/gpu/drm/msm/msm_gem.c:1170:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> 1170 | if (priv->has_cached_coherent)
> | ^
> /home/sfr/next/next/drivers/gpu/drm/msm/msm_gem.c:1173:2: note: here
> 1173 | default:
> | ^~~~~~~
>
> Introduced by commit
>
> d12e339044a0 ("drm/msm: add MSM_BO_CACHED_COHERENT")
>
> Presumably exposed by commit
>
> 73ffc61f4a8b ("Makefile: Enable -Wimplicit-fallthrough for Clang")
>
> though I am not sure why since I am building with gcc. The first
> commit above introduces a new use of /* fallthrough */
We have previously adopted the new pseudo-keyword macro fallthrough; So,
we want to avoid having more /* fallthrough */ comments being introduced.
This is also being enforced by commit
73ffc61f4a8b ("Makefile: Enable -Wimplicit-fallthrough for Clang")
for both GCC and Clang.
So, the fix for this issue is merely to replace the /* fallthrough */ comment
with fallthrough;
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 17+ messages in thread
* linux-next: build warning after merge of the kspp-gustavo tree
@ 2021-07-13 0:22 Stephen Rothwell
2021-07-13 1:10 ` Gustavo A. R. Silva
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2021-07-13 0:22 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Kees Cook, Jonathan Marek, Rob Clark, Linux Kernel Mailing List,
Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 845 bytes --]
Hi all,
After merging the kspp-gustavo tree, today's linux-next build (arm
multi_v7_defconfig) produced this warning:
/home/sfr/next/next/drivers/gpu/drm/msm/msm_gem.c: In function 'msm_gem_new_impl':
/home/sfr/next/next/drivers/gpu/drm/msm/msm_gem.c:1170:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
1170 | if (priv->has_cached_coherent)
| ^
/home/sfr/next/next/drivers/gpu/drm/msm/msm_gem.c:1173:2: note: here
1173 | default:
| ^~~~~~~
Introduced by commit
d12e339044a0 ("drm/msm: add MSM_BO_CACHED_COHERENT")
Presumably exposed by commit
73ffc61f4a8b ("Makefile: Enable -Wimplicit-fallthrough for Clang")
though I am not sure why since I am building with gcc. The first
commit above introduces a new use of /* fallthrough */
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2021-06-23 13:14 ` David Sterba
@ 2021-06-23 18:39 ` Gustavo A. R. Silva
0 siblings, 0 replies; 17+ messages in thread
From: Gustavo A. R. Silva @ 2021-06-23 18:39 UTC (permalink / raw)
To: dsterba, Stephen Rothwell, Kees Cook, Linux Kernel Mailing List,
Linux Next Mailing List
On 6/23/21 08:14, David Sterba wrote:
> On Wed, Jun 23, 2021 at 08:39:01AM +1000, Stephen Rothwell wrote:
>> Hi all,
>>
>> After merging the kspp-gustavo tree, today's linux-next build (powerpc
>> ppc64_defconfig) produced this warning:
>>
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_16':
>> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>> 80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
>> | ~~~~~~~~~~~~~~~~^~~~~~~~~
>
> The warning is correct, on powerpc and 64k pages the array has only 1
> item, ie. only index 0 is valid. The overflow won't happen in practice
> though because of previous branch that would happen in 100% cases. The
> code handles when some bytes cross 2 pages but on 64k pages it's all
> just one page.
>
> To allow the warning to be enabled globally we'll fix it, I'll let
> Gustavo know once it's done.
Awesome. :)
Thanks, David.
--
Gustavo
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2021-06-22 22:39 Stephen Rothwell
2021-06-22 22:46 ` Gustavo A. R. Silva
@ 2021-06-23 13:14 ` David Sterba
2021-06-23 18:39 ` Gustavo A. R. Silva
1 sibling, 1 reply; 17+ messages in thread
From: David Sterba @ 2021-06-23 13:14 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Gustavo A. R. Silva, Kees Cook, Linux Kernel Mailing List,
Linux Next Mailing List
On Wed, Jun 23, 2021 at 08:39:01AM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp-gustavo tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_16':
> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
> 80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
> | ~~~~~~~~~~~~~~~~^~~~~~~~~
The warning is correct, on powerpc and 64k pages the array has only 1
item, ie. only index 0 is valid. The overflow won't happen in practice
though because of previous branch that would happen in 100% cases. The
code handles when some bytes cross 2 pages but on 64k pages it's all
just one page.
To allow the warning to be enabled globally we'll fix it, I'll let
Gustavo know once it's done.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2021-06-22 23:01 ` Gustavo A. R. Silva
@ 2021-06-23 3:03 ` Stephen Rothwell
0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2021-06-23 3:03 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Stephen Rothwell, Kees Cook, Linux Kernel Mailing List,
Linux Next Mailing List, David Sterba
[-- Attachment #1: Type: text/plain, Size: 446 bytes --]
Hi Gustavo,
On Tue, 22 Jun 2021 18:01:02 -0500 "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>
> On 6/22/21 17:46, Gustavo A. R. Silva wrote:
> > Hi Stephen,
> >
> > I will remove that commit and work on fixing those issues before
> > trying again.
>
> Done:
>
> I just removed commit 8d7900f545f1 ("Makefile: Enable -Warray-bounds"):
I have also reverted it from linux-next today.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2021-06-22 22:46 ` Gustavo A. R. Silva
@ 2021-06-22 23:01 ` Gustavo A. R. Silva
2021-06-23 3:03 ` Stephen Rothwell
0 siblings, 1 reply; 17+ messages in thread
From: Gustavo A. R. Silva @ 2021-06-22 23:01 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Kees Cook, Linux Kernel Mailing List, Linux Next Mailing List,
David Sterba
On 6/22/21 17:46, Gustavo A. R. Silva wrote:
> Hi Stephen,
>
> I will remove that commit and work on fixing those issues before
> trying again.
Done:
I just removed commit 8d7900f545f1 ("Makefile: Enable -Warray-bounds"):
https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp
Sorry for the noise.
Thanks
--
Gustavo
>
> Thanks for the report!
> --
> Gustavo
>
> On 6/22/21 17:39, Stephen Rothwell wrote:
>> Hi all,
>>
>> After merging the kspp-gustavo tree, today's linux-next build (powerpc
>> ppc64_defconfig) produced this warning:
>>
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_16':
>> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>> 80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
>> | ~~~~~~~~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 161 | DEFINE_BTRFS_SETGET_BITS(16)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_get_16':
>> fs/btrfs/struct-funcs.c:101:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
>> 101 | kaddr = page_address(eb->pages[idx + 1]); \
>> | ~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 161 | DEFINE_BTRFS_SETGET_BITS(16)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_set_token_16':
>> fs/btrfs/struct-funcs.c:133:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>> 133 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
>> | ~~~~~~~~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 161 | DEFINE_BTRFS_SETGET_BITS(16)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_set_16':
>> fs/btrfs/struct-funcs.c:156:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
>> 156 | kaddr = page_address(eb->pages[idx + 1]); \
>> | ~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 161 | DEFINE_BTRFS_SETGET_BITS(16)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_32':
>> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>> 80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
>> | ~~~~~~~~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 162 | DEFINE_BTRFS_SETGET_BITS(32)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_get_32':
>> fs/btrfs/struct-funcs.c:101:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
>> 101 | kaddr = page_address(eb->pages[idx + 1]); \
>> | ~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 162 | DEFINE_BTRFS_SETGET_BITS(32)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_set_token_32':
>> fs/btrfs/struct-funcs.c:133:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>> 133 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
>> | ~~~~~~~~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 162 | DEFINE_BTRFS_SETGET_BITS(32)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_set_32':
>> fs/btrfs/struct-funcs.c:156:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
>> 156 | kaddr = page_address(eb->pages[idx + 1]); \
>> | ~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 162 | DEFINE_BTRFS_SETGET_BITS(32)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_64':
>> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>> 80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
>> | ~~~~~~~~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 163 | DEFINE_BTRFS_SETGET_BITS(64)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_get_64':
>> fs/btrfs/struct-funcs.c:101:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
>> 101 | kaddr = page_address(eb->pages[idx + 1]); \
>> | ~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 163 | DEFINE_BTRFS_SETGET_BITS(64)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_set_token_64':
>> fs/btrfs/struct-funcs.c:133:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>> 133 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
>> | ~~~~~~~~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 163 | DEFINE_BTRFS_SETGET_BITS(64)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_set_64':
>> fs/btrfs/struct-funcs.c:156:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
>> 156 | kaddr = page_address(eb->pages[idx + 1]); \
>> | ~~~~~~~~~^~~~~~~~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
>> 163 | DEFINE_BTRFS_SETGET_BITS(64)
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>> In file included from include/linux/bvec.h:14,
>> from include/linux/blk_types.h:10,
>> from include/linux/genhd.h:19,
>> from include/linux/blkdev.h:8,
>> from fs/btrfs/disk-io.c:7:
>> fs/btrfs/disk-io.c: In function 'csum_tree_block':
>> fs/btrfs/disk-io.c:225:34: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>> 225 | kaddr = page_address(buf->pages[i]);
>> | ~~~~~~~~~~^~~
>> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
>> 1627 | #define page_address(page) lowmem_page_address(page)
>> | ^~~~
>> In file included from fs/btrfs/ctree.h:32,
>> from fs/btrfs/disk-io.c:22:
>> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
>> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
>> | ^~~~~
>>
>> Introduced by commit
>>
>> 8d7900f545f1 ("Makefile: Enable -Warray-bounds")
>>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: build warning after merge of the kspp-gustavo tree
2021-06-22 22:39 Stephen Rothwell
@ 2021-06-22 22:46 ` Gustavo A. R. Silva
2021-06-22 23:01 ` Gustavo A. R. Silva
2021-06-23 13:14 ` David Sterba
1 sibling, 1 reply; 17+ messages in thread
From: Gustavo A. R. Silva @ 2021-06-22 22:46 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Kees Cook, Linux Kernel Mailing List, Linux Next Mailing List,
David Sterba
Hi Stephen,
I will remove that commit and work on fixing those issues before
trying again.
Thanks for the report!
--
Gustavo
On 6/22/21 17:39, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp-gustavo tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_16':
> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
> 80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
> | ~~~~~~~~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 161 | DEFINE_BTRFS_SETGET_BITS(16)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_get_16':
> fs/btrfs/struct-funcs.c:101:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
> 101 | kaddr = page_address(eb->pages[idx + 1]); \
> | ~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 161 | DEFINE_BTRFS_SETGET_BITS(16)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_set_token_16':
> fs/btrfs/struct-funcs.c:133:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
> 133 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
> | ~~~~~~~~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 161 | DEFINE_BTRFS_SETGET_BITS(16)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_set_16':
> fs/btrfs/struct-funcs.c:156:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
> 156 | kaddr = page_address(eb->pages[idx + 1]); \
> | ~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 161 | DEFINE_BTRFS_SETGET_BITS(16)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_32':
> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
> 80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
> | ~~~~~~~~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 162 | DEFINE_BTRFS_SETGET_BITS(32)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_get_32':
> fs/btrfs/struct-funcs.c:101:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
> 101 | kaddr = page_address(eb->pages[idx + 1]); \
> | ~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 162 | DEFINE_BTRFS_SETGET_BITS(32)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_set_token_32':
> fs/btrfs/struct-funcs.c:133:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
> 133 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
> | ~~~~~~~~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 162 | DEFINE_BTRFS_SETGET_BITS(32)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_set_32':
> fs/btrfs/struct-funcs.c:156:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
> 156 | kaddr = page_address(eb->pages[idx + 1]); \
> | ~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 162 | DEFINE_BTRFS_SETGET_BITS(32)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_64':
> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
> 80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
> | ~~~~~~~~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 163 | DEFINE_BTRFS_SETGET_BITS(64)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_get_64':
> fs/btrfs/struct-funcs.c:101:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
> 101 | kaddr = page_address(eb->pages[idx + 1]); \
> | ~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 163 | DEFINE_BTRFS_SETGET_BITS(64)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_set_token_64':
> fs/btrfs/struct-funcs.c:133:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
> 133 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
> | ~~~~~~~~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 163 | DEFINE_BTRFS_SETGET_BITS(64)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from fs/btrfs/ctree.h:9,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_set_64':
> fs/btrfs/struct-funcs.c:156:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
> 156 | kaddr = page_address(eb->pages[idx + 1]); \
> | ~~~~~~~~~^~~~~~~~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
> 163 | DEFINE_BTRFS_SETGET_BITS(64)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
> In file included from include/linux/bvec.h:14,
> from include/linux/blk_types.h:10,
> from include/linux/genhd.h:19,
> from include/linux/blkdev.h:8,
> from fs/btrfs/disk-io.c:7:
> fs/btrfs/disk-io.c: In function 'csum_tree_block':
> fs/btrfs/disk-io.c:225:34: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
> 225 | kaddr = page_address(buf->pages[i]);
> | ~~~~~~~~~~^~~
> include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
> 1627 | #define page_address(page) lowmem_page_address(page)
> | ^~~~
> In file included from fs/btrfs/ctree.h:32,
> from fs/btrfs/disk-io.c:22:
> fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
> 97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
> | ^~~~~
>
> Introduced by commit
>
> 8d7900f545f1 ("Makefile: Enable -Warray-bounds")
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* linux-next: build warning after merge of the kspp-gustavo tree
@ 2021-06-22 22:39 Stephen Rothwell
2021-06-22 22:46 ` Gustavo A. R. Silva
2021-06-23 13:14 ` David Sterba
0 siblings, 2 replies; 17+ messages in thread
From: Stephen Rothwell @ 2021-06-22 22:39 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Kees Cook, Linux Kernel Mailing List, Linux Next Mailing List,
David Sterba
[-- Attachment #1: Type: text/plain, Size: 13061 bytes --]
Hi all,
After merging the kspp-gustavo tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_16':
fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
| ~~~~~~~~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
161 | DEFINE_BTRFS_SETGET_BITS(16)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_get_16':
fs/btrfs/struct-funcs.c:101:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
101 | kaddr = page_address(eb->pages[idx + 1]); \
| ~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
161 | DEFINE_BTRFS_SETGET_BITS(16)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_set_token_16':
fs/btrfs/struct-funcs.c:133:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
133 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
| ~~~~~~~~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
161 | DEFINE_BTRFS_SETGET_BITS(16)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_set_16':
fs/btrfs/struct-funcs.c:156:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
156 | kaddr = page_address(eb->pages[idx + 1]); \
| ~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:161:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
161 | DEFINE_BTRFS_SETGET_BITS(16)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_32':
fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
| ~~~~~~~~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
162 | DEFINE_BTRFS_SETGET_BITS(32)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_get_32':
fs/btrfs/struct-funcs.c:101:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
101 | kaddr = page_address(eb->pages[idx + 1]); \
| ~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
162 | DEFINE_BTRFS_SETGET_BITS(32)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_set_token_32':
fs/btrfs/struct-funcs.c:133:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
133 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
| ~~~~~~~~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
162 | DEFINE_BTRFS_SETGET_BITS(32)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_set_32':
fs/btrfs/struct-funcs.c:156:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
156 | kaddr = page_address(eb->pages[idx + 1]); \
| ~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:162:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
162 | DEFINE_BTRFS_SETGET_BITS(32)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_64':
fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
| ~~~~~~~~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
163 | DEFINE_BTRFS_SETGET_BITS(64)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_get_64':
fs/btrfs/struct-funcs.c:101:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
101 | kaddr = page_address(eb->pages[idx + 1]); \
| ~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
163 | DEFINE_BTRFS_SETGET_BITS(64)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_set_token_64':
fs/btrfs/struct-funcs.c:133:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
133 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
| ~~~~~~~~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
163 | DEFINE_BTRFS_SETGET_BITS(64)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from fs/btrfs/ctree.h:9,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/struct-funcs.c: In function 'btrfs_set_64':
fs/btrfs/struct-funcs.c:156:32: warning: array subscript 1 is above array bounds of 'struct page * const[1]' [-Warray-bounds]
156 | kaddr = page_address(eb->pages[idx + 1]); \
| ~~~~~~~~~^~~~~~~~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
fs/btrfs/struct-funcs.c:163:1: note: in expansion of macro 'DEFINE_BTRFS_SETGET_BITS'
163 | DEFINE_BTRFS_SETGET_BITS(64)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/struct-funcs.c:8:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
In file included from include/linux/bvec.h:14,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from include/linux/blkdev.h:8,
from fs/btrfs/disk-io.c:7:
fs/btrfs/disk-io.c: In function 'csum_tree_block':
fs/btrfs/disk-io.c:225:34: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
225 | kaddr = page_address(buf->pages[i]);
| ~~~~~~~~~~^~~
include/linux/mm.h:1627:48: note: in definition of macro 'page_address'
1627 | #define page_address(page) lowmem_page_address(page)
| ^~~~
In file included from fs/btrfs/ctree.h:32,
from fs/btrfs/disk-io.c:22:
fs/btrfs/extent_io.h:97:15: note: while referencing 'pages'
97 | struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
| ^~~~~
Introduced by commit
8d7900f545f1 ("Makefile: Enable -Warray-bounds")
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2023-11-21 23:23 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 23:53 linux-next: build warning after merge of the kspp-gustavo tree Stephen Rothwell
2021-09-30 0:05 ` Gustavo A. R. Silva
-- strict thread matches above, loose matches on Subject: below --
2023-11-21 22:50 Stephen Rothwell
2023-11-21 23:19 ` Gustavo A. R. Silva
2023-11-21 22:47 Stephen Rothwell
2023-11-21 23:07 ` Gustavo A. R. Silva
2023-11-21 23:19 ` Stephen Rothwell
2023-11-21 23:23 ` Gustavo A. R. Silva
2021-07-13 0:22 Stephen Rothwell
2021-07-13 1:10 ` Gustavo A. R. Silva
2021-07-13 2:39 ` Gustavo A. R. Silva
2021-06-22 22:39 Stephen Rothwell
2021-06-22 22:46 ` Gustavo A. R. Silva
2021-06-22 23:01 ` Gustavo A. R. Silva
2021-06-23 3:03 ` Stephen Rothwell
2021-06-23 13:14 ` David Sterba
2021-06-23 18:39 ` Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).