[Bug c/82411] New: const is not always read-only
kees at outflux dot net
gcc-bugzilla@gcc.gnu.org
Mon Oct 2 20:26:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82411
Bug ID: 82411
Summary: const is not always read-only
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: kees at outflux dot net
Target Milestone: ---
On powerpc, a const variable may end up in the .sdata section, which is
writable. This means authors cannot depend on the "const" marking to mean
"read-only", as is required for sane Linux kernel memory protection security.
Thread here:
https://lkml.org/lkml/2017/10/2/488
At the very least, there should be a way to request never putting a const
variable into a writable section.
More information about the Gcc-bugs
mailing list