Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, Kalle Valo <kalle.valo@iki.fi>
Subject: Re: [PATCH] netlink: fix compat recvmsg
Date: Mon, 16 Aug 2010 14:50:25 +0200	[thread overview]
Message-ID: <1281963025.2524.43.camel@edumazet-laptop> (raw)
In-Reply-To: <1281943244.3683.8.camel@jlt3.sipsolutions.net>

Le lundi 16 août 2010 à 09:20 +0200, Johannes Berg a écrit :
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Since
> commit 1dacc76d0014a034b8aca14237c127d7c19d7726
> Author: Johannes Berg <johannes@sipsolutions.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@gmail.com>
> Cc: stable@kernel.org [2.6.31+, for 2.6.35 revert 1235f504aa]
> Signed-off-by: Johannes Berg <johannes.berg@intel.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.

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Thanks !



  reply	other threads:[~2010-08-16 12:50 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20 13:16 [PATCH net-next-2.6] netlink: netlink_recvmsg() fix Eric Dumazet
2010-07-20 15:20 ` Eric Dumazet
2010-07-21  8:05   ` Johannes Berg
2010-07-21  8:20     ` Eric Dumazet
2010-07-21  8:43       ` Eric Dumazet
2010-07-26  4:55         ` David Miller
2010-07-26 20:08           ` David Miller
2010-07-26 20:39             ` Eric Dumazet
2010-07-26 20:48               ` David Miller
2010-07-26 20:55                 ` Eric Dumazet
2010-08-13 14:00           ` Johannes Berg
2010-08-13 14:35             ` Johannes Berg
2010-08-13 14:48               ` Eric Dumazet
2010-08-13 15:13                 ` Johannes Berg
2010-08-15  5:37                   ` David Miller
2010-08-16  5:25                     ` Johannes Berg
2010-08-16  6:10                       ` Eric Dumazet
2010-08-16  6:21                         ` David Miller
2010-08-16  6:22                         ` Johannes Berg
2010-08-16  6:29                           ` Eric Dumazet
2010-08-16  6:31                             ` Johannes Berg
2010-08-16  7:20                             ` [PATCH] netlink: fix compat recvmsg Johannes Berg
2010-08-16 12:50                               ` Eric Dumazet [this message]
2010-08-16 12:54                                 ` Johannes Berg
2010-08-16 13:01                                 ` Eric Dumazet
2010-08-19  6:36                                 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281963025.2524.43.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=kalle.valo@iki.fi \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox