netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: acme@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	acme@redhat.com, glider@google.com, edumazet@google.com,
	kcc@google.com, sasha.levin@oracle.com
Subject: Re: [PATCH 1/1] net: Fix use after free in the recvmmsg exit path
Date: Mon, 14 Mar 2016 12:42:19 -0400 (EDT)	[thread overview]
Message-ID: <20160314.124219.1956200224905019589.davem@davemloft.net> (raw)
In-Reply-To: <1457960195-4302-2-git-send-email-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@kernel.org>
Date: Mon, 14 Mar 2016 09:56:35 -0300

> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> The syzkaller fuzzer hit the following use-after-free:
> 
>   Call Trace:
>    [<ffffffff8175ea0e>] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:295
>    [<ffffffff851cc31a>] __sys_recvmmsg+0x6fa/0x7f0 net/socket.c:2261
>    [<     inline     >] SYSC_recvmmsg net/socket.c:2281
>    [<ffffffff851cc57f>] SyS_recvmmsg+0x16f/0x180 net/socket.c:2270
>    [<ffffffff86332bb6>] entry_SYSCALL_64_fastpath+0x16/0x7a
>   arch/x86/entry/entry_64.S:185
> 
> And, as Dmitry rightly assessed, that is because we can drop the
> reference and then touch it when the underlying recvmsg calls return
> some packets and then hit an error, which will make recvmmsg to set
> sock->sk->sk_err, oops, fix it.
> 
> Reported-and-Tested-by: Dmitry Vyukov <dvyukov@google.com>
> Cc: Alexander Potapenko <glider@google.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Kostya Serebryany <kcc@google.com>
> Cc: Sasha Levin <sasha.levin@oracle.com>
> Fixes: a2e2725541fa ("net: Introduce recvmmsg socket syscall")
> http://lkml.kernel.org/r/20160122211644.GC2470@redhat.com
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Applied and queued up for -stable, thanks Arnaldo!

      reply	other threads:[~2016-03-14 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14 12:56 [PATCH 0/1] recvmmsg use-after-free fix Arnaldo Carvalho de Melo
2016-03-14 12:56 ` [PATCH 1/1] net: Fix use after free in the recvmmsg exit path Arnaldo Carvalho de Melo
2016-03-14 16:42   ` David Miller [this message]

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=20160314.124219.1956200224905019589.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=edumazet@google.com \
    --cc=glider@google.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sasha.levin@oracle.com \
    /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;
as well as URLs for NNTP newsgroup(s).