lkml.org 
[lkml]   [2003]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Re: unix_getname buglet - > 2.5.4(?)
From
Date
On Tue, 2003-01-07 at 04:06, Michael Meeks wrote:
> Evolution is non-functioning on recent 2.5.X kernels, due to
> mal-performance in getpeername => net/unix/af_unix.c (unix_getname),
> where it seems we switch 'sk' on 'peer', but not the (previously)
> typecast pointer to it; this fixes it.

<snip> Your patch was MailerMangled(tm). Below is what I'm running on
2.5.54, using Evolution. The patch is obviously correct (once you look
at the full code, anyway).

Linus, please apply.

Ray

diff -Nurx /home/ray/work/dontdiff linux-2.5.54/net/unix/af_unix.c linux-2.5.54-af_unix.c-fix/net/unix/af_unix.c
--- linux-2.5.54/net/unix/af_unix.c 2003-01-07 09:22:29.000000000 -0800
+++ linux-2.5.54-af_unix.c-fix/net/unix/af_unix.c 2003-01-07 09:55:19.000000000 -0800
@@ -1109,7 +1109,7 @@
static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer)
{
struct sock *sk = sock->sk;
- struct unix_sock *u = unix_sk(sk);
+ struct unix_sock *u;
struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr;
int err = 0;

@@ -1124,6 +1124,7 @@
sock_hold(sk);
}

+ u = unix_sk(sk);
unix_state_rlock(sk);
if (!u->addr) {
sunaddr->sun_family = AF_UNIX;

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

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.030 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site