Re: 2.2.14: recvfrom() bug or feature?

From: Frank van Maarseveen (F.vanMaarseveen@inter.NL.net)
Date: Thu Mar 02 2000 - 19:54:52 EST


On Thu, Mar 02, 2000 at 01:53:39AM +0000, Alan Cox wrote:
> Now I'd like to know what extra it is copying and fix it because it shouldnt
> be copying uncleaned kernel data to userspace..
It's kernel stack: sys_recvfrom() has a 128 byte buffer named `address' from
which it is copied.

I have a fix but it causes routed to fail for another reason. To recall:

        recvfrom(fd, &inbuf, sizeof (inbuf), 0, &from, &fromlen);

routed explicitly tests for a fromlen == sizeof(struct sockaddr_in) which is
16 byte. However, the result returned in `from' is only 8 bytes, and fromlen
is set in accordance now by my patch (and the extra data isn't copied).

Ok, I could fix the broken program but I think a lot of other programs have
the same behavior. This routed is bundled with RedHat 6.1

Don't know how POSIX (1003.1g?) defines this. Propose: make fromlen 16
again and add 8 zeroed bytes to the real from address for compatibility.

-- 
Frank

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:13 EST