ChangeSet 1.2231.1.103, 2005/03/28 19:45:09-08:00, [EMAIL PROTECTED]

        [PATCH] uml: cope with uml_net security fix
        
        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 <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 slip_user.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)


diff -Nru a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c
--- a/arch/um/drivers/slip_user.c       2005-03-28 21:29:09 -08:00
+++ b/arch/um/drivers/slip_user.c       2005-03-28 21:29:09 -08:00
@@ -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);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to