View | Details | Raw Unified | Return to bug 233882 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/pefs-kmod/Makefile (+1 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	pefs
4
PORTNAME=	pefs
5
DISTVERSION=	2017-06-20
5
DISTVERSION=	2017-06-20
6
PORTREVISION=   1
6
CATEGORIES=	sysutils
7
CATEGORIES=	sysutils
7
MASTER_SITES=	LOCAL/gleb
8
MASTER_SITES=	LOCAL/gleb
8
PKGNAMESUFFIX=	-kmod
9
PKGNAMESUFFIX=	-kmod
(-)sysutils/pefs-kmod/files/patch-lib_libpam_modules_Makefile.inc (+10 lines)
Line 0 Link Here
1
--- lib/libpam/modules/Makefile.inc.orig	2017-06-21 04:37:11 UTC
2
+++ lib/libpam/modules/Makefile.inc
3
@@ -1,4 +1,6 @@
4
 # Include Makefiles from $SRCDIR
5
 
6
-.include </usr/src/lib/libpam/modules/Makefile.inc>
7
+LIBDIR=${PREFIX}/lib
8
+
9
+.include <${SYSDIR}/../lib/libpam/modules/Makefile.inc>
10
 
(-)sysutils/pefs-kmod/files/patch-lib_libpam_modules_pam__pefs_Makefile (+9 lines)
Line 0 Link Here
1
--- lib/libpam/modules/pam_pefs/Makefile.orig	2017-06-21 04:37:11 UTC
2
+++ lib/libpam/modules/pam_pefs/Makefile
3
@@ -29,3 +29,6 @@ LDADD= -lutil
4
 .PATH: ${SYS}/crypto
5
 .PATH: ${SYS}/crypto/rijndael
6
 .PATH: ${SYS}/crypto/hmac ${SYS}/crypto/pbkdf2 ${SYS}/crypto/sha2
7
+
8
+# Fix build without OBJDIR for shared components
9
+.NOPATH: ${OBJS}
(-)sysutils/pefs-kmod/files/patch-libpam-Makefile (-10 lines)
Lines 1-10 Link Here
1
--- lib/libpam/modules/Makefile.inc.orig	2011-12-25 08:01:28.000000000 +0200
2
+++ lib/libpam/modules/Makefile.inc	2011-12-25 08:02:17.000000000 +0200
3
@@ -1,4 +1,6 @@
4
 # Include Makefiles from $SRCDIR
5
 
6
-.include </usr/src/lib/libpam/modules/Makefile.inc>
7
+LIBDIR=${PREFIX}/lib
8
+
9
+.include <${SYSDIR}/../lib/libpam/modules/Makefile.inc>
10
 
(-)sysutils/pefs-kmod/files/patch-pefs_aesni.h (-17 lines)
Lines 1-17 Link Here
1
--- sys/fs/pefs/pefs_aesni.h.orig
2
+++ sys/fs/pefs/pefs_aesni.h
3
@@ -26,6 +26,8 @@
4
  * $FreeBSD$
5
  */
6
 
7
+#ifdef PEFS_AESNI
8
+
9
 #include <crypto/aesni/aesni.h>
10
 
11
 struct pefs_aesni_ctx {
12
@@ -41,3 +43,5 @@
13
 	u_int			fpu_cpuid;
14
 	int			fpu_saved;
15
 };
16
+
17
+#endif
(-)sysutils/pefs-kmod/files/patch-sys_fs_pefs_pefs.h (+12 lines)
Line 0 Link Here
1
--- sys/fs/pefs/pefs.h.orig	2017-06-21 04:37:11 UTC
2
+++ sys/fs/pefs/pefs.h
3
@@ -140,6 +140,9 @@ int	pefs_uninit(struct vfsconf *vfsp);
4
 void	pefs_crypto_init(void);
5
 void	pefs_crypto_uninit(void);
6
 
7
+void	pefs_zone_dtor_bzero(void *mem, int size, void *arg);
8
+void	pefs_zone_fini_bzero(void *mem, int size);
9
+
10
 int	pefs_node_get_nokey(struct mount *mp, struct vnode *lvp,
11
 	    struct vnode **vpp);
12
 int	pefs_node_get_haskey(struct mount *mp, struct vnode *lvp,
(-)sysutils/pefs-kmod/files/patch-sys_fs_pefs_pefs__aesni.c (+52 lines)
Line 0 Link Here
1
--- sys/fs/pefs/pefs_aesni.c.orig	2017-06-21 04:37:11 UTC
2
+++ sys/fs/pefs/pefs_aesni.c
3
@@ -84,7 +84,6 @@ pefs_aesni_keysetup(const struct pefs_session *xses,
4
 	const struct pefs_aesni_ses *ses = &xses->o.ps_aesni;
5
 	struct pefs_aesni_ctx *ctx = &xctx->o.pctx_aesni;
6
 	struct fpu_kern_ctx *tmpctx = NULL;
7
-	int error;
8
 
9
 	switch (keybits) {
10
 	case 128:
11
@@ -105,11 +104,7 @@ pefs_aesni_keysetup(const struct pefs_session *xses,
12
 		tmpctx = fpu_kern_alloc_ctx(FPU_KERN_NORMAL);
13
 		if (tmpctx == NULL)
14
 			return (ENOMEM);
15
-		error = fpu_kern_enter(curthread, tmpctx, FPU_KERN_NORMAL);
16
-		if (error != 0) {
17
-			fpu_kern_free_ctx(tmpctx);
18
-			return (error);
19
-		}
20
+		fpu_kern_enter(curthread, tmpctx, FPU_KERN_NORMAL);
21
 	}
22
 
23
 	aesni_set_enckey(key, ctx->enc_schedule, ctx->rounds);
24
@@ -156,7 +151,6 @@ static void
25
 pefs_aesni_enter(struct pefs_session *xses)
26
 {
27
 	struct pefs_aesni_ses *ses = &xses->o.ps_aesni;
28
-	int error;
29
 
30
 	if (is_fpu_kern_thread(0)) {
31
 		ses->fpu_saved = 0;
32
@@ -170,15 +164,12 @@ pefs_aesni_enter(struct pefs_session *xses)
33
 		ses->td = curthread;
34
 		ses->fpu_cpuid = curcpu;
35
 		critical_exit();
36
-		error = fpu_kern_enter(ses->td, ses->fpu_ctx, FPU_KERN_NORMAL);
37
-		if (error == 0) {
38
-			ses->fpu_saved = 1;
39
-			return;
40
-		}
41
-		DPCPU_ID_SET(ses->fpu_cpuid, pefs_aesni_fpu, ses->fpu_ctx);
42
-	} else
43
+		fpu_kern_enter(ses->td, ses->fpu_ctx, FPU_KERN_NORMAL);
44
+		ses->fpu_saved = 1;
45
+	} else {
46
 		critical_exit();
47
-	ses->fpu_saved = -1;
48
+		ses->fpu_saved = -1;
49
+	}
50
 }
51
 
52
 static void
(-)sysutils/pefs-kmod/files/patch-sys_fs_pefs_pefs__aesni.h (+17 lines)
Line 0 Link Here
1
--- sys/fs/pefs/pefs_aesni.h.orig	2017-06-21 04:37:11 UTC
2
+++ sys/fs/pefs/pefs_aesni.h
3
@@ -26,6 +26,8 @@
4
  * $FreeBSD$
5
  */
6
 
7
+#ifdef PEFS_AESNI
8
+
9
 #include <crypto/aesni/aesni.h>
10
 
11
 struct pefs_aesni_ctx {
12
@@ -41,3 +43,5 @@ struct pefs_aesni_ses {
13
 	u_int			fpu_cpuid;
14
 	int			fpu_saved;
15
 };
16
+
17
+#endif
(-)sysutils/pefs-kmod/files/patch-sys_fs_pefs_pefs__crypto.c (+22 lines)
Line 0 Link Here
1
--- sys/fs/pefs/pefs_crypto.c.orig	2017-06-21 04:37:11 UTC
2
+++ sys/fs/pefs/pefs_crypto.c
3
@@ -28,6 +28,7 @@
4
 __FBSDID("$FreeBSD$");
5
 
6
 #include <sys/param.h>
7
+#include <sys/systm.h>
8
 #include <sys/dirent.h>
9
 #include <sys/endian.h>
10
 #include <sys/lock.h>
11
@@ -100,9 +101,9 @@ void
12
 pefs_crypto_init(void)
13
 {
14
 	pefs_ctx_zone = uma_zcreate("pefs_ctx", sizeof(struct pefs_ctx),
15
-	    NULL, NULL, NULL, (uma_fini)bzero, UMA_ALIGN_CACHE, 0);
16
+	    NULL, pefs_zone_dtor_bzero, NULL, NULL, UMA_ALIGN_CACHE, 0);
17
 	pefs_key_zone = uma_zcreate("pefs_key", sizeof(struct pefs_key),
18
-	    NULL, NULL, NULL, (uma_fini)bzero, UMA_ALIGN_PTR, 0);
19
+	    NULL, pefs_zone_dtor_bzero, NULL, NULL, UMA_ALIGN_PTR, 0);
20
 	pefs_alg_init(&pefs_alg_aes);
21
 	pefs_alg_init(&pefs_alg_camellia);
22
 }
(-)sysutils/pefs-kmod/files/patch-sys_fs_pefs_pefs__dircache.c (+11 lines)
Line 0 Link Here
1
--- sys/fs/pefs/pefs_dircache.c.orig	2017-06-21 04:37:11 UTC
2
+++ sys/fs/pefs/pefs_dircache.c
3
@@ -124,7 +124,7 @@ pefs_dircache_init(void)
4
 	    UMA_ALIGN_PTR, 0);
5
 	dircache_entry_zone = uma_zcreate("pefs_dircache_entry",
6
 	    sizeof(struct pefs_dircache_entry), NULL, NULL, NULL,
7
-	    (uma_fini) bzero, UMA_ALIGN_PTR, 0);
8
+	    pefs_zone_fini_bzero, UMA_ALIGN_PTR, 0);
9
 
10
 	if (dircache_global_enable != 0) {
11
 		pefs_dircache_pool_init(&dircache_global);
(-)sysutils/pefs-kmod/files/patch-sys_fs_pefs_pefs__subr.c (+30 lines)
Line 0 Link Here
1
--- sys/fs/pefs/pefs_subr.c.orig	2017-06-21 04:37:11 UTC
2
+++ sys/fs/pefs/pefs_subr.c
3
@@ -96,7 +96,7 @@ pefs_init(struct vfsconf *vfsp)
4
 	taskqueue_start_threads(&pefs_taskq, 1, PVFS, "pefs taskq");
5
 
6
 	pefs_node_zone = uma_zcreate("pefs_node", sizeof(struct pefs_node),
7
-	    NULL, NULL, NULL, (uma_fini) bzero, UMA_ALIGN_PTR, 0);
8
+	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
9
 
10
 	pefs_nodehash_tbl = hashinit(desiredvnodes / 8, M_PEFSHASH,
11
 	    &pefs_nodehash_mask);
12
@@ -121,6 +121,18 @@ pefs_uninit(struct vfsconf *vfsp)
13
 	free(pefs_nodehash_tbl, M_PEFSHASH);
14
 	uma_zdestroy(pefs_node_zone);
15
 	return (0);
16
+}
17
+
18
+void
19
+pefs_zone_dtor_bzero(void *mem, int size, void *arg __unused)
20
+{
21
+	explicit_bzero(mem, size);
22
+}
23
+
24
+void
25
+pefs_zone_fini_bzero(void *mem, int size)
26
+{
27
+	explicit_bzero(mem, size);
28
 }
29
 
30
 static __inline struct pefs_node_listhead *

Return to bug 233882