All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] kmod : protect against architectures without __NR_finit_module
@ 2013-05-29  7:07 Jérémy Rosen
  2013-05-29 19:34 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Jérémy Rosen @ 2013-05-29  7:07 UTC (permalink / raw)
  To: buildroot

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 <jeremy.rosen@openwide.fr>
---
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 <jlu@pengutronix.de>
+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 <errno.h>
++
+ 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
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH 1/1] kmod : protect against architectures without __NR_finit_module
  2013-05-29  7:07 [Buildroot] [PATCH 1/1] kmod : protect against architectures without __NR_finit_module Jérémy Rosen
@ 2013-05-29 19:34 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2013-05-29 19:34 UTC (permalink / raw)
  To: buildroot

>>>>> "J?r?my" == J?r?my Rosen <jeremy.rosen@openwide.fr> writes:

 J?r?my> This bug caused udev to fail to load any module, crashing with Illegal
 J?r?my> instruction.

 J?r?my> The patch was taken from upstream and should be integrated in the next
 J?r?my> version of kmod (version 14)

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-29 19:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-29  7:07 [Buildroot] [PATCH 1/1] kmod : protect against architectures without __NR_finit_module Jérémy Rosen
2013-05-29 19:34 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.