Skip to content
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

ICP fails to build #4947

Closed
perfinion opened this issue Aug 9, 2016 · 0 comments
Closed

ICP fails to build #4947

perfinion opened this issue Aug 9, 2016 · 0 comments
Labels
Type: Building Indicates an issue related to building binaries
Milestone

Comments

@perfinion
Copy link
Contributor

After the ZFS crypto stuff was merged into master I can no longer build on my hardened machines.
This failure is with 4.4.8-hardened-r1 in gentoo. I tried a later version and it failed too but forgot which. The kernel config has been unchanged for ages and had worked before commit 0b04990 on both master and 0.6.5.x. I don't have any non-hardened machines so not sure if this is hardened related or not.

meriadoc ~ # gcc --version
gcc (Gentoo Hardened 4.9.3 p1.5, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c: In function ‘copy_ops_vector_v1’:
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_control_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:74:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_control_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_digest_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:75:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_digest_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_cipher_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:76:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_cipher_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_mac_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:77:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_mac_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_sign_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:78:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_sign_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_verify_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:79:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_verify_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_dual_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:80:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_dual_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_dual_cipher_mac_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:81:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_dual_cipher_mac_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_random_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:82:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_random_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_session_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:83:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_session_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_object_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:84:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_object_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_key_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:85:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_key_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_provider_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:86:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_provider_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_ctx_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:87:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_ctx_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c: In function ‘copy_ops_vector_v2’:
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v2.co_mech_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:93:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_mech_ops);
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c: In function ‘copy_ops_vector_v3’:
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v3.co_nostore_key_ops’
  *((dst)->ops) = *((src)->ops);
                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.c:99:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_nostore_key_ops);
  ^
  CC [M]  /var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/ddt_zap.o
/usr/src/linux-4.4.8-hardened-r1/scripts/Makefile.build:258: recipe for target '/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.o' failed
make[6]: *** [/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp/spi/kcf_spi.o] Error 1
/usr/src/linux-4.4.8-hardened-r1/scripts/Makefile.build:403: recipe for target '/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp' failed
make[5]: *** [/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/icp] Error 2
make[5]: *** Waiting for unfinished jobs....

@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Aug 9, 2016
@behlendorf behlendorf added this to the 0.7.0 milestone Aug 9, 2016
perfinion added a commit to perfinion/zfs that referenced this issue Aug 11, 2016
The constify plugin will automatically constify a class of types that contain
only function pointers. The icp structs fail to build if this is enabled with
the following error. The no_const attribute makes the plugin skip those
structs.

module/icp/spi/kcf_spi.c: In function ‘copy_ops_vector_v1’:
module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_control_ops’
  *((dst)->ops) = *((src)->ops);
                ^
module/icp/spi/kcf_spi.c:74:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_control_ops);
  ^

Signed-off-by: Jason Zaman <[email protected]>

Fixes: openzfs#4947
perfinion added a commit to perfinion/zfs that referenced this issue Aug 11, 2016
The constify plugin will automatically constify a class of types that contain
only function pointers. The icp structs fail to build if this is enabled with
the following error. The no_const attribute makes the plugin skip those
structs.

module/icp/spi/kcf_spi.c: In function ‘copy_ops_vector_v1’:
module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_control_ops’
  *((dst)->ops) = *((src)->ops);
                ^
module/icp/spi/kcf_spi.c:74:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’
  KCF_SPI_COPY_OPS(src_ops, dst_ops, co_control_ops);
  ^

Signed-off-by: Jason Zaman <[email protected]>

Fixes: openzfs#4947
behlendorf pushed a commit that referenced this issue Aug 12, 2016
If there is no explicit note in the .S files, the obj file will mark it
as requiring an executable stack. This is unneeded and causes issues on
hardened systems.

More info:
https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart

Signed-off-by: Jason Zaman <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4947
Closes #4962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants