From patchwork Wed May 29 07:07:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeremy Rosen X-Patchwork-Id: 247134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id CDE942C02AD for ; Wed, 29 May 2013 17:11:55 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6A53F8C7CF; Wed, 29 May 2013 07:11:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yPLqLTIsuX3q; Wed, 29 May 2013 07:11:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 496D38C755; Wed, 29 May 2013 07:11:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4CB5B8F79E for ; Wed, 29 May 2013 07:11:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1828E8C78B for ; Wed, 29 May 2013 07:11:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SHS+88JGmyk5 for ; Wed, 29 May 2013 07:11:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from zimbra3.corp.accelance.fr (zimbra3.corp.accelance.fr [213.162.49.233]) by whitealder.osuosl.org (Postfix) with ESMTP id 5D5508C9CF for ; Wed, 29 May 2013 07:11:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra3.corp.accelance.fr (Postfix) with ESMTP id 0B9E96461A for ; Wed, 29 May 2013 09:11:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra3.corp.accelance.fr Received: from zimbra3.corp.accelance.fr ([127.0.0.1]) by localhost (zimbra3.corp.accelance.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iks5aCp28fV5; Wed, 29 May 2013 09:11:26 +0200 (CEST) Received: from pcrosen.daviel.openwide.fr. (unknown [193.56.60.160]) by zimbra3.corp.accelance.fr (Postfix) with ESMTPSA id 6BB7264619; Wed, 29 May 2013 09:11:26 +0200 (CEST) From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= To: buildroot@busybox.net Date: Wed, 29 May 2013 09:07:18 +0200 Message-Id: <1369811238-31522-1-git-send-email-jeremy.rosen@openwide.fr> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] kmod : protect against architectures without __NR_finit_module X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net This bug caused udev to fail to load any module, crashing with Illegal instruction. The patch was taken from upstream and should be integrated in the next version of kmod (version 14) Signed-off-by: Jérémy Rosen --- This bug went undetected because it only triggers when modules are loaded via libkmod and buildroot will use busybox to implement modprobe. --- package/kmod/kmod-001-no-syscall--1.patch | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/kmod/kmod-001-no-syscall--1.patch diff --git a/package/kmod/kmod-001-no-syscall--1.patch b/package/kmod/kmod-001-no-syscall--1.patch new file mode 100644 index 0000000..e7a3a11 --- /dev/null +++ b/package/kmod/kmod-001-no-syscall--1.patch @@ -0,0 +1,31 @@ +From 5eac795b8b067842caec32f96d55a7554c3c67f9 Mon Sep 17 00:00:00 2001 +From: Jan Luebbe +Date: Thu, 02 May 2013 14:47:12 +0000 +Subject: 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. +--- +diff --git a/libkmod/missing.h b/libkmod/missing.h +index edb88b9..b45bbe2 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) + { ++ if (__NR_finit_module == -1) { ++ errno = ENOSYS; ++ return -1; ++ } ++ + return syscall(__NR_finit_module, fd, uargs, flags); + } + #endif +-- +cgit v0.9.2