[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e9a1bd633fb4bb3d2820f63f41a8dd60d8c9c5e3c699fa56057ae393ef2f31d0@mail.kernel.org>
Date: Wed, 31 Dec 2025 18:04:13 +0000 (UTC)
From: bot+bpf-ci@...nel.org
To: csander@...estorage.com,jikos@...nel.org,bentiss@...nel.org,ast@...nel.org,daniel@...earbox.net,john.fastabend@...il.com,andrii@...nel.org,martin.lau@...ux.dev,eddyz87@...il.com,song@...nel.org,yonghong.song@...ux.dev,kpsingh@...nel.org,sdf@...ichev.me,haoluo@...gle.com,jolsa@...nel.org,tj@...nel.org,void@...ifault.com,arighi@...dia.com,changwoo@...lia.com,mingo@...hat.com,peterz@...radead.org,juri.lelli@...hat.com,vincent.guittot@...aro.org,dietmar.eggemann@....com,rostedt@...dmis.org,bsegall@...gle.com,mgorman@...e.de,vschneid@...hat.com,davem@...emloft.net,edumazet@...gle.com,kuba@...nel.org,pabeni@...hat.com,horms@...nel.org,dsahern@...nel.org,jhs@...atatu.com,xiyou.wangcong@...il.com,jiri@...nulli.us,alibuda@...ux.alibaba.com,dust.li@...ux.alibaba.com,sidraya@...ux.ibm.com,wenjia@...ux.ibm.com,mjambigi@...ux.ibm.com,tonylu@...ux.alibaba.com,guwen@...ux.alibaba.com,shuah@...nel.org,mcoquelin.stm32@...il.com,alexandre.torgue@...s.st.com
Cc: linux-input@...r.kernel.org,linux-kernel@...r.kernel.org,bpf@...r.kernel.org,netdev@...r.kernel.org,sched-ext@...ts.linux.dev,linux-rdma@...r.kernel.org,linux-s390@...r.kernel.org,linux-kselftest@...r.kernel.org,linux-stm32@...md-mailman.stormreply.com,linux-arm-kernel@...ts.infradead.org,csander@...estorage.com,ast@...nel.org,andrii@...nel.org,daniel@...earbox.net,martin.lau@...nel.org,eddyz87@...il.com,yonghong.song@...ux.dev,clm@...a.com,ihor.solodrai@...ux.dev
Subject: Re: [PATCH 5/5] selftests/bpf: make cfi_stubs globals const
> diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
> index 90c4b1a51de6..5e460b1dbdb6 100644
> --- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
> +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
[ ... ]
> @@ -1275,7 +1275,7 @@ bpf_testmod_ops__test_return_ref_kptr(int dummy, struct task_struct *task__ref,
> return NULL;
> }
>
> -static struct bpf_testmod_ops __bpf_testmod_ops = {
> +static const struct bpf_testmod_ops __bpf_testmod_ops = {
> .test_1 = bpf_testmod_test_1,
> .test_2 = bpf_testmod_test_2,
Is it safe to make __bpf_testmod_ops const here? In bpf_testmod_init(),
this struct is modified at runtime:
tramp = (void **)&__bpf_testmod_ops.tramp_1;
while (tramp <= (void **)&__bpf_testmod_ops.tramp_40)
*tramp++ = bpf_testmod_tramp;
Writing to a const-qualified object is undefined behavior and may cause a
protection fault when the compiler places this in read-only memory. Would
the module fail to load on systems where .rodata is actually read-only?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/20624206229
Powered by blists - more mailing lists