From: Antoine Tenart <atenart@kernel.org> Date: 2021-11-22 14:25:32
When checking an address is located in a global data section also check
for the .bss section as global variables initialized to 0 can be in
there (-fzero-initialized-in-bss).
This was found when looking at ensure_safe_net_sysctl which was failing
to detect non-init sysctl pointing to a global data section when the
data was in the .bss section.
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
A few remarks:
- This still targets net-next but I added Arnd if he prefers to take it
through the 'asm-generic' tree, now that is_kernel_core_data is in
include/asm-generic/.
- I kept the Acked-by tag as the change is the same really, the
difference is the core_kernel_data function was renamed to
is_kernel_core_data and moved since then.
- @Jonathon: with your analysis and suggestion I think you should be
listed as a co-developer. If that's fine please say so, and reply
with both a Co-developed-by and a Signed-off-by tags.
Since v1:
- Grouped the .data and .bss checks in the same function.
v1 was https://lore.kernel.org/all/20211020083854.1101670-1-atenart@kernel.org/T/
Thanks!
Antoine
include/asm-generic/sections.h | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
On Mon, Nov 22, 2021 at 3:24 PM Antoine Tenart [off-list ref] wrote:
When checking an address is located in a global data section also check
for the .bss section as global variables initialized to 0 can be in
there (-fzero-initialized-in-bss).
This was found when looking at ensure_safe_net_sysctl which was failing
to detect non-init sysctl pointing to a global data section when the
data was in the .bss section.
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
A few remarks:
- This still targets net-next but I added Arnd if he prefers to take it
through the 'asm-generic' tree, now that is_kernel_core_data is in
include/asm-generic/.
I have nothing else for asm-generic at the moment, please take
this through net-next.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller [off-list ref]:
On Mon, 22 Nov 2021 15:24:56 +0100 you wrote:
When checking an address is located in a global data section also check
for the .bss section as global variables initialized to 0 can be in
there (-fzero-initialized-in-bss).
This was found when looking at ensure_safe_net_sysctl which was failing
to detect non-init sysctl pointing to a global data section when the
data was in the .bss section.
[...]
On Mon, Nov 22, 2021 at 9:24 AM Antoine Tenart [off-list ref] wrote:
When checking an address is located in a global data section also check
for the .bss section as global variables initialized to 0 can be in
there (-fzero-initialized-in-bss).
This was found when looking at ensure_safe_net_sysctl which was failing
to detect non-init sysctl pointing to a global data section when the
data was in the .bss section.
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
A few remarks:
- This still targets net-next but I added Arnd if he prefers to take it
through the 'asm-generic' tree, now that is_kernel_core_data is in
include/asm-generic/.
- I kept the Acked-by tag as the change is the same really, the
difference is the core_kernel_data function was renamed to
is_kernel_core_data and moved since then.
- @Jonathon: with your analysis and suggestion I think you should be
listed as a co-developer. If that's fine please say so, and reply
with both a Co-developed-by and a Signed-off-by tags.
Added, thanks. Although it appears I may have missed the boat.
From: Antoine Tenart <atenart@kernel.org> Date: 2021-11-22 16:59:53
Quoting Jonathon Reinhart (2021-11-22 17:56:55)
On Mon, Nov 22, 2021 at 9:24 AM Antoine Tenart [off-list ref] wrote:
quoted
- @Jonathon: with your analysis and suggestion I think you should be
listed as a co-developer. If that's fine please say so, and reply
with both a Co-developed-by and a Signed-off-by tags.
Added, thanks. Although it appears I may have missed the boat.
Yes, the patch was applied quickly. Anyway, thanks for the investigation!
Antoine