All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] netlink: netlink_recvmsg() fix
Date: Fri, 13 Aug 2010 17:13:53 +0200	[thread overview]
Message-ID: <1281712433.2116.15.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1281710887.4470.78.camel@edumazet-laptop>

On Fri, 2010-08-13 at 16:48 +0200, Eric Dumazet wrote:

> >                  * If this skb has a frag_list, then here that means that
> >                  * we will have to use the frag_list skb for compat tasks
> >                  * and the regular skb for non-compat tasks.
> >                  *
> >                  * The skb might (and likely will) be cloned, so we can't
> >                  * just reset frag_list and go on with things -- we need to
> >                  * keep that. For the compat case that's easy -- simply get
> >                  * a reference to the compat skb and free the regular one
> >                  * including the frag. For the non-compat case, we need to
> >                  * avoid sending the frag to the user -- so assign NULL but
> >                  * restore it below before freeing the skb.
> > 
> > and that's no longer true, afaict.
> > 
> 
> Comment was not updated by the patch.
> 
> But do you agree temporarly setting frag_list to NULL was a bug ?

No, that was actually intentional, as the comment describes?

> Unfortunatly I cannot test this path...

No wireless devices? :)

> I assume reverting 1235f504aaba removes these errors ?

I haven't tried yet, but it only happened very recently and I didn't
find any other candidate -- the error always points to
wireless_send_event too.

> Its strange we have a double-free on a data part and not a skb_head.

There also was an apparent use-after-free error.

> maybe pskb_copy() has a problem with frag_list...
> 
> 
> Maybe we can revert the patch and find another way to make sure two
> process can not manipulate this skb in // (adding a mutex, or using
> RTNL ?)

I'm getting confused. Why did I think the NULLing and then restoring was
not racy to start with?

johannes


  reply	other threads:[~2010-08-13 15:13 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 [this message]
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
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=1281712433.2116.15.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.