summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Wegener <swegener@gentoo.org>2018-09-02 12:09:57 +0000
committerSven Wegener <swegener@gentoo.org>2018-09-02 12:14:31 +0000
commitb8faf2233a6dc7d4f2a0e8ece8feb73a14188f4d (patch)
treec9f2de5937144452aa8bf7b56f3bc53c181b333b /sys-kernel
parentsys-kernel/cryptodev: Use KV_OUT_DIR for building (diff)
downloadgentoo-b8faf2233a6dc7d4f2a0e8ece8feb73a14188f4d.tar.gz
gentoo-b8faf2233a6dc7d4f2a0e8ece8feb73a14188f4d.tar.bz2
gentoo-b8faf2233a6dc7d4f2a0e8ece8feb73a14188f4d.zip
sys-kernel/cryptodev: Fix building with Linux >=4.17
Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'sys-kernel')
-rw-r--r--sys-kernel/cryptodev/cryptodev-1.9.ebuild5
-rw-r--r--sys-kernel/cryptodev/files/ioctl.c-Fix-build-with-linux-4.17.patch39
2 files changed, 43 insertions, 1 deletions
diff --git a/sys-kernel/cryptodev/cryptodev-1.9.ebuild b/sys-kernel/cryptodev/cryptodev-1.9.ebuild
index db23339300ed..7ac492ca811d 100644
--- a/sys-kernel/cryptodev/cryptodev-1.9.ebuild
+++ b/sys-kernel/cryptodev/cryptodev-1.9.ebuild
@@ -23,7 +23,10 @@ S=${WORKDIR}/${PN}-linux-${PV}
MODULE_NAMES="cryptodev(extra:${S})"
BUILD_PARAMS="KERNEL_DIR=\"\${KV_OUT_DIR}\""
-PATCHES="${FILESDIR}/cryptodev-1.9-fix-build-with-4.14-629958.patch"
+PATCHES=(
+ "${FILESDIR}"/cryptodev-1.9-fix-build-with-4.14-629958.patch
+ "${FILESDIR}"/ioctl.c-Fix-build-with-linux-4.17.patch
+)
pkg_pretend() {
if use kernel_linux ; then
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
new file mode 100644
index 000000000000..3eb81e4d9d73
--- /dev/null
+++ b/sys-kernel/cryptodev/files/ioctl.c-Fix-build-with-linux-4.17.patch
@@ -0,0 +1,39 @@
+From f60aa08c63fc02780554a0a12180a478ca27d49f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Horia=20Geant=C4=83?= <horia.geanta@nxp.com>
+Date: Wed, 23 May 2018 18:43:39 +0300
+Subject: [PATCH] ioctl.c: Fix build with linux 4.17
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since kernel 4.17-rc1, sys_* syscalls can no longer be called directly:
+819671ff849b ("syscalls: define and explain goal to not call syscalls in the kernel")
+
+Since cryptodev uses sys_close() - and this has been removed in commit:
+2ca2a09d6215 ("fs: add ksys_close() wrapper; remove in-kernel calls to sys_close()")
+cryptodev has to be updated to use the ksys_close() wrapper.
+
+Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
+---
+ ioctl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ioctl.c b/ioctl.c
+index d831b0c..2571034 100644
+--- a/ioctl.c
++++ b/ioctl.c
+@@ -828,7 +828,11 @@ cryptodev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg_)
+ fd = clonefd(filp);
+ ret = put_user(fd, p);
+ if (unlikely(ret)) {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0))
+ sys_close(fd);
++#else
++ ksys_close(fd);
++#endif
+ return ret;
+ }
+ return ret;
+--
+2.16.4
+