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

'Invalid initializer': spl-0.6.58 + Gentoo sys-kernel/hardened-sources-4.7.9 (grsec) #5390

Closed
globalcitizen opened this issue Nov 13, 2016 · 7 comments

Comments

@globalcitizen
Copy link

Saw some older bugs mentioning this sort of 'invalid initializer' error compiling spl, suggesting KRANDSTACK was the issue. Well, disabling that didn't work this time, but disabling grsec entirely did. After rebuilding the kernel (no other changes) spl and zfs / zfs-kmod compile and install fine.

I am still not sure what the particular grsec feature is which causes this.

@ryao
Copy link
Contributor

ryao commented Nov 13, 2016

@globalcitizen Thanks for opening the bug. Reviewing things on hardened is on my to do list.

@globalcitizen
Copy link
Author

I might have time to look in to this further on Wednesday or Thursday.

@perfinion
Copy link
Contributor

@globalcitizen KRANDSTACK was ages ago when i was mistaken. the option that causes problems is RANDSTRUCT. do you have that one disabled? Also, can you show more of the build.log that you're getting?

@globalcitizen
Copy link
Author

I'm on the road and the system in question is in another city. I will take a look in a day or two when I am with the machine again and try to get the log copied here.

@globalcitizen
Copy link
Author

Sorry - I ran out of time with the server and had to put it in colo today. Good luck tracking down the issue!

@ajs124
Copy link
Contributor

ajs124 commented Nov 22, 2017

So this is a problem with mainline now, as CONFIG_GCC_PLUGIN_RANDSTRUCT is available since 4.13 and randomizes all structures that aren't marked with __no_randomize_layout since 4.14.

Maybe the relevant structures should be marked or the underlying issue resolved, if it can be. I don't understand much about the matter, if I'm honest, I just ran into this issue recently.

@perfinion
Copy link
Contributor

I'm working on this. I have a WIP that mostly builds. I'll be kinda busy the next few days but will hopefully push a PR soon so the buildbots can run on it.
its mostly just a matter of using designated initializers on structs with all function pointers

behlendorf pushed a commit to tonyhutter/zfs that referenced this issue Nov 28, 2017
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Mark Wright <[email protected]>
Closes openzfs#5390
Closes openzfs#6903

Requires-spl: refs/pull/669/head
behlendorf pushed a commit to tonyhutter/zfs that referenced this issue Dec 1, 2017
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Mark Wright <[email protected]>
Closes openzfs#5390
Closes openzfs#6903

Requires-spl: refs/pull/669/head
tonyhutter pushed a commit that referenced this issue Dec 5, 2017
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Mark Wright <[email protected]>
Closes #5390
Closes #6903
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Dec 5, 2017
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Mark Wright <[email protected]>
Closes openzfs#5390
Closes openzfs#6903
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this issue Jan 29, 2018
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Mark Wright <[email protected]>
Closes openzfs#5390
Closes openzfs#6903
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this issue Feb 13, 2018
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Mark Wright <[email protected]>
Closes openzfs#5390
Closes openzfs#6903
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants