diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2017-02-16 14:58:49 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-02-16 15:11:24 +0100 |
commit | 086e1347fca4d0bdd973bd0ab250bd6d4693156f (patch) | |
tree | 1aa933d041102edee6ff552ec84db62aa2fcccfd /main/zfs-grsec | |
parent | 4a22a3484d66179c668b1ddb72f74a6d3dc7acb2 (diff) | |
download | aports-086e1347fca4d0bdd973bd0ab250bd6d4693156f.tar.bz2 aports-086e1347fca4d0bdd973bd0ab250bd6d4693156f.tar.xz |
main/zfs-grsec: more PaX RAP fixes
Diffstat (limited to 'main/zfs-grsec')
-rw-r--r-- | main/zfs-grsec/APKBUILD | 4 | ||||
-rw-r--r-- | main/zfs-grsec/pax-rap-fixes.patch | 250 |
2 files changed, 252 insertions, 2 deletions
diff --git a/main/zfs-grsec/APKBUILD b/main/zfs-grsec/APKBUILD index 2b3ddba08b..21e80888ad 100644 --- a/main/zfs-grsec/APKBUILD +++ b/main/zfs-grsec/APKBUILD @@ -10,7 +10,7 @@ _kver=4.9.10 _kpkgrel=0 _realver=0.6.5.9 -_mypkgrel=0 +_mypkgrel=1 _kernelver=$_kver-r$_kpkgrel _abi_release=${_kver}-${_kpkgrel}-${_flavor} @@ -102,4 +102,4 @@ e20fb3004af9e6454513d7df09292465e5bc4101a558538cf794ef41b56a30713e1868dcda251e6b 9843aca713021772435cfa68fde5d9aa2de0387de0da6c48045db0348f2a24d2c2e968d3eb1921923170c9e2fd6514e31c5f0a7bacbf8510b53c2c625c4737d1 0007-Remove-complicated-libspl-assert-wrappers.patch fa752b3ed04f05ec4fac257cbd2c581a57a792e12165d8f135a77b894445cdefb0da1753922e3e59c9fbaed20ca1dc6d19b5436745c8fa588a42304f6561f1a2 0008-Add-support-for-libtirpc.patch d2efb627f493bab06f8049dc4bcb7c39269ff9dcd66879a0f96fa5040e1c7468f9e684277ec3e54841b3a5f8734d9470f2c6a1af470e3f1a71f759f9155b7ede 0009-Add-support-for-alpine-linux.patch -9d2d82897d8a3c5ccca929bdec17fdbbbd815b59bc4eb02fd1a314ba8f27b788a904e2c32462f155ab475869d49b83a63e0bfeb24179442446553c08b9a6d741 pax-rap-fixes.patch" +da6367891d8f92d1f2972225cca36e83296fb4b8a4f19964149f39c4b2900de6daf1b1085bc0deb973528fd115a4b404462fdbe7f861e0227483d3e35273d04a pax-rap-fixes.patch" diff --git a/main/zfs-grsec/pax-rap-fixes.patch b/main/zfs-grsec/pax-rap-fixes.patch index 0daeb8027c..575d816398 100644 --- a/main/zfs-grsec/pax-rap-fixes.patch +++ b/main/zfs-grsec/pax-rap-fixes.patch @@ -323,3 +323,253 @@ index 2bc88c5..df44e39 100644 &zio->io_tqent); } return (ZIO_PIPELINE_STOP); +diff --git a/module/zfs/zfs_replay.c b/module/zfs/zfs_replay.c +index 0ca1e03..66a2d96 100644 +--- a/module/zfs/zfs_replay.c ++++ b/module/zfs/zfs_replay.c +@@ -72,7 +72,7 @@ zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t mode, + + /* ARGSUSED */ + static int +-zfs_replay_error(zfs_sb_t *zsb, lr_t *lr, boolean_t byteswap) ++zfs_replay_error(void *zsb, char *lr, boolean_t byteswap) + { + return (SET_ERROR(ENOTSUP)); + } +@@ -265,8 +265,10 @@ zfs_replay_swap_attrs(lr_attr_t *lrattr) + * as option FUID information. + */ + static int +-zfs_replay_create_acl(zfs_sb_t *zsb, lr_acl_create_t *lracl, boolean_t byteswap) ++zfs_replay_create_acl(void *_zsb, char *_lracl, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_acl_create_t *lracl = (lr_acl_create_t *)_lracl; + char *name = NULL; /* location determined later */ + lr_create_t *lr = (lr_create_t *)lracl; + znode_t *dzp; +@@ -405,8 +407,10 @@ bail: + } + + static int +-zfs_replay_create(zfs_sb_t *zsb, lr_create_t *lr, boolean_t byteswap) ++zfs_replay_create(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_create_t *lr = (lr_create_t *)_lr; + char *name = NULL; /* location determined later */ + char *link; /* symlink content follows name */ + znode_t *dzp; +@@ -530,8 +534,10 @@ out: + } + + static int +-zfs_replay_remove(zfs_sb_t *zsb, lr_remove_t *lr, boolean_t byteswap) ++zfs_replay_remove(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_remove_t *lr = (lr_remove_t *)_lr; + char *name = (char *)(lr + 1); /* name follows lr_remove_t */ + znode_t *dzp; + int error; +@@ -563,8 +569,10 @@ zfs_replay_remove(zfs_sb_t *zsb, lr_remove_t *lr, boolean_t byteswap) + } + + static int +-zfs_replay_link(zfs_sb_t *zsb, lr_link_t *lr, boolean_t byteswap) ++zfs_replay_link(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_link_t *lr = (lr_link_t *)_lr; + char *name = (char *)(lr + 1); /* name follows lr_link_t */ + znode_t *dzp, *zp; + int error; +@@ -593,8 +601,10 @@ zfs_replay_link(zfs_sb_t *zsb, lr_link_t *lr, boolean_t byteswap) + } + + static int +-zfs_replay_rename(zfs_sb_t *zsb, lr_rename_t *lr, boolean_t byteswap) ++zfs_replay_rename(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_rename_t *lr = (lr_rename_t *)_lr; + char *sname = (char *)(lr + 1); /* sname and tname follow lr_rename_t */ + char *tname = sname + strlen(sname) + 1; + znode_t *sdzp, *tdzp; +@@ -624,8 +634,10 @@ zfs_replay_rename(zfs_sb_t *zsb, lr_rename_t *lr, boolean_t byteswap) + } + + static int +-zfs_replay_write(zfs_sb_t *zsb, lr_write_t *lr, boolean_t byteswap) ++zfs_replay_write(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_write_t *lr = (lr_write_t *)_lr; + char *data = (char *)(lr + 1); /* data follows lr_write_t */ + znode_t *zp; + int error, written; +@@ -693,8 +705,10 @@ zfs_replay_write(zfs_sb_t *zsb, lr_write_t *lr, boolean_t byteswap) + * the file is grown. + */ + static int +-zfs_replay_write2(zfs_sb_t *zsb, lr_write_t *lr, boolean_t byteswap) ++zfs_replay_write2(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_write_t *lr = (lr_write_t *)_lr; + znode_t *zp; + int error; + uint64_t end; +@@ -738,8 +752,10 @@ top: + } + + static int +-zfs_replay_truncate(zfs_sb_t *zsb, lr_truncate_t *lr, boolean_t byteswap) ++zfs_replay_truncate(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_truncate_t *lr = (lr_truncate_t *)_lr; + znode_t *zp; + flock64_t fl; + int error; +@@ -765,8 +781,10 @@ zfs_replay_truncate(zfs_sb_t *zsb, lr_truncate_t *lr, boolean_t byteswap) + } + + static int +-zfs_replay_setattr(zfs_sb_t *zsb, lr_setattr_t *lr, boolean_t byteswap) ++zfs_replay_setattr(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_setattr_t *lr = (lr_setattr_t *)_lr; + znode_t *zp; + xvattr_t xva; + vattr_t *vap = &xva.xva_vattr; +@@ -817,8 +835,10 @@ zfs_replay_setattr(zfs_sb_t *zsb, lr_setattr_t *lr, boolean_t byteswap) + } + + static int +-zfs_replay_acl_v0(zfs_sb_t *zsb, lr_acl_v0_t *lr, boolean_t byteswap) ++zfs_replay_acl_v0(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_acl_v0_t *lr = (lr_acl_v0_t *)_lr; + ace_t *ace = (ace_t *)(lr + 1); /* ace array follows lr_acl_t */ + vsecattr_t vsa; + znode_t *zp; +@@ -861,8 +881,10 @@ zfs_replay_acl_v0(zfs_sb_t *zsb, lr_acl_v0_t *lr, boolean_t byteswap) + * + */ + static int +-zfs_replay_acl(zfs_sb_t *zsb, lr_acl_t *lr, boolean_t byteswap) ++zfs_replay_acl(void *_zsb, char *_lr, boolean_t byteswap) + { ++ zfs_sb_t *zsb = _zsb; ++ lr_acl_t *lr = (lr_acl_t *)_lr; + ace_t *ace = (ace_t *)(lr + 1); + vsecattr_t vsa; + znode_t *zp; +@@ -912,25 +934,25 @@ zfs_replay_acl(zfs_sb_t *zsb, lr_acl_t *lr, boolean_t byteswap) + * Callback vectors for replaying records + */ + zil_replay_func_t zfs_replay_vector[TX_MAX_TYPE] = { +- (zil_replay_func_t)zfs_replay_error, /* no such type */ +- (zil_replay_func_t)zfs_replay_create, /* TX_CREATE */ +- (zil_replay_func_t)zfs_replay_create, /* TX_MKDIR */ +- (zil_replay_func_t)zfs_replay_create, /* TX_MKXATTR */ +- (zil_replay_func_t)zfs_replay_create, /* TX_SYMLINK */ +- (zil_replay_func_t)zfs_replay_remove, /* TX_REMOVE */ +- (zil_replay_func_t)zfs_replay_remove, /* TX_RMDIR */ +- (zil_replay_func_t)zfs_replay_link, /* TX_LINK */ +- (zil_replay_func_t)zfs_replay_rename, /* TX_RENAME */ +- (zil_replay_func_t)zfs_replay_write, /* TX_WRITE */ +- (zil_replay_func_t)zfs_replay_truncate, /* TX_TRUNCATE */ +- (zil_replay_func_t)zfs_replay_setattr, /* TX_SETATTR */ +- (zil_replay_func_t)zfs_replay_acl_v0, /* TX_ACL_V0 */ +- (zil_replay_func_t)zfs_replay_acl, /* TX_ACL */ +- (zil_replay_func_t)zfs_replay_create_acl, /* TX_CREATE_ACL */ +- (zil_replay_func_t)zfs_replay_create, /* TX_CREATE_ATTR */ +- (zil_replay_func_t)zfs_replay_create_acl, /* TX_CREATE_ACL_ATTR */ +- (zil_replay_func_t)zfs_replay_create_acl, /* TX_MKDIR_ACL */ +- (zil_replay_func_t)zfs_replay_create, /* TX_MKDIR_ATTR */ +- (zil_replay_func_t)zfs_replay_create_acl, /* TX_MKDIR_ACL_ATTR */ +- (zil_replay_func_t)zfs_replay_write2, /* TX_WRITE2 */ ++ zfs_replay_error, /* no such type */ ++ zfs_replay_create, /* TX_CREATE */ ++ zfs_replay_create, /* TX_MKDIR */ ++ zfs_replay_create, /* TX_MKXATTR */ ++ zfs_replay_create, /* TX_SYMLINK */ ++ zfs_replay_remove, /* TX_REMOVE */ ++ zfs_replay_remove, /* TX_RMDIR */ ++ zfs_replay_link, /* TX_LINK */ ++ zfs_replay_rename, /* TX_RENAME */ ++ zfs_replay_write, /* TX_WRITE */ ++ zfs_replay_truncate, /* TX_TRUNCATE */ ++ zfs_replay_setattr, /* TX_SETATTR */ ++ zfs_replay_acl_v0, /* TX_ACL_V0 */ ++ zfs_replay_acl, /* TX_ACL */ ++ zfs_replay_create_acl, /* TX_CREATE_ACL */ ++ zfs_replay_create, /* TX_CREATE_ATTR */ ++ zfs_replay_create_acl, /* TX_CREATE_ACL_ATTR */ ++ zfs_replay_create_acl, /* TX_MKDIR_ACL */ ++ zfs_replay_create, /* TX_MKDIR_ATTR */ ++ zfs_replay_create_acl, /* TX_MKDIR_ACL_ATTR */ ++ zfs_replay_write2, /* TX_WRITE2 */ + }; +diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c +index 0bb68f9..9f4b11a 100644 +--- a/module/zfs/zvol.c ++++ b/module/zfs/zvol.c +@@ -483,8 +483,10 @@ out: + * after a system failure + */ + static int +-zvol_replay_write(zvol_state_t *zv, lr_write_t *lr, boolean_t byteswap) ++zvol_replay_write(void *_zv, char *_lr, boolean_t byteswap) + { ++ zvol_state_t *zv = _zv; ++ lr_write_t *lr = (lr_write_t *)_lr; + objset_t *os = zv->zv_objset; + char *data = (char *)(lr + 1); /* data follows lr_write_t */ + uint64_t off = lr->lr_offset; +@@ -509,7 +511,7 @@ zvol_replay_write(zvol_state_t *zv, lr_write_t *lr, boolean_t byteswap) + } + + static int +-zvol_replay_err(zvol_state_t *zv, lr_t *lr, boolean_t byteswap) ++zvol_replay_err(void *zv, char *lr, boolean_t byteswap) + { + return (SET_ERROR(ENOTSUP)); + } +@@ -519,19 +521,19 @@ zvol_replay_err(zvol_state_t *zv, lr_t *lr, boolean_t byteswap) + * Only TX_WRITE is needed for zvol. + */ + zil_replay_func_t zvol_replay_vector[TX_MAX_TYPE] = { +- (zil_replay_func_t)zvol_replay_err, /* no such transaction type */ +- (zil_replay_func_t)zvol_replay_err, /* TX_CREATE */ +- (zil_replay_func_t)zvol_replay_err, /* TX_MKDIR */ +- (zil_replay_func_t)zvol_replay_err, /* TX_MKXATTR */ +- (zil_replay_func_t)zvol_replay_err, /* TX_SYMLINK */ +- (zil_replay_func_t)zvol_replay_err, /* TX_REMOVE */ +- (zil_replay_func_t)zvol_replay_err, /* TX_RMDIR */ +- (zil_replay_func_t)zvol_replay_err, /* TX_LINK */ +- (zil_replay_func_t)zvol_replay_err, /* TX_RENAME */ +- (zil_replay_func_t)zvol_replay_write, /* TX_WRITE */ +- (zil_replay_func_t)zvol_replay_err, /* TX_TRUNCATE */ +- (zil_replay_func_t)zvol_replay_err, /* TX_SETATTR */ +- (zil_replay_func_t)zvol_replay_err, /* TX_ACL */ ++ zvol_replay_err, /* no such transaction type */ ++ zvol_replay_err, /* TX_CREATE */ ++ zvol_replay_err, /* TX_MKDIR */ ++ zvol_replay_err, /* TX_MKXATTR */ ++ zvol_replay_err, /* TX_SYMLINK */ ++ zvol_replay_err, /* TX_REMOVE */ ++ zvol_replay_err, /* TX_RMDIR */ ++ zvol_replay_err, /* TX_LINK */ ++ zvol_replay_err, /* TX_RENAME */ ++ zvol_replay_write, /* TX_WRITE */ ++ zvol_replay_err, /* TX_TRUNCATE */ ++ zvol_replay_err, /* TX_SETATTR */ ++ zvol_replay_err, /* TX_ACL */ + }; + + /* |