From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Jan Luebbe Date: Thu, 2 May 2013 16:54:30 +0200 Message-Id: <1367506470-22229-1-git-send-email-jlu@pengutronix.de> Subject: [ptxdist] [PATCH] libkmod: avoid calling syscall() with -1 Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Jan Luebbe This fixes an illegal instruction error on qemu ARM. Signed-off-by: Jan Luebbe --- ...0001-libkmod-Avoid-calling-syscall-with-1.patch | 32 ++++++++++++++++++++ patches/kmod-13/series | 4 +++ 2 files changed, 36 insertions(+) create mode 100644 patches/kmod-13/0001-libkmod-Avoid-calling-syscall-with-1.patch create mode 100644 patches/kmod-13/series diff --git a/patches/kmod-13/0001-libkmod-Avoid-calling-syscall-with-1.patch b/patches/kmod-13/0001-libkmod-Avoid-calling-syscall-with-1.patch new file mode 100644 index 0000000..bfeaf34 --- /dev/null +++ b/patches/kmod-13/0001-libkmod-Avoid-calling-syscall-with-1.patch @@ -0,0 +1,32 @@ +From: Jan Luebbe +Date: Thu, 2 May 2013 16:40:22 +0200 +Subject: [PATCH] libkmod: Avoid calling syscall() with -1 + +At least in qemu 1.4.1 for vexpress/arm-cortexa9, this resulted in an +illegal instruction error. Solve that by returning an error when +__NR_finit_module is -1. +--- + libkmod/missing.h | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/libkmod/missing.h b/libkmod/missing.h +index edb88b9..ac24a35 100644 +--- a/libkmod/missing.h ++++ b/libkmod/missing.h +@@ -20,8 +20,15 @@ + #endif + + #ifndef HAVE_FINIT_MODULE ++#include ++ + static inline int finit_module(int fd, const char *uargs, int flags) + { +- return syscall(__NR_finit_module, fd, uargs, flags); ++ if (__NR_finit_module == -1) { ++ errno = ENOSYS; ++ return -1; ++ } else { ++ return syscall(__NR_finit_module, fd, uargs, flags); ++ } + } + #endif diff --git a/patches/kmod-13/series b/patches/kmod-13/series new file mode 100644 index 0000000..8f9a8ac --- /dev/null +++ b/patches/kmod-13/series @@ -0,0 +1,4 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-libkmod-Avoid-calling-syscall-with-1.patch +# 663dcc1cd4b4be9a3934dab348129c99 - git-ptx-patches magic -- 1.7.10.4 -- ptxdist mailing list ptxdist@pengutronix.de