[Ack] Lucid/Maverick/Oneiric SRU, relax AF_INET check in bind()
Leann Ogasawara
leann.ogasawara at canonical.com
Mon Dec 5 21:28:47 UTC 2011
Oneiric is a clean cherry-pick and the Lucid/Maverick backport looks
correct.
Acked-by: Leann Ogasawara <leann.ogasawara at canonical.com>
On Mon, 2011-12-05 at 16:46 -0200, Herton R. Krzesinski wrote:
> SRU Justification
>
> Impact
> bind(AF_UNSPEC) to INADDR_ANY doesn't work anymore, breaking some legacy
> applications, since commit d0733d2e29b65 (Check for mistakenly passed in
> non-IPv4 address)
>
> Fix
> upstream commit 29c486df6a208432b370bd4be99ae1369ede28d8
>
> Testcase
> #include <stdio.h>
> #include <sys/socket.h>
> #include <string.h>
> #include <linux/in.h>
>
> int main(int argc, char **argv)
> {
> struct sockaddr_in addr;
> int fd, r;
>
> fd = socket(PF_INET, SOCK_STREAM, 0);
> memset(&addr, 0, sizeof(struct sockaddr_in));
> r = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
> if (!r)
> printf("Everything looks good\n");
> else
> printf("ERROR: too strict AF_INET check\n");
> close(fd);
> }
>
> --
> []'s
> Herton
>
More information about the kernel-team
mailing list