1 |
commit: b8faf2233a6dc7d4f2a0e8ece8feb73a14188f4d |
2 |
Author: Sven Wegener <swegener <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 2 12:09:57 2018 +0000 |
4 |
Commit: Sven Wegener <swegener <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 2 12:14:31 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8faf223 |
7 |
|
8 |
sys-kernel/cryptodev: Fix building with Linux >=4.17 |
9 |
|
10 |
Package-Manager: Portage-2.3.40, Repoman-2.3.9 |
11 |
|
12 |
sys-kernel/cryptodev/cryptodev-1.9.ebuild | 5 ++- |
13 |
.../files/ioctl.c-Fix-build-with-linux-4.17.patch | 39 ++++++++++++++++++++++ |
14 |
2 files changed, 43 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/sys-kernel/cryptodev/cryptodev-1.9.ebuild b/sys-kernel/cryptodev/cryptodev-1.9.ebuild |
17 |
index db23339300e..7ac492ca811 100644 |
18 |
--- a/sys-kernel/cryptodev/cryptodev-1.9.ebuild |
19 |
+++ b/sys-kernel/cryptodev/cryptodev-1.9.ebuild |
20 |
@@ -23,7 +23,10 @@ S=${WORKDIR}/${PN}-linux-${PV} |
21 |
MODULE_NAMES="cryptodev(extra:${S})" |
22 |
BUILD_PARAMS="KERNEL_DIR=\"\${KV_OUT_DIR}\"" |
23 |
|
24 |
-PATCHES="${FILESDIR}/cryptodev-1.9-fix-build-with-4.14-629958.patch" |
25 |
+PATCHES=( |
26 |
+ "${FILESDIR}"/cryptodev-1.9-fix-build-with-4.14-629958.patch |
27 |
+ "${FILESDIR}"/ioctl.c-Fix-build-with-linux-4.17.patch |
28 |
+) |
29 |
|
30 |
pkg_pretend() { |
31 |
if use kernel_linux ; then |
32 |
|
33 |
diff --git a/sys-kernel/cryptodev/files/ioctl.c-Fix-build-with-linux-4.17.patch b/sys-kernel/cryptodev/files/ioctl.c-Fix-build-with-linux-4.17.patch |
34 |
new file mode 100644 |
35 |
index 00000000000..3eb81e4d9d7 |
36 |
--- /dev/null |
37 |
+++ b/sys-kernel/cryptodev/files/ioctl.c-Fix-build-with-linux-4.17.patch |
38 |
@@ -0,0 +1,39 @@ |
39 |
+From f60aa08c63fc02780554a0a12180a478ca27d49f Mon Sep 17 00:00:00 2001 |
40 |
+From: =?UTF-8?q?Horia=20Geant=C4=83?= <horia.geanta@×××.com> |
41 |
+Date: Wed, 23 May 2018 18:43:39 +0300 |
42 |
+Subject: [PATCH] ioctl.c: Fix build with linux 4.17 |
43 |
+MIME-Version: 1.0 |
44 |
+Content-Type: text/plain; charset=UTF-8 |
45 |
+Content-Transfer-Encoding: 8bit |
46 |
+ |
47 |
+Since kernel 4.17-rc1, sys_* syscalls can no longer be called directly: |
48 |
+819671ff849b ("syscalls: define and explain goal to not call syscalls in the kernel") |
49 |
+ |
50 |
+Since cryptodev uses sys_close() - and this has been removed in commit: |
51 |
+2ca2a09d6215 ("fs: add ksys_close() wrapper; remove in-kernel calls to sys_close()") |
52 |
+cryptodev has to be updated to use the ksys_close() wrapper. |
53 |
+ |
54 |
+Signed-off-by: Horia Geantă <horia.geanta@×××.com> |
55 |
+--- |
56 |
+ ioctl.c | 4 ++++ |
57 |
+ 1 file changed, 4 insertions(+) |
58 |
+ |
59 |
+diff --git a/ioctl.c b/ioctl.c |
60 |
+index d831b0c..2571034 100644 |
61 |
+--- a/ioctl.c |
62 |
++++ b/ioctl.c |
63 |
+@@ -828,7 +828,11 @@ cryptodev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg_) |
64 |
+ fd = clonefd(filp); |
65 |
+ ret = put_user(fd, p); |
66 |
+ if (unlikely(ret)) { |
67 |
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)) |
68 |
+ sys_close(fd); |
69 |
++#else |
70 |
++ ksys_close(fd); |
71 |
++#endif |
72 |
+ return ret; |
73 |
+ } |
74 |
+ return ret; |
75 |
+-- |
76 |
+2.16.4 |
77 |
+ |