* [PATCH] Re: Local root exploit with kmod and modutils > 2.1.121
2000-11-16 18:56 kuznet
@ 2000-11-16 19:08 ` Xavier Bestel
0 siblings, 0 replies; 4+ messages in thread
From: Xavier Bestel @ 2000-11-16 19:08 UTC (permalink / raw)
To: Linux Kernel; +Cc: Linus Torvalds
Hi,
as modprobe (insmod) seems to have POSIX args handling, we should perhaps add "--"
to the modprobe cmdline, in order to stop further args processing, and to avoid
mixing a textual argument with an option.
BTW, it should perhaps be generalized.
Xav
--- linux-2.4-test10/kernel/kmod.c Tue Sep 26 01:18:55 2000
+++ linux/kernel/kmod.c Thu Nov 16 19:57:45 2000
@@ -133,7 +133,7 @@
static int exec_modprobe(void * module_name)
{
static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
- char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name, NULL };
+ char *argv[] = { modprobe_path, "-s", "-k", "--", (char*)module_name, NULL };
int ret;
ret = exec_usermodehelper(modprobe_path, argv, envp);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Re: Local root exploit with kmod and modutils > 2.1.121
@ 2000-11-16 21:21 Xavier Bestel
2000-11-16 22:00 ` Keith Owens
0 siblings, 1 reply; 4+ messages in thread
From: Xavier Bestel @ 2000-11-16 21:21 UTC (permalink / raw)
To: Linux Kernel
Hi,
as modprobe (insmod) args parsing seems POSIX compliant, we should put a
"--" before
what should be interpreted only as a textual argument, not as an option.
This is a lot safer: whatever is passed, modprobe will take it as a module
name.
--- linux-2.4.0-test10/kernel/kmod.c Tue Sep 26 01:18:55 2000
+++ linux/kernel/kmod.c Thu Nov 16 19:57:45 2000
@@ -133,7 +133,7 @@
static int exec_modprobe(void * module_name)
{
static char * envp[] = { "HOME=/", "TERM=linux",
"PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
- char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name,
NULL };
+ char *argv[] = { modprobe_path, "-s", "-k", "--",
(char*)module_name, NULL };
int ret;
ret = exec_usermodehelper(modprobe_path, argv, envp);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Re: Local root exploit with kmod and modutils > 2.1.121
2000-11-16 21:21 [PATCH] Re: Local root exploit with kmod and modutils > 2.1.121 Xavier Bestel
@ 2000-11-16 22:00 ` Keith Owens
2000-11-16 22:18 ` H. Peter Anvin
0 siblings, 1 reply; 4+ messages in thread
From: Keith Owens @ 2000-11-16 22:00 UTC (permalink / raw)
To: Xavier Bestel; +Cc: Linux Kernel
On Thu, 16 Nov 2000 22:21:52 +0100,
Xavier Bestel <xavier.bestel@free.fr> wrote:
>as modprobe (insmod) args parsing seems POSIX compliant, we should put a
>"--" before
>what should be interpreted only as a textual argument, not as an option.
>This is a lot safer: whatever is passed, modprobe will take it as a module
>name.
That only solves one of the two exploit methods. modutils 2.3.20
solves both without any kernel changes, mainly so it fixes the problem
on all kernels, including 2.2.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Re: Local root exploit with kmod and modutils > 2.1.121
2000-11-16 22:00 ` Keith Owens
@ 2000-11-16 22:18 ` H. Peter Anvin
0 siblings, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2000-11-16 22:18 UTC (permalink / raw)
To: linux-kernel
Followup to: <5529.974412016@ocs3.ocs-net>
By author: Keith Owens <kaos@ocs.com.au>
In newsgroup: linux.dev.kernel
>
> On Thu, 16 Nov 2000 22:21:52 +0100,
> Xavier Bestel <xavier.bestel@free.fr> wrote:
> >as modprobe (insmod) args parsing seems POSIX compliant, we should put a
> >"--" before
> >what should be interpreted only as a textual argument, not as an option.
> >This is a lot safer: whatever is passed, modprobe will take it as a module
> >name.
>
> That only solves one of the two exploit methods. modutils 2.3.20
> solves both without any kernel changes, mainly so it fixes the problem
> on all kernels, including 2.2.
>
However, the kernel change is probably still a good idea.
-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-11-16 22:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-16 21:21 [PATCH] Re: Local root exploit with kmod and modutils > 2.1.121 Xavier Bestel
2000-11-16 22:00 ` Keith Owens
2000-11-16 22:18 ` H. Peter Anvin
-- strict thread matches above, loose matches on Subject: below --
2000-11-16 18:56 kuznet
2000-11-16 19:08 ` [PATCH] " Xavier Bestel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox