Commit d5bafe84 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/zfs-grsec: add fixes for PaX RAP

parent 2919a67e
......@@ -10,7 +10,7 @@ _kver=4.9.9
_kpkgrel=1
_realver=0.6.5.9
_mypkgrel=0
_mypkgrel=1
# source the kernel version
if [ -f ../../main/linux-$_flavor/APKBUILD ]; then
......@@ -46,6 +46,7 @@ source="https://github.com/zfsonlinux/zfs/releases/download/zfs-$_realver/zfs-$_
0007-Remove-complicated-libspl-assert-wrappers.patch
0008-Add-support-for-libtirpc.patch
0009-Add-support-for-alpine-linux.patch
pax-rap-fixes.patch
"
......@@ -94,4 +95,5 @@ fbd44839a422925a54710e8425405d24ca2428b78aa54b9a77492e5882a3e21aa4a5e53656466c5a
e20fb3004af9e6454513d7df09292465e5bc4101a558538cf794ef41b56a30713e1868dcda251e6b3ed10c5f0178e86068bcb113bd8228eedb626cb73bb19ecd 0006-Move-hrtime_t-timestruc_t-and-timespec_t.patch
9843aca713021772435cfa68fde5d9aa2de0387de0da6c48045db0348f2a24d2c2e968d3eb1921923170c9e2fd6514e31c5f0a7bacbf8510b53c2c625c4737d1 0007-Remove-complicated-libspl-assert-wrappers.patch
fa752b3ed04f05ec4fac257cbd2c581a57a792e12165d8f135a77b894445cdefb0da1753922e3e59c9fbaed20ca1dc6d19b5436745c8fa588a42304f6561f1a2 0008-Add-support-for-libtirpc.patch
d2efb627f493bab06f8049dc4bcb7c39269ff9dcd66879a0f96fa5040e1c7468f9e684277ec3e54841b3a5f8734d9470f2c6a1af470e3f1a71f759f9155b7ede 0009-Add-support-for-alpine-linux.patch"
d2efb627f493bab06f8049dc4bcb7c39269ff9dcd66879a0f96fa5040e1c7468f9e684277ec3e54841b3a5f8734d9470f2c6a1af470e3f1a71f759f9155b7ede 0009-Add-support-for-alpine-linux.patch
676bcc968d46735a2b35659a32ca9e9d0de44aafef255dcc811d62e416c4fc27802ac170af2e4dcde9ba7fd609a39eeb9bd751d7d9988e9b61ee80225e6a0451 pax-rap-fixes.patch"
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 40524ed..a83b559 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -5541,7 +5541,7 @@ ztest_resume(spa_t *spa)
(void) zio_resume(spa);
}
-static void *
+static void
ztest_resume_thread(void *arg)
{
spa_t *spa = arg;
@@ -5553,8 +5553,6 @@ ztest_resume_thread(void *arg)
}
thread_exit();
-
- return (NULL);
}
#define GRACE 300
@@ -5588,7 +5586,7 @@ ztest_execute(int test, ztest_info_t *zi, uint64_t id)
(double)functime / NANOSEC, zi->zi_funcname);
}
-static void *
+static void
ztest_thread(void *arg)
{
int rand;
@@ -5628,8 +5626,6 @@ ztest_thread(void *arg)
}
thread_exit();
-
- return (NULL);
}
static void
@@ -5818,7 +5814,7 @@ ztest_run(ztest_shared_t *zs)
* Create a thread to periodically resume suspended I/O.
*/
VERIFY3P((resume_thread = zk_thread_create(NULL, 0,
- (thread_func_t)ztest_resume_thread, spa, TS_RUN, NULL, 0, 0,
+ ztest_resume_thread, spa, TS_RUN, NULL, 0, 0,
PTHREAD_CREATE_JOINABLE)), !=, NULL);
#if 0
@@ -5870,7 +5866,7 @@ ztest_run(ztest_shared_t *zs)
return;
VERIFY3P(thread = zk_thread_create(NULL, 0,
- (thread_func_t)ztest_thread,
+ ztest_thread,
(void *)(uintptr_t)t, TS_RUN, NULL, 0, 0,
PTHREAD_CREATE_JOINABLE), !=, NULL);
tid[t] = thread->t_tid;
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index 78e33e1..255b1a4 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -240,7 +240,7 @@ typedef struct kthread {
#define getcomm() "unknown"
#define thread_exit zk_thread_exit
#define thread_create(stk, stksize, func, arg, len, pp, state, pri) \
- zk_thread_create(stk, stksize, (thread_func_t)func, arg, \
+ zk_thread_create(stk, stksize, func, arg, \
len, NULL, state, pri, PTHREAD_CREATE_DETACHED)
#define thread_join(t) zk_thread_join(t)
#define newproc(f, a, cid, pri, ctp, pid) (ENOSYS)
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 04fde6c..a9652dd 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -3416,7 +3416,7 @@ arc_kmem_reap_now(void)
* using mutex_tryenter() from arc_reclaim_thread().
*/
static void
-arc_reclaim_thread(void)
+arc_reclaim_thread(void *_unused)
{
fstrans_cookie_t cookie = spl_fstrans_mark();
clock_t growtime = 0;
@@ -3509,7 +3509,7 @@ arc_reclaim_thread(void)
}
static void
-arc_user_evicts_thread(void)
+arc_user_evicts_thread(void *_unused)
{
fstrans_cookie_t cookie = spl_fstrans_mark();
callb_cpr_t cpr;
@@ -6732,7 +6732,7 @@ l2arc_release_cdata_buf(arc_buf_hdr_t *hdr)
* heart of the L2ARC.
*/
static void
-l2arc_feed_thread(void)
+l2arc_feed_thread(void *_unused)
{
callb_cpr_t cpr;
l2arc_dev_t *dev;
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index dde909e..34ff0dc 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -5646,8 +5646,9 @@ spa_async_autoexpand(spa_t *spa, vdev_t *vd)
}
static void
-spa_async_thread(spa_t *spa)
+spa_async_thread(void *_spa)
{
+ spa_t *spa = _spa;
int tasks, i;
ASSERT(spa->spa_sync_on);
diff --git a/module/zfs/txg.c b/module/zfs/txg.c
index 1d5ee97..2d63a57 100644
--- a/module/zfs/txg.c
+++ b/module/zfs/txg.c
@@ -107,8 +107,8 @@
* now transition to the syncing state.
*/
-static void txg_sync_thread(dsl_pool_t *dp);
-static void txg_quiesce_thread(dsl_pool_t *dp);
+static void txg_sync_thread(void *_dp);
+static void txg_quiesce_thread(void *_dp);
int zfs_txg_timeout = 5; /* max seconds worth of delta per txg */
@@ -475,8 +475,9 @@ txg_wait_callbacks(dsl_pool_t *dp)
}
static void
-txg_sync_thread(dsl_pool_t *dp)
+txg_sync_thread(void *_dp)
{
+ dsl_pool_t *dp = _dp;
spa_t *spa = dp->dp_spa;
tx_state_t *tx = &dp->dp_tx;
callb_cpr_t cpr;
@@ -584,8 +585,9 @@ txg_sync_thread(dsl_pool_t *dp)
}
static void
-txg_quiesce_thread(dsl_pool_t *dp)
+txg_quiesce_thread(void *_dp)
{
+ dsl_pool_t *dp = _dp;
tx_state_t *tx = &dp->dp_tx;
callb_cpr_t cpr;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment