-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf: avoid uninitialized warnings in verifier_global_subprogs.c #6989
Conversation
Upstream branch: 329a672 |
Upstream branch: 329a672 |
29887c3
to
13e181f
Compare
459d932
to
ba083f5
Compare
Upstream branch: 75b0fbf |
13e181f
to
7700834
Compare
ba083f5
to
20150dc
Compare
Upstream branch: 93d1c2d |
7700834
to
9408b38
Compare
20150dc
to
606f72a
Compare
Upstream branch: 7e2c7a3 |
9408b38
to
941ed55
Compare
606f72a
to
041b1be
Compare
Upstream branch: e612b5c |
[Changes from V1: - The warning to disable is -Wmaybe-uninitialized, not -Wuninitialized. - This warning is only supported in GCC.] The BPF selftest verifier_global_subprogs.c contains code that purposedly performs out of bounds access to memory, to check whether the kernel verifier is able to catch them. For example: __noinline int global_unsupp(const int *mem) { if (!mem) return 0; return mem[100]; /* BOOM */ } With -O1 and higher and no inlining, GCC notices this fact and emits a "maybe uninitialized" warning. This is by design. Note that the emission of these warnings is highly dependent on the precise optimizations that are performed. This patch adds a compiler pragma to verifier_global_subprogs.c to ignore these warnings. Tested in bpf-next master. No regressions. Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Cc: david.faust@oracle.com Cc: cupertino.miranda@oracle.com Cc: Yonghong Song <yonghong.song@linux.dev> Cc: Eduard Zingerman <eddyz87@gmail.com> Acked-by: Yonghong Song <yonghong.song@linux.dev>
941ed55
to
5495437
Compare
041b1be
to
63334d2
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=851308 irrelevant now. Closing PR. |
Pull request for series with
subject: bpf: avoid uninitialized warnings in verifier_global_subprogs.c
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=851216