tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: suprious reboot on netbsd-6:i386 with PAE

>> The problem is a change in the semantics of local domain socket
>> addresses.  Previously, they had a fixed size, and the path name
>> contained within the address was therefor normally '\0'-terminated.
>> Now the address is the common socket address part plus the pathname,
>> where the terminating '\0' is _not_ part of the address.  When the
>> kernel copies out some local domain part, the user has to supply the
>> terminator, [...]
> this change should be reverted or fixed!

I disagree.  unix(4) (from 4.0.1) says

     The length of UNIX-domain address, required by bind(2) and connect(2),
     can be calculated by the macro SUN_LEN() defined in <sys/un.h>.  The
     sun_path field must be terminated by a NUL character to be used with
     SUN_LEN(), but the terminating NUL is not part of the address.

"the terminating NUL is not part of the address".  Userland code that
depends on the kernel providing the \0 are buggy and need to be fixed;
that NetBSD has for a long time covered up such bygs by providing a \0
does not chnage that.

> we should not have to patch and rebuild apps!

Only buggy apps, apps that already needed patching and rebuilding and
NetBSD just formerly let get away with their incorrect assumptions.

As for whether binary-compat code should provide a \0, that depends on
the extent to which binary compat is supposed to be compatible even in
respects that have never been promised.  I could argue that either way.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index