linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] uml_switch security fixing
@ 2005-03-02 14:53 Blaisorblade
  2005-03-03 12:47 ` [uml-devel] " Nuutti Kotivuori
  0 siblings, 1 reply; 8+ messages in thread
From: Blaisorblade @ 2005-03-02 14:53 UTC (permalink / raw)
  To: Steve Schmidtke, Gerd Knorr; +Cc: user-mode-linux-devel

Hey, has anyone found the time to put together any patch to workaround the 
security bug in uml_net?

I think it would be ok also to simply comment out the offending code (even 
providing some kind of -D configuration option for who really needs SLIP 
support, and they are few)!

Suggestions?
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [uml-devel] RE: uml_switch security fixing
@ 2005-03-07  4:42 Steve Schmidtke
  2005-03-09 10:34 ` Blaisorblade
  2005-03-12  5:48 ` Jeff Dike
  0 siblings, 2 replies; 8+ messages in thread
From: Steve Schmidtke @ 2005-03-07  4:42 UTC (permalink / raw)
  To: blaisorblade, kraxel; +Cc: user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

Blaisorblade wrote:
>Hey, has anyone found the time to put together any patch to workaround the
>security bug in uml_net?

Attached are two patches.  The first one, uml_net-slip.diff, is the minimal 
patch to apply to uml_net.  The second one, uml_net-uml.diff, applies to 
2.4.27-1um (note the half-hearted attempt to plug a FD leak in there as 
well).  As a nice bonus, a UML with this patch still works with an unpatched 
uml_net binary.

>I think it would be ok also to simply comment out the offending code (even
>providing some kind of -D configuration option for who really needs SLIP
>support, and they are few)!
>
>Suggestions?

Agreed, tuntap is a compile time option, slip should be as well.

Steve Schmidtke


[-- Attachment #2: uml_net-slip.diff --]
[-- Type: application/octet-stream, Size: 668 bytes --]

--- tools-20040406.old/uml_net/slip.c	2002-04-28 15:47:35.000000000 -0400
+++ tools-20040406.new/uml_net/slip.c	2005-03-07 10:40:37.000000000 -0500
@@ -111,7 +111,7 @@
 void slip_v4(int argc, char **argv)
 {
   struct output output = INIT_OUTPUT;
-  char *op;
+  char *op, dev[sizeof("slnnnnn\0")];
 
   if(setreuid(0, 0) < 0){
     output_errno(&output, "slip - setreuid failed");
@@ -135,7 +135,8 @@
     slip_up(0, argv[1], NULL, NULL, &output);
   }
   else if(!strcmp(op, "down")){
-    slip_down(argv[1], NULL, NULL, &output);
+    slip_name(0, dev, &output);
+    slip_down(dev, NULL, NULL, &output);
   }
   else {
     printf("slip - Unknown op '%s'\n", op);

[-- Attachment #3: uml_net-uml.diff --]
[-- Type: application/octet-stream, Size: 721 bytes --]

--- linux-2.4.27-1um.old/arch/um/drivers/slip_user.c	2005-03-07 09:59:14.000000000 -0500
+++ linux-2.4.27-1um.new/arch/um/drivers/slip_user.c	2005-03-07 11:55:25.000000000 -0500
@@ -108,6 +108,9 @@
 			err = -EINVAL;
 		}
 	}
+
+	os_close_file(fds[0]);
+
 	return(err);
 }
 
@@ -128,6 +131,7 @@
 	sfd = os_open_file(ptsname(mfd), of_rdwr(OPENFLAGS()), 0);
 	if(sfd < 0){
 		printk("Couldn't open tty for slip line, err = %d\n", -sfd);
+		os_close_file(mfd);
 		return(sfd);
 	}
 	if(set_up_tty(sfd)) return(-1);
@@ -175,7 +179,7 @@
 
 	sprintf(version_buf, "%d", UML_NET_VERSION);
 
-	err = slip_tramp(argv, -1);
+	err = slip_tramp(argv, pri->slave);
 
 	if(err != 0)
 		printk("slip_tramp failed - errno = %d\n", -err);

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

end of thread, other threads:[~2005-03-12  3:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-02 14:53 [uml-devel] uml_switch security fixing Blaisorblade
2005-03-03 12:47 ` [uml-devel] " Nuutti Kotivuori
2005-03-09  9:23   ` Blaisorblade
  -- strict thread matches above, loose matches on Subject: below --
2005-03-07  4:42 [uml-devel] " Steve Schmidtke
2005-03-09 10:34 ` Blaisorblade
2005-03-09 18:53   ` Steve Schmidtke
2005-03-09 19:31     ` Blaisorblade
2005-03-12  5:48 ` Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox