summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yao <ryao@gentoo.org>2013-02-16 22:12:56 +0000
committerRichard Yao <ryao@gentoo.org>2013-02-16 22:12:56 +0000
commit5af96fe6fc384ed05e1633a48541252c99ce921f (patch)
treeef4d16914173252bc295bb48e537b21460566ddf /sys-fs/zfs-kmod
parentEnable py3.3. (diff)
downloadhistorical-5af96fe6fc384ed05e1633a48541252c99ce921f.tar.gz
historical-5af96fe6fc384ed05e1633a48541252c99ce921f.tar.bz2
historical-5af96fe6fc384ed05e1633a48541252c99ce921f.zip
Improve support for hardened kernels, bug \# 457176, thanks Marcin
Apply name length check patch to 0.6.0_rc14 Package-Manager: portage-2.1.11.31/cvs/Linux x86_64
Diffstat (limited to 'sys-fs/zfs-kmod')
-rw-r--r--sys-fs/zfs-kmod/ChangeLog10
-rw-r--r--sys-fs/zfs-kmod/Manifest5
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch473
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r3.ebuild (renamed from sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r2.ebuild)8
4 files changed, 492 insertions, 4 deletions
diff --git a/sys-fs/zfs-kmod/ChangeLog b/sys-fs/zfs-kmod/ChangeLog
index 38513fe84abf..c896aed0c1e0 100644
--- a/sys-fs/zfs-kmod/ChangeLog
+++ b/sys-fs/zfs-kmod/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-fs/zfs-kmod
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-kmod/ChangeLog,v 1.19 2013/02/11 23:36:17 ryao Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-kmod/ChangeLog,v 1.20 2013/02/16 22:12:55 ryao Exp $
+
+*zfs-kmod-0.6.0_rc14-r3 (16 Feb 2013)
+
+ 16 Feb 2013; Richard Yao <ryao@gentoo.org>
+ +files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch,
+ +zfs-kmod-0.6.0_rc14-r3.ebuild, -zfs-kmod-0.6.0_rc14-r2.ebuild:
+ Improve support for hardened kernels, bug \# 457176, thanks Marcin Apply name
+ length check patch to 0.6.0_rc14
*zfs-kmod-0.6.0_rc12-r2 (11 Feb 2013)
*zfs-kmod-0.6.0_rc14-r2 (11 Feb 2013)
diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest
index a3af5b99bdf6..eda517cc79ed 100644
--- a/sys-fs/zfs-kmod/Manifest
+++ b/sys-fs/zfs-kmod/Manifest
@@ -13,6 +13,7 @@ AUX zfs-kmod-0.6.0_rc13-fix-invisible-snapshots.patch 1371 SHA256 f48710ba112304
AUX zfs-kmod-0.6.0_rc13-fix-recursive-reader.patch 1161 SHA256 f74db8f9704f35d460a1a2250993057d301710c065e553c688381e778fb8e320 SHA512 9a16107d448c90914e9e1fc767c68eba7fb3793c1a7b1e26182759d0b398d09641f51911981a1092e76223cd8a56724c634bc939e9f1fdc412cf4e469e1e9384 WHIRLPOOL ccd43c7610420c165ac19684217fc8d2aa6b5e95d3fa40dec651ea1bf145f9ec0463ff806f918678636d2658dc6c80946077d5773f7486e4d68c13ad3cb1960c
AUX zfs-kmod-0.6.0_rc13-gcc-4.7-compat.patch 1882 SHA256 bd691dfdb8379c276309715b597b2091595c0f177a2241249ec76f6e31f3f101 SHA512 7f24915fdacaca01620a961febcc524b4c40989e85754cc927df5d8d87b77ba6bcce919db54fd7e42646abf16b6b29349de5e8dc30b5c12a9744e7321a9280e4 WHIRLPOOL 432182663ba978f1ae530a27d7f813e7aba04380763354a5446933c53848abaca738145c316b4c6c5fee06e65812b4e210def8a6432f7f5a8c845f4334b09d5b
AUX zfs-kmod-0.6.0_rc14-cast-const-for-32bit-compatibility.patch 1068 SHA256 4fba06f71807086da90c9d8f4c2a04cd83af4b606ab2ab9a4bc22f08e9439861 SHA512 8f1d20ab9be3ae388424ad543d400244df9ad093a0e2c61243c6b481347cd2fc0ab194ace5062d4ef6d162622324a5ed14c43c8c6c4e63d56725624f86a3961e WHIRLPOOL 4edda0e2353e851fdfc8381d9ab91c3c68d7c7f60dd69778817a9aeea46ba8b15e51954ccc5c49c4e094063d3bf350f14e2ab49fed9837980772a2eb495cf2af
+AUX zfs-kmod-0.6.0_rc14-improved-hardened-support.patch 17568 SHA256 1155f2587e249fe2b80e887c10549da11dc0ccb2f1a86d7bf4ad37bc73eeede1 SHA512 0d7a3354a336a749be0aeb1781f9c78ac3037ad515e31039184fc13075ec10b237581d25d6eddf5c0bf9b9b49b137d73c0ad9685d544fa8f8a7200463300acfb WHIRLPOOL 365e07900bc89fde7624f987ecdbc5ce55cebe1318f60062ae0c36ad044cb2911af81a57886d958237b01de12b865cef3377b7cce8e760a55abc2ec4fbde0379
AUX zfs-kmod-0.6.0_rc14-vfs-name-length-compatibility.patch 1074 SHA256 ca1efba212bdec982d519a05c81035271440a43f2aa6333c3e7f244690fbbdcc SHA512 0df3ca10c9919d554c197a45a0fc9217db19f6de39db6d00ff1f6501857430df79e9403c924c34928dc236adf73a5ce9bdc80b877a62709d4591a1fbab2c87fa WHIRLPOOL 3fe58a362d1c0fb0c8aa30bbec4a43d88d95b6c956445246ed8f28ae890c2fcc2b13de184eba91937e1ff8ac93b38a3f0b6824733da45cf46999e23b51f31d9a
AUX zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch 1438 SHA256 d1f1b3f47e0ada27e43ac04576eb61a96b5abe3bc6a7bd7869fe72e1e08bb4df SHA512 f133fed7acea871bec4e08b9e24b358111877f8c8a481746639913ab162a3a85216ceb848f9461aa57ebaa1d90a61b7e5105938511f6a98dfd6c281592c5ab09 WHIRLPOOL c49ea43a12a8c9e4dca30df0dbbeba6f4fd07cf7c0271aa9c45d9bf3c5e8eef93efe9da600ec1b1c9bc782d55382674db68f07afd3f7c1083e0e1b85816d9416
AUX zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch 1979 SHA256 6f61761703c4c71d8c91fb6e49b927069301698d78fea35c2bcdc603bfdce59d SHA512 dd4bfdd218791c6eef6120d95049860ba304ac474872357f3a5ff5b3783421a39035c732cd508f990145ff371bb8fcca2757152d41d963bcd559fa8f69fdedbe WHIRLPOOL 9bbd6479c22c905615ba6b4188aa332a9ec2685536cd6f784da28c081fdde430df15cb902b2ec1f7f9cdbfdcb20aabbc49460f5de09656686193001338c05a7a
@@ -27,7 +28,7 @@ EBUILD zfs-kmod-0.6.0_rc10-r1.ebuild 2875 SHA256 52426c4df3243f6fb2d51a5e0a1c0ba
EBUILD zfs-kmod-0.6.0_rc11-r2.ebuild 2956 SHA256 e565576942bbbb0dfefa156df54746d58517ee989d7af55de2c3775a481ed426 SHA512 8586e299caea6b6ac4bec5579b3afcc5cdfaa48c3a75e8f9fa5fee7f3915ac80a5071dc8d8ea2d69c39da7e43f59a90ba0ca4aec38b3d0cce07421eaf140c5c9 WHIRLPOOL c8c14920896d4e51a8c24100fce41230f3cf964ee253f8326713e4798973ca3b5b9fb2f777fc6d278fa3de55a9ac32f8911a80cf19f0cec0cacfcb99f666886b
EBUILD zfs-kmod-0.6.0_rc12-r2.ebuild 2460 SHA256 e1b5d0387c092e3244a4035dbcdc1881c1e1c4105d3964f167036a02e00c664c SHA512 5228978dcd5c4d0c1cdc0424a97edf760a11dd62ee9560121dac7a2d7b2c9f601bfbd0b76df26af86db78d477f355f7cd73c2ecdde2b8b2267e33f94d5440bf3 WHIRLPOOL 814a7890e0a994711eb72bcb148b5c5d24af59d3f462310d63f96631eeeb427d5cdd3d9ebca1e69c29fc9ecc0090a2391a22e0c0ef5d338cb98df3b099fbcf6c
EBUILD zfs-kmod-0.6.0_rc13-r3.ebuild 2651 SHA256 28d1b73f618919cf262736b6363171bc11c333dc75c837ca25f1e7da2660a601 SHA512 952b704c87c2f3df98b13fdf1f6348bdd2ff6a0c84831327900fbccc1260e54834e2966ffd86c7e64609c7b1e300bf6c0980d3ef7cec030ec5ebd3f66e59800a WHIRLPOOL e6c0a40189d51ac80de8e21a98da7cae007aeb2ce9af10deb027611118b05a63462c396ff7fe9d9156192b5fc67e5a201c93c257cb10faaa5bee6011df2ad278
-EBUILD zfs-kmod-0.6.0_rc14-r2.ebuild 2626 SHA256 cfe74b6c3ef61b90772a7e6a2c614be3b57bcfaea577a6ae8468042256af20c7 SHA512 b46e6ab5f1ac54ba19beaccc338a6871eb3ff3261e64874997af856f77d7cbc01e1869f1c16ed47f726a80b37e3fd960e0cbc5dab686b773f38675af3fbcabec WHIRLPOOL cb7716e84b4fe3bd05f7251487ce37bfcb33d3b0b11c96742063cfed0044dc819c39cd00646649512bea271fcf2c575b01c9a102b5d455c8c82a28fb1bbb6a43
+EBUILD zfs-kmod-0.6.0_rc14-r3.ebuild 2867 SHA256 e045922e4af26cdf7c453db340c029cb97c7c5a130f84b66a5a75ac2fbe6c356 SHA512 90c6b93e8698c87fe7943da10f286a1b6accf7a901fa61b6a40ba61ab3e6dc3ec993dcc66f8d24f0ef4caa089231dda7c2270605909cf5f99f752e514621caf8 WHIRLPOOL 98eee97d9f513649dbf3c7c5f5f2447c83ff7f352c94d1ad7ecc5479f8abc3d6fb3c06f459121a9353f67c03603130396f3671c9ca68988c81e1b76ee56e6b1d
EBUILD zfs-kmod-9999.ebuild 2390 SHA256 ba414eb496f41d1b0c115e16bcdc8cc66a0ec868cd328ee40d3926883740fda4 SHA512 d05f345af3d7602ba484fc76767ea27ac3c564964ca96c376cb5440f6bce40978329d8ddb4546e187300250ec974263399b407adb91d374c69fa87cf73b4fe92 WHIRLPOOL 008493e2d536ce8db1fd97747cc57e7a6696b8b5b8b44a9cedcfabefafc8e433a461e39eb09c94694cffd4673263feecb3337df3385ea6ed359c29c970330597
-MISC ChangeLog 5463 SHA256 2276081e7f34cd2a433adac63484d3181074c289fff0b86de1f1bd699ee6e844 SHA512 a15c6ba6eeb590e014b361942d7107911a54831a7191f240dc98b1299396375fe21902cc7a806c195c713560b134579fcc418deca5d6fc8ad71f93d962839b7a WHIRLPOOL 04f77b4e271c752fc35ec3c7017b3cf9653347646fee0f0fbb4dc4f364df04e37a30083a12a077004a4e10474798906d0ec4980f0a9f9e70107c1658e75880c9
+MISC ChangeLog 5791 SHA256 adea258a5bc80bff0d602b058eec32e8955f5890abfe667eb60b1b1e36c53919 SHA512 1025891d3c72f1dfd7092e20d42406a800b6e83637cd1eb3ea3f99ecf88e04e713316ee41012e4713ddbc50ad54d357e702cc812d6abe0ce3312574e328be97e WHIRLPOOL 4cd18a0c2b8e5661826dfa7de2502a580cc320e635506adf094f03f44213917dbd479ce28131df7b30be98792f27da08087ddaef5e091b07afeae81e130ca54a
MISC metadata.xml 346 SHA256 e4506ca3f73e0a7799675ddb48b546ce6e3754e912f77d7d32aefac860b3fb82 SHA512 13885781ec432fcaa913c6365b6101b899ba5cf72573b29eb56a0d567466f15edf43de61fd1cab357149c5ed2b73c8277d69a88589f5f3d8f9ae3ef671f9ad8a WHIRLPOOL 319e314874a770ba6ef2687056bb97d6aaf081b0014cf1f0d08c39d70f24adabd19f0b4b3ce61c00fb72dade7589c9821c4730508967e32ea32a2101f74a35d8
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch
new file mode 100644
index 000000000000..03ee65ef9d4a
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch
@@ -0,0 +1,473 @@
+From ead579050140bfa010d06f6e0fea3f680c781b38 Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Thu, 14 Feb 2013 18:54:04 -0500
+Subject: [PATCH] Eliminate runtime function pointer modifications in
+ autotools checks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+PaX/GrSecurity patched kernels implement a dialect of C that relies on a
+GCC plugin for enforcement. A basic idea in this dialect is that
+function pointers in structures should not change during runtime.
+This causes code that modifies function pointers at runtime to fail to
+compile in many instances. The autotools checks rely on whether or
+not small test cases compile against a given kernel. Some
+autotools checks assume some default case if other cases fail. When one
+of these autotools checks tests a PaX/GrSecurity patched kernel by
+modifying a function pointer at runtime, the default case will be used.
+
+Early detection of such situations is possible by relying on compiler
+warnings, which are compiler errors when --enable-debug is used.
+Unfortunately, very few people build ZFS with --enable-debug. The more
+common situation is that these issues manifest themselves as runtime
+failures in the form of NULL pointer exceptions.
+
+Previous patches that addressed such issues with PaX/GrSecurity
+compatibility largely relied on rewriting autotools checks to avoid
+runtime function pointer modification or the addition of PaX/GrSecurity
+specific checks. This patch takes the previous work to its logical
+conclusion by eliminating the use of runtime function pointer
+modification. This permits the removal of PaX-specific autotools checks
+in favor of ones that work across all supported kernels.
+
+This should resolve issues that were reported to occur with
+PaX/GrSecurity-patched Linux 3.7.5 kernels on Gentoo Linux.
+
+https://bugs.gentoo.org/show_bug.cgi?id=457176
+
+We should be able to prevent future regressions in PaX/GrSecurity
+compatibility by ensuring that all changes to ZFSOnLinux avoid runtime
+function pointer modification. At the same time, this does not solve the
+issue of silent failures triggering default cases in the autotools
+check, which is what permitted these regressions to become runtime
+failures in the first place. This will need to be addressed in a future
+patch.
+
+Reported-by: Marcin Mirosław <bug@mejor.pl>
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+---
+ config/kernel-bdev-block-device-operations.m4 | 21 +++----
+ config/kernel-bio-end-io-t-args.m4 | 6 +-
+ config/kernel-create-nameidata.m4 | 12 ++--
+ config/kernel-dentry-operations.m4 | 6 +-
+ config/kernel-dirty-inode.m4 | 8 +--
+ config/kernel-fallocate.m4 | 37 +++--------
+ config/kernel-fsync.m4 | 84 ++++---------------------
+ config/kernel-lookup-nameidata.m4 | 9 +--
+ config/kernel-mkdir-umode-t.m4 | 7 ++-
+ config/kernel-shrink.m4 | 21 +++----
+ 10 files changed, 62 insertions(+), 149 deletions(-)
+
+diff --git a/config/kernel-bdev-block-device-operations.m4 b/config/kernel-bdev-block-device-operations.m4
+index 28c3032..1674af0 100644
+--- a/config/kernel-bdev-block-device-operations.m4
++++ b/config/kernel-bdev-block-device-operations.m4
+@@ -7,24 +7,21 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [
+ EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/blkdev.h>
+- ],[
+- int (*blk_open) (struct block_device *, fmode_t) = NULL;
+- int (*blk_release) (struct gendisk *, fmode_t) = NULL;
+- int (*blk_ioctl) (struct block_device *, fmode_t,
+- unsigned, unsigned long) = NULL;
+- int (*blk_compat_ioctl) (struct block_device *, fmode_t,
+- unsigned, unsigned long) = NULL;
+- struct block_device_operations blk_ops = {
++
++ int blk_open (struct block_device *bdev, fmode_t mode) { return 0; }
++ int blk_release (struct gendisk *g, fmode_t mode) { return 0; }
++ int blk_ioctl (struct block_device *bdev, fmode_t mode,
++ unsigned x, unsigned long y) { return 0; }
++ int blk_compat_ioctl (struct block_device * bdev, fmode_t mode,
++ unsigned x, unsigned long y) { return 0; }
++ static struct block_device_operations blk_ops __attribute__ ((unused)) = {
+ .open = blk_open,
+ .release = blk_release,
+ .ioctl = blk_ioctl,
+ .compat_ioctl = blk_compat_ioctl,
+ };
++ ],[
+
+- blk_ops.open(NULL, 0);
+- blk_ops.release(NULL, 0);
+- blk_ops.ioctl(NULL, 0, 0, 0);
+- blk_ops.compat_ioctl(NULL, 0, 0, 0);
+ ],[
+ AC_MSG_RESULT(struct block_device)
+ AC_DEFINE(HAVE_BDEV_BLOCK_DEVICE_OPERATIONS, 1,
+diff --git a/config/kernel-bio-end-io-t-args.m4 b/config/kernel-bio-end-io-t-args.m4
+index ced4861..fe5707a 100644
+--- a/config/kernel-bio-end-io-t-args.m4
++++ b/config/kernel-bio-end-io-t-args.m4
+@@ -13,11 +13,9 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
+ EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/bio.h>
++ void wanted_end_io(struct bio * bio, int x) { return; }
+ ],[
+- void (*wanted_end_io)(struct bio *, int) = NULL;
+- bio_end_io_t *local_end_io __attribute__ ((unused));
+-
+- local_end_io = wanted_end_io;
++ bio_end_io_t *local_end_io __attribute__ ((unused)) = wanted_end_io;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_2ARGS_BIO_END_IO_T, 1,
+diff --git a/config/kernel-create-nameidata.m4 b/config/kernel-create-nameidata.m4
+index 100f077..c779715 100644
+--- a/config/kernel-create-nameidata.m4
++++ b/config/kernel-create-nameidata.m4
+@@ -5,18 +5,18 @@ AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
+ AC_MSG_CHECKING([whether iops->create() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+ #ifdef HAVE_MKDIR_UMODE_T
+- int (*inode_create) (struct inode *,struct dentry *,
+- umode_t, struct nameidata *) = NULL;
++ int inode_create (struct inode *inode ,struct dentry *dentry,
++ umode_t umode, struct nameidata *nidata) { return 0; }
+ #else
+- int (*inode_create) (struct inode *,struct dentry *,
+- int, struct nameidata *) = NULL;
++ int inode_create (struct inode *inode,struct dentry *dentry,
++ int umode, struct nameidata * nidata) { return 0; }
+ #endif
+- struct inode_operations iops __attribute__ ((unused)) = {
++ static struct inode_operations iops __attribute__ ((unused)) = {
+ .create = inode_create,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1,
+ [iops->create() operation takes nameidata])
+diff --git a/config/kernel-dentry-operations.m4 b/config/kernel-dentry-operations.m4
+index dfbea7d..b89c51d 100644
+--- a/config/kernel-dentry-operations.m4
++++ b/config/kernel-dentry-operations.m4
+@@ -5,12 +5,12 @@ AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
+ AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/dcache.h>
+- ],[
+- int (*revalidate) (struct dentry *, struct nameidata *) = NULL;
+- struct dentry_operations dops __attribute__ ((unused)) = {
++ int revalidate (struct dentry *dentry, struct nameidata *nidata) { return 0; }
++ static struct dentry_operations dops __attribute__ ((unused)) = {
+ .d_revalidate = revalidate,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,
+ [dops->d_revalidate() operation takes nameidata])
+diff --git a/config/kernel-dirty-inode.m4 b/config/kernel-dirty-inode.m4
+index 2ededf1..86e3425 100644
+--- a/config/kernel-dirty-inode.m4
++++ b/config/kernel-dirty-inode.m4
+@@ -8,11 +8,11 @@ AC_DEFUN([ZFS_AC_KERNEL_DIRTY_INODE_WITH_FLAGS], [
+ AC_MSG_CHECKING([whether sops->dirty_inode() wants flags])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ void dirty_inode (struct inode * a, int b) { return; }
++ static struct super_operations sops __attribute__ ((unused)) = {
++ .dirty_inode = dirty_inode,
++ };
+ ],[
+- void (*dirty_inode) (struct inode *, int) = NULL;
+- struct super_operations sops __attribute__ ((unused));
+-
+- sops.dirty_inode = dirty_inode;
+ ],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_DIRTY_INODE_WITH_FLAGS, 1,
+diff --git a/config/kernel-fallocate.m4 b/config/kernel-fallocate.m4
+index 6ac5ae6..0041ef2 100644
+--- a/config/kernel-fallocate.m4
++++ b/config/kernel-fallocate.m4
+@@ -5,12 +5,12 @@ AC_DEFUN([ZFS_AC_KERNEL_FILE_FALLOCATE], [
+ AC_MSG_CHECKING([whether fops->fallocate() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+- struct file_operations fops __attribute__ ((unused)) = {
+- .fallocate = fallocate,
++ long test_fallocate(struct file *file, int mode, loff_t offset, loff_t len) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fallocate = test_fallocate,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
+ ],[
+@@ -25,34 +25,14 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [
+ AC_MSG_CHECKING([whether iops->fallocate() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
+- struct inode_operations fops __attribute__ ((unused)) = {
+- .fallocate = fallocate,
++ long test_fallocate (struct inode *inode, int mode, loff_t offset, loff_t len) { return 0; }
++ static const struct inode_operations fops __attribute__ ((unused)) = {
++ .fallocate = test_fallocate,
+ };
+ ],[
+- AC_MSG_RESULT(yes)
+- AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
+- ],[
+- AC_MSG_RESULT(no)
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 2.6.38 - 3.x API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FILE_FALLOCATE], [
+- AC_MSG_CHECKING([whether fops->fallocate() exists])
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+- struct file_operations_no_const fops __attribute__ ((unused)) = {
+- .fallocate = fallocate,
+- };
+ ],[
+ AC_MSG_RESULT(yes)
+- AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
++ AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+@@ -65,5 +45,4 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
+ ZFS_AC_KERNEL_FILE_FALLOCATE
+ ZFS_AC_KERNEL_INODE_FALLOCATE
+- ZFS_AC_PAX_KERNEL_FILE_FALLOCATE
+ ])
+diff --git a/config/kernel-fsync.m4 b/config/kernel-fsync.m4
+index ca00d93..9ac0c79 100644
+--- a/config/kernel-fsync.m4
++++ b/config/kernel-fsync.m4
+@@ -4,11 +4,11 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITH_DENTRY], [
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ int test_fsync (struct file *f, struct dentry *dentry, int x) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fsync = test_fsync,
++ };
+ ],[
+- int (*fsync) (struct file *, struct dentry *, int) = NULL;
+- struct file_operations fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT([dentry])
+ AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
+@@ -23,11 +23,11 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY], [
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ int test_fsync (struct file *f, int x) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fsync = test_fsync,
++ };
+ ],[
+- int (*fsync) (struct file *, int) = NULL;
+- struct file_operations fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT([no dentry])
+ AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
+@@ -42,68 +42,11 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ int test_fsync (struct file *f, loff_t a, loff_t b, int c) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fsync = test_fsync,
++ };
+ ],[
+- int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+- struct file_operations fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+- ],[
+- AC_MSG_RESULT([range])
+- AC_DEFINE(HAVE_FSYNC_RANGE, 1,
+- [fops->fsync() with range])
+- ],[
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 2.6.x - 2.6.34 API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY], [
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- int (*fsync) (struct file *, struct dentry *, int) = NULL;
+- file_operations_no_const fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+- ],[
+- AC_MSG_RESULT([dentry])
+- AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
+- [fops->fsync() with dentry])
+- ],[
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 2.6.35 - Linux 3.0 API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY], [
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- int (*fsync) (struct file *, int) = NULL;
+- file_operations_no_const fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+- ],[
+- AC_MSG_RESULT([no dentry])
+- AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
+- [fops->fsync() without dentry])
+- ],[
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 3.1 - 3.x API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_RANGE], [
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+- file_operations_no_const fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT([range])
+ AC_DEFINE(HAVE_FSYNC_RANGE, 1,
+@@ -117,7 +60,4 @@ AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
+ ZFS_AC_KERNEL_FSYNC_WITH_DENTRY
+ ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY
+ ZFS_AC_KERNEL_FSYNC_RANGE
+- ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY
+- ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY
+- ZFS_AC_PAX_KERNEL_FSYNC_RANGE
+ ])
+diff --git a/config/kernel-lookup-nameidata.m4 b/config/kernel-lookup-nameidata.m4
+index 5e30be4..20b8cca 100644
+--- a/config/kernel-lookup-nameidata.m4
++++ b/config/kernel-lookup-nameidata.m4
+@@ -5,13 +5,14 @@ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_NAMEIDATA], [
+ AC_MSG_CHECKING([whether iops->lookup() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- struct dentry * (*inode_lookup) (struct inode *,struct dentry *,
+- struct nameidata *) = NULL;
+- struct inode_operations iops __attribute__ ((unused)) = {
++ struct dentry * inode_lookup (struct inode * inode,
++ struct dentry * dentry, struct nameidata * nidata)
++ { return NULL; }
++ static struct inode_operations iops __attribute__ ((unused)) = {
+ .lookup = inode_lookup,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LOOKUP_NAMEIDATA, 1,
+ [iops->lookup() operation takes nameidata])
+diff --git a/config/kernel-mkdir-umode-t.m4 b/config/kernel-mkdir-umode-t.m4
+index dd5d94b..ce8aa8f 100644
+--- a/config/kernel-mkdir-umode-t.m4
++++ b/config/kernel-mkdir-umode-t.m4
+@@ -10,12 +10,13 @@ AC_DEFUN([ZFS_AC_KERNEL_MKDIR_UMODE_T], [
+ AC_MSG_CHECKING([whether iops->create()/mkdir()/mknod() take umode_t])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- int (*mkdir) (struct inode *,struct dentry *,umode_t) = NULL;
+- struct inode_operations iops __attribute__ ((unused)) = {
++ int mkdir (struct inode * inode, struct dentry * dentry, umode_t umode)
++ { return 0; }
++ static struct inode_operations iops __attribute__ ((unused)) = {
+ .mkdir = mkdir,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MKDIR_UMODE_T, 1,
+ [iops->create()/mkdir()/mknod() take umode_t])
+diff --git a/config/kernel-shrink.m4 b/config/kernel-shrink.m4
+index ea748c9..ce4b965 100644
+--- a/config/kernel-shrink.m4
++++ b/config/kernel-shrink.m4
+@@ -8,15 +8,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINK], [
+ AC_MSG_CHECKING([whether super_block has s_shrink])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- int (*shrink)(struct shrinker *, struct shrink_control *sc)
+- __attribute__ ((unused)) = NULL;
+- struct super_block sb __attribute__ ((unused)) = {
++ int shrink(struct shrinker * s, struct shrink_control *sc) { return 0; }
++ static struct super_block sb __attribute__ ((unused)) = {
+ .s_shrink.shrink = shrink,
+ .s_shrink.seeks = DEFAULT_SEEKS,
+ .s_shrink.batch = 0,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SHRINK, 1, [struct super_block has s_shrink])
+
+@@ -29,13 +28,12 @@ AC_DEFUN([ZFS_AC_KERNEL_NR_CACHED_OBJECTS], [
+ AC_MSG_CHECKING([whether sops->nr_cached_objects() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- int (*nr_cached_objects)(struct super_block *)
+- __attribute__ ((unused)) = NULL;
+- struct super_operations sops __attribute__ ((unused)) = {
++ int nr_cached_objects(struct super_block * sb) { return 0; }
++ static struct super_operations sops __attribute__ ((unused)) = {
+ .nr_cached_objects = nr_cached_objects,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_NR_CACHED_OBJECTS, 1,
+ [sops->nr_cached_objects() exists])
+@@ -48,13 +46,12 @@ AC_DEFUN([ZFS_AC_KERNEL_FREE_CACHED_OBJECTS], [
+ AC_MSG_CHECKING([whether sops->free_cached_objects() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- void (*free_cached_objects)(struct super_block *, int)
+- __attribute__ ((unused)) = NULL;
+- struct super_operations sops __attribute__ ((unused)) = {
++ void free_cached_objects(struct super_block * sb, int x) { return; }
++ static struct super_operations sops __attribute__ ((unused)) = {
+ .free_cached_objects = free_cached_objects,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FREE_CACHED_OBJECTS, 1,
+ [sops->free_cached_objects() exists])
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r2.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r3.ebuild
index 30b7431277eb..84d80baacce6 100644
--- a/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r2.ebuild
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r2.ebuild,v 1.1 2013/02/11 23:36:17 ryao Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r3.ebuild,v 1.1 2013/02/16 22:12:55 ryao Exp $
EAPI="4"
@@ -66,6 +66,12 @@ src_prepare() {
then
# Cast constant for 32-bit compatibility
epatch "${FILESDIR}/${P}-cast-const-for-32bit-compatibility.patch"
+
+ # Handle missing name length check in Linux VFS
+ epatch "${FILESDIR}/${P}-vfs-name-length-compatibility.patch"
+
+ # Fix NULL pointer exception on hardened kernels, bug #457176
+ epatch "${FILESDIR}/${P}-improved-hardened-support.patch"
fi
autotools-utils_src_prepare
}