[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1281963688.2524.44.camel@edumazet-laptop>
Date: Mon, 16 Aug 2010 15:01:28 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Johannes Berg <johannes@...solutions.net>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
Kalle Valo <kalle.valo@....fi>
Subject: Re: [PATCH] netlink: fix compat recvmsg
Le lundi 16 août 2010 à 14:50 +0200, Eric Dumazet a écrit :
> Le lundi 16 août 2010 à 09:20 +0200, Johannes Berg a écrit :
> > From: Johannes Berg <johannes.berg@...el.com>
> >
> > Since
> > commit 1dacc76d0014a034b8aca14237c127d7c19d7726
> > Author: Johannes Berg <johannes@...solutions.net>
> > Date: Wed Jul 1 11:26:02 2009 +0000
> >
> > net/compat/wext: send different messages to compat tasks
> >
> > we had a race condition when setting and then
> > restoring frag_list. Eric attempted to fix it,
> > but the fix created even worse problems.
> >
> > However, the original motivation I had when I
> > added the code that turned out to be racy is
> > no longer clear to me, since we only copy up
> > to skb->len to userspace, which doesn't include
> > the frag_list length. As a result, not doing
> > any frag_list clearing and restoring avoids
> > the race condition, while not introducing any
> > other problems.
> >
> > Additionally, while preparing this patch I found
> > that since none of the remaining netlink code is
> > really aware of the frag_list, we need to use the
> > original skb's information for packet information
> > and credentials. This fixes, for example, the
> > group information received by compat tasks.
> >
> > Cc: Eric Dumazet <eric.dumazet@...il.com>
> > Cc: stable@...nel.org [2.6.31+, for 2.6.35 revert 1235f504aa]
> > Signed-off-by: Johannes Berg <johannes.berg@...el.com>
> > ---
>
> As a side effect, it might fix the
>
> if (nlk->flags & NETLINK_RECV_PKTINFO)
> netlink_cmsg_recv_pktinfo(msg, skb);
>
> That tried to use pktinfo from the slave skb. After this
> patch, skb points to master skb.
>
As you already mentioned it in your changelog, I missed it ;)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists