openzfs / spl

A shim layer which adds the core interfaces required for OpenZFS.
https://zfsonlinux.org/
GNU General Public License v2.0
282 stars 181 forks source link

4.14.73+grsec: configure failure #709

Closed NoAgendaIT closed 4 years ago

NoAgendaIT commented 5 years ago

The short and sweet of it:

checking whether set_fs_pwd() requires const struct path *... configure: error: unknown

This is on spl-0.7-release, linux 64 bit with 4.14.73, patched with the gentoo patches and, more specifically to the error: grsecurity (stable). The gcc version is 7.3.1.

The full error (config.log):

configure:16337: checking whether set_fs_pwd() requires const struct path *
configure:16369: cp conftest.c build && make modules -C /usr/src/linux EXTRA_CFLAGS=-Werror-implicit-function-declaration -Werror  M=/usr/src/patches/spl/build modpost=true
In file included from ./arch/x86/include/asm/preempt.h:7:0,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from /usr/src/patches/spl/build/conftest.c:34:
./include/linux/thread_info.h:23:44: error: ‘current_thread_info’ declared ‘static’ but never defined [-Werror=unused-function]
 static __always_inline struct thread_info *current_thread_info(void);
                                            ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:339: /usr/src/patches/spl/build/conftest.o] Error 1
make: *** [Makefile:1535: _module_/usr/src/patches/spl/build] Error 2
configure:16372: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "spl"
| #define PACKAGE_TARNAME "spl"
| #define PACKAGE_VERSION "0.7.11"
| #define PACKAGE_STRING "spl 0.7.11"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define SPL_META_NAME "spl"
| #define SPL_META_VERSION "0.7.11"
| #define SPL_META_RELEASE "1"
| #define SPL_META_LICENSE "GPL"
| #define SPL_META_ALIAS "spl-0.7.11-1"
| #define SPL_META_AUTHOR "OpenZFS on Linux"
| #define PACKAGE "spl"
| #define VERSION "0.7.11"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define SPL_IS_GPL_COMPATIBLE 1
| #define HAVE_ATOMIC64_T 1
| #define HAVE_SPLIT_SHRINKER_CALLBACK 1
| #define HAVE_PDE_DATA 1
| 
| 
|       #include <linux/spinlock.h>
|       #include <linux/fs_struct.h>
|       #include <linux/path.h>
|       void (*const set_fs_pwd_func)
|           (struct fs_struct *, const struct path *)
|           = set_fs_pwd;
| 
| int
| main (void)
| {
| 
|       return 0;
| 
|   ;
|   return 0;
| }
| 
configure:16420: cp conftest.c build && make modules -C /usr/src/linux EXTRA_CFLAGS=-Werror-implicit-function-declaration -Werror  M=/usr/src/patches/spl/build modpost=true
/usr/src/patches/spl/build/conftest.c:39:7: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     = set_fs_pwd;
       ^~~~~~~~~~
In file included from ./arch/x86/include/asm/preempt.h:7:0,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from /usr/src/patches/spl/build/conftest.c:34:
./include/linux/thread_info.h:23:44: error: ‘current_thread_info’ declared ‘static’ but never defined [-Werror=unused-function]
 static __always_inline struct thread_info *current_thread_info(void);
                                            ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:339: /usr/src/patches/spl/build/conftest.o] Error 1
make: *** [Makefile:1535: _module_/usr/src/patches/spl/build] Error 2
configure:16423: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "spl"
| #define PACKAGE_TARNAME "spl"
| #define PACKAGE_VERSION "0.7.11"
| #define PACKAGE_STRING "spl 0.7.11"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define SPL_META_NAME "spl"
| #define SPL_META_VERSION "0.7.11"
| #define SPL_META_RELEASE "1"
| #define SPL_META_LICENSE "GPL"
| #define SPL_META_ALIAS "spl-0.7.11-1"
| #define SPL_META_AUTHOR "OpenZFS on Linux"
| #define PACKAGE "spl"
| #define VERSION "0.7.11"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define SPL_IS_GPL_COMPATIBLE 1
| #define HAVE_ATOMIC64_T 1
| #define HAVE_SPLIT_SHRINKER_CALLBACK 1
| #define HAVE_PDE_DATA 1
| 
| 
|           #include <linux/spinlock.h>
|           #include <linux/fs_struct.h>
|           #include <linux/path.h>
|           void (*const set_fs_pwd_func)
|               (struct fs_struct *, struct path *)
|               = set_fs_pwd;
| 
| int
| main (void)
| {
| 
|           return 0;
| 
|   ;
|   return 0;
| }
| 
configure:16438: error: unknown
gmelikov commented 5 years ago

@NoAgendaIT please use the issue template, if you want to help maintainers, not just purge it :-(

NoAgendaIT commented 5 years ago

What template? No such template exists. But I think I gave all of the relevant information.

gmelikov commented 5 years ago

@NoAgendaIT oh, sorry, i've mixed up zfs/spl repos. You can use this template in SPL too https://github.com/zfsonlinux/zfs/issues/new

NoAgendaIT commented 5 years ago

Okay, well, all of the information is there but I'll remember it for next time.

gcs-github commented 5 years ago

@NoAgendaIT if you are a grsecurity stable customer, which you seem to be according to your issue description, they maintain patches against ZFS in order to make the two of grsec and ZFS compatible with each other: https://www.grsecurity.net/download.php

While the latest patch there is listed for version 0.7.10, it applies cleanly against 0.7.11 as well.

NoAgendaIT commented 5 years ago

@gcs-github I have glanced over that one entirely. Thank you for pointing me into the right direction!

(ps - not sure if that would make this bug invalid...)

gmelikov commented 5 years ago

While the latest patch there is listed for version 0.7.10, it applies cleanly against 0.7.11 as well.

If it's so, then @NoAgendaIT can close the issue.

ghost commented 4 years ago

See #680 And the solution proposed by @behlendorf works:

EXTRA_KCFLAGS="-Werror -Wno-unused-function"

Whether this should be included in the source upstream or not is open to debate. Temporarily you can just export the variable in the env and configure will pick it up for you.

behlendorf commented 4 years ago

Closing. The SPL has been incorporated in to the ZFS repository.