linux emulation COMPAT_43 removal part 1

David P. Reese, Jr. daver at gomerbud.com
Sat Sep 6 15:37:41 PDT 2003


On Sat, Sep 06, 2003 at 01:38:12PM -0700, Matthew Dillon wrote:
>     David, I reviewed your patch and I thought I found a bug, but it turns
>     out the bug is in the original API that you duplicated exactly!  
>     getsockaddr() (and consequentially linux_getsockaddr()) was not checking
>     for a passed length parameter that was too small.  This can result in 
>     a 0-length malloc and then an attempt to assign sa->sa_len.

Good catch.  I was hoping that I would be able to avoid introducing bugs
by duplicating the behavior of the old code.  Guess I was wrong.

>     Also, I looked at the FreeBSD-current code and they appear to be using
>     kern_*(), so if we adopt kern_*() we will be using a comparable API.

This naming convention does look prettier anyway.  I've got a another patch
for uipc_syscalls.c and linux_socket.c on the way.  I'll make sure to
change the split syscall names before I submit.

>     In anycase, don't worry about the malloc problem, I will commit a check
>     along with your patch set.
>
> 					-Matt

Thanks a bunch.

-- 
   David P. Reese, Jr.                                     daver at xxxxxxxxxxxx
                                               http://www.gomerbud.com/daver/





More information about the Submit mailing list