public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 04/12] uml: cope with uml_net security fix
@ 2005-03-22 16:21 blaisorblade
  0 siblings, 0 replies; only message in thread
From: blaisorblade @ 2005-03-22 16:21 UTC (permalink / raw)
  To: akpm; +Cc: jdike, linux-kernel, user-mode-linux-devel, blaisorblade


Pass the interface to close as an fd besides that by name... passing it by
name does not work with newer uml_net because that allows to ifconfig down
arbitrary interfaces, while if you have an open fd to the SLIP interface it
means you have full access to it (and thus can close it). Passing only by fd
does not work with older utilities, so we do both things (which does not
hurt).

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 linux-2.6.11-paolo/arch/um/drivers/slip_user.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN arch/um/drivers/slip_user.c~uml-uml_net-security-fix arch/um/drivers/slip_user.c
--- linux-2.6.11/arch/um/drivers/slip_user.c~uml-uml_net-security-fix	2005-03-21 15:25:41.000000000 +0100
+++ linux-2.6.11-paolo/arch/um/drivers/slip_user.c	2005-03-21 15:25:41.000000000 +0100
@@ -108,6 +108,9 @@ static int slip_tramp(char **argv, int f
 			err = -EINVAL;
 		}
 	}
+
+	os_close_file(fds[0]);
+
 	return(err);
 }
 
@@ -128,6 +131,7 @@ static int slip_open(void *data)
 	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 @@ static void slip_close(int fd, void *dat
 
 	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] only message in thread

only message in thread, other threads:[~2005-03-22 19:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-22 16:21 [patch 04/12] uml: cope with uml_net security fix blaisorblade

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