[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080426014445.GD4792@implementation>
Date: Sat, 26 Apr 2008 02:44:45 +0100
From: Samuel Thibault <samuel.thibault@...-lyon.org>
To: Michael Kerrisk <mtk.manpages@...il.com>
Cc: Michael Kerrisk <mtk.manpages@...glemail.com>,
Andi Kleen <andi@...stfloor.org>,
David Miller <davem@...emloft.net>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen
Michael Kerrisk, le Thu 24 Apr 2008 10:31:15 +0200, a écrit :
> > > and I see that in net/unix/af_unix.c::unix_getname() there is:
> > >
> >
> > > *uaddr_len = sizeof(short);
> >
> > I'd say that code should be fixed into using sa_family_t.
>
> Is there a patch for this?
Here it is
AF_UNIX: make unix_getname use sizeof(sunaddr->sun_family) instead of
sizeof(short).
Signed-off-by: Samuel Thibault <samuel.thibault@...-lyon.org>
--- linux/net/unix/af_unix.c.orig 2008-04-26 02:41:45.000000000 +0100
+++ linux/net/unix/af_unix.c 2008-04-26 02:42:07.000000000 +0100
@@ -1256,7 +1256,7 @@ static int unix_getname(struct socket *s
if (!u->addr) {
sunaddr->sun_family = AF_UNIX;
sunaddr->sun_path[0] = 0;
- *uaddr_len = sizeof(short);
+ *uaddr_len = sizeof(sunaddr->sun_family);
} else {
struct unix_address *addr = u->addr;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists