FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 12-05-2011, 05:46 PM
"Herton R. Krzesinski"
 
Default Lucid/Maverick/Oneiric SRU, relax AF_INET check in bind()

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
");
else
printf("ERROR: too strict AF_INET check
");
close(fd);
}

--
[]'s
Herton

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 12-05-2011, 08:28 PM
Leann Ogasawara
 
Default Lucid/Maverick/Oneiric SRU, relax AF_INET check in bind()

Oneiric is a clean cherry-pick and the Lucid/Maverick backport looks
correct.

Acked-by: Leann Ogasawara <leann.ogasawara@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
");
> else
> printf("ERROR: too strict AF_INET check
");
> close(fd);
> }
>
> --
> []'s
> Herton
>



--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 07:22 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org