Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 463012 - sys-kernel/spl-9999 with sys-kernel/hardened-sources module/spl/spl-proc.c:423:9: error: assignment of member ‘data’ in read-only object
Summary: sys-kernel/spl-9999 with sys-kernel/hardened-sources module/spl/spl-proc.c:42...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Richard Yao (RETIRED)
URL:
Whiteboard:
Keywords: LATER
Depends on:
Blocks:
 
Reported: 2013-03-24 19:51 UTC by Marcin Mirosław
Modified: 2015-05-10 14:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,28.05 KB, text/plain)
2013-03-24 19:52 UTC, Marcin Mirosław
Details
Patch that resolves this issue, but breaks builds on older kernels (patch,1.51 KB, patch)
2013-03-29 03:37 UTC, Richard Yao (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Mirosław 2013-03-24 19:51:06 UTC
I've got compilation error on hardened-sources:
 CC [M]  /var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-zlib.o
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c: In function ‘proc_domemused’:
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c:423:9: error: assignment of member ‘data’ in read-only object
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c:424:9: error: assignment of member ‘proc_handler’ in read-only object
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c:425:9: error: assignment of member ‘extra1’ in read-only object
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c:426:9: error: assignment of member ‘extra2’ in read-only object
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c: In function ‘proc_doslab’:
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c:451:9: error: assignment of member ‘data’ in read-only object
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c:452:9: error: assignment of member ‘proc_handler’ in read-only object
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c:453:9: error: assignment of member ‘extra1’ in read-only object
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.c:454:9: error: assignment of member ‘extra2’ in read-only object
make[5]: *** [/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-proc.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl] Error 2
make[3]: *** [_module_/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module] Error 2
make[3]: Leaving directory `/usr/src/linux-3.8.4-hardened'
make[2]: *** [modules] Error 2
make[2]: Leaving directory `/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999'
make: *** [all] Error 2
 * ERROR: sys-kernel/spl-9999 failed (compile phase):
 *   emake failed

Reproducible: Always
Comment 1 Marcin Mirosław 2013-03-24 19:52:37 UTC
Created attachment 343150 [details]
build.log
Comment 2 Marcin Mirosław 2013-03-24 19:56:09 UTC
Portage 2.1.11.55 (hardened/linux/amd64, gcc-4.7.2, glibc-2.15-r3, 3.8.0-hardened x86_64)
=================================================================
System uname: Linux-3.8.0-hardened-x86_64-Intel-R-_Xeon-R-_CPU_E3-1230_V2_@_3.30GHz-with-gentoo-2.1
KiB Mem:    16451008 total,   2430524 free
KiB Swap:    4193264 total,   4193264 free
Timestamp of tree: Sun, 24 Mar 2013 05:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3-r2
dev-util/ccache:          3.1.9
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.7.2-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo qemu-init
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -frecord-gcc-switches 	-fno-unwind-tables -fno-asynchronous-unwind-tables	-fexpensive-optimizations"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -frecord-gcc-switches 	-fno-unwind-tables -fno-asynchronous-unwind-tables	-fexpensive-optimizations"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache collision-protect compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="pl_PL.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="-O"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/qemu-init"
SYNC="rsync://gentoo-mirror/gentoo-portage"
USE="acl acpi amd64 avx bash-completion caps custom-cflags cxx hardened hwdb iconv ipv6 mmxext multilib nls openmp sse2 sse3 sse4 sse41 sse4_1 ssse3 threads udev unicode vim-syntax xattr" ABI_X86="64" CURL_SSL="openssl" ELIBC="glibc" GRUB_PLATFORMS="multiboot pc" KERNEL="linux" LINGUAS="en" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON
Comment 3 Richard Yao (RETIRED) gentoo-dev 2013-03-25 13:39:00 UTC
This is a known issue. It was caused by constification of new data structures in the PaX/GrSecurity patches for Linux 3.8.x. A fix is already in development.
Comment 4 Richard Yao (RETIRED) gentoo-dev 2013-03-29 03:37:27 UTC
Created attachment 343576 [details, diff]
Patch that resolves this issue, but breaks builds on older kernels

I have written a patch that can be applied to the spl to workaround this, but it breaks compatibility with older PaX kernels. I will need to rework it before I can put it into the tree. Anyone affected by this can apply it locally by putting it into the following file:

/etc/portage/patches/sys-kernel/spl-0.6.1/spl-0.6.1-pax-3.8-compat.patch
Comment 5 Marcin Mirosław 2013-03-29 18:23:46 UTC
Thanks for patch, now spl compiles fine.
Comment 6 Richard Yao (RETIRED) gentoo-dev 2013-04-25 20:32:44 UTC
I have committed sys-kernel/spl-0.6.1-r1 with the attached patch. It is conditionally applied to kernels that are 3.8 or later because it breaks some older PaX-patched kernels. I am not comfortable with this solution, so I will leave it open until one that can go upstream is available.
Comment 7 Dirk Best 2013-04-27 12:53:13 UTC
(In reply to comment #4)
> Created attachment 343576 [details, diff] [details, diff]
> Patch that resolves this issue, but breaks builds on older kernels
> 
> I have written a patch that can be applied to the spl to workaround this,
> but it breaks compatibility with older PaX kernels. I will need to rework it
> before I can put it into the tree. Anyone affected by this can apply it
> locally by putting it into the following file:
> 
> /etc/portage/patches/sys-kernel/spl-0.6.1/spl-0.6.1-pax-3.8-compat.patch

It compiles fine using the patch, but the resulting binary just kernel panics once you mount zfs filesystems.
Comment 8 Richard Yao (RETIRED) gentoo-dev 2013-05-09 09:48:35 UTC
(In reply to comment #7)
> (In reply to comment #4)
> > Created attachment 343576 [details, diff] [details, diff] [details, diff]
> > Patch that resolves this issue, but breaks builds on older kernels
> > 
> > I have written a patch that can be applied to the spl to workaround this,
> > but it breaks compatibility with older PaX kernels. I will need to rework it
> > before I can put it into the tree. Anyone affected by this can apply it
> > locally by putting it into the following file:
> > 
> > /etc/portage/patches/sys-kernel/spl-0.6.1/spl-0.6.1-pax-3.8-compat.patch
> 
> It compiles fine using the patch, but the resulting binary just kernel
> panics once you mount zfs filesystems.

Do you have a backtrace?
Comment 9 Dirk Best 2013-07-23 09:49:30 UTC
I've tried it now again with sys-kernel/hardened-sources-3.9.5, sys-fs/zfs-0.6.1-r3, sys-fs/zfs-kmod-0.6.1-r2, sys-kernel/spl-0.6.1-r3. The kernel now faults once Apache is started (its vhosts are on zfs filesystems). Here is the crash: http://imgur.com/a/uTXIi

The same setup works using sys-kernel/hardened-sources-3.7.5-r1 (and current version of zfs packages).
Comment 10 Dirk Best 2013-07-23 12:21:33 UTC
Disabling CONFIG_PAX_CONSTIFY_PLUGIN like suggested in bug #477226 resolves this issue, no more kernel panics.
Comment 11 Anthony Basile gentoo-dev 2015-05-10 14:45:51 UTC
This is an old bug which got a patch and a workaround, but I don't now if anything landed in the tree.  I'm closing it obsolete.  Please reopen if someone wants to pick this up.