Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Nov 2001 08:11:57 -0800 (PST)
From:      SAKIYAMA Nobuo <sakichan@sakichan.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/32059: Linux kernel module (linux.ko) fails to load in -CURRENT
Message-ID:  <200111171611.fAHGBvg51632@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         32059
>Category:       kern
>Synopsis:       Linux kernel module (linux.ko) fails to load in -CURRENT
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 17 08:20:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     SAKIYAMA Nobuo
>Release:        FreeBSD 5.0-CURRENT
>Organization:
>Environment:
FreeBSD castor.sakichan.org 5.0-CURRENT FreeBSD 5.0-CURRENT #16: Sun Nov 18 00:42:32 JST 2001   root@castor.sakichan.org:/usr/obj/usr/src/sys/CASTOR  i386
>Description:
src/sys/kern/uipc_syscalls.c:1.99 removes holdsock(),
but src/sys/compat/linux-socket.c use that,
so loading of linux kernel module fails.

>How-To-Repeat:
kldload linux.ko

>Fix:
Following patch will be good.

--- sys/compat/linux/linux_socket.c     26 Oct 2001 23:10:08 -0000      1.30
+++ sys/compat/linux/linux_socket.c     17 Nov 2001 15:35:56 -0000
@@ -416,7 +416,7 @@
                int namelen;
        } */ bsd_args;
        struct socket *so;
-       struct file *fp;
+       unsigned int flag;
        int error;
 
 #ifdef __alpha__
@@ -438,17 +438,16 @@
         * when on a non-blocking socket. Instead it returns the
         * error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD.
         */
-       error = holdsock(td->td_proc->p_fd, linux_args.s, &fp);
+       error = fgetsock(td, linux_args.s, &so, &flag);
        if (error)
                return (error);
        error = EISCONN;
-       if (fp->f_flag & FNONBLOCK) {
-               so = (struct socket *)fp->f_data;
+       if (flag & FNONBLOCK) {
                if (so->so_emuldata == 0)
                        error = so->so_error;
                so->so_emuldata = (void *)1;
        }
-       fdrop(fp, td);
+       fputsock(so);
        return (error);
 }

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111171611.fAHGBvg51632>