All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>, edumazet@google.com
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com,
	syzkaller@googlegroups.com, j.vosburgh@gmail.com,
	vfalico@gmail.com, andy@greyhouse.net
Subject: Re: [PATCH net] bonding/alb: properly access headers in bond_alb_xmit()
Date: Wed, 5 Feb 2020 07:16:27 -0800	[thread overview]
Message-ID: <113f8915-57bf-0a7a-1213-66ad04f80a59@gmail.com> (raw)
In-Reply-To: <20200205.143058.1599098684086589259.davem@davemloft.net>



On 2/5/20 5:30 AM, David Miller wrote:
> From: Eric Dumazet <edumazet@google.com>
> Date: Tue,  4 Feb 2020 19:26:05 -0800
> 
>> syzbot managed to send an IPX packet through bond_alb_xmit()
>> and af_packet and triggered a use-after-free.
>>
>> First, bond_alb_xmit() was using ipx_hdr() helper to reach
>> the IPX header, but ipx_hdr() was using the transport offset
>> instead of the network offset. In the particular syzbot
>> report transport offset was 0xFFFF
>>
>> This patch removes ipx_hdr() since it was only (mis)used from bonding.
>>
>> Then we need to make sure IPv4/IPv6/IPX headers are pulled
>> in skb->head before dereferencing anything.
>>
>> BUG: KASAN: use-after-free in bond_alb_xmit+0x153a/0x1590 drivers/net/bonding/bond_alb.c:1452
>> Read of size 2 at addr ffff8801ce56dfff by task syz-executor.2/18108
>>  (if (ipx_hdr(skb)->ipx_checksum != IPX_NO_CHECKSUM) ...)
>  ...
>> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Reported-by: syzbot <syzkaller@googlegroups.com>
> 
> I had to read this one over a few times, but looks good.
> 
> Applied and queued up for -stable, thanks.
> 

Thanks for the scrutiny David !

      reply	other threads:[~2020-02-05 15:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  3:26 [PATCH net] bonding/alb: properly access headers in bond_alb_xmit() Eric Dumazet
2020-02-05 13:30 ` David Miller
2020-02-05 15:16   ` Eric Dumazet [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=113f8915-57bf-0a7a-1213-66ad04f80a59@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=j.vosburgh@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzkaller@googlegroups.com \
    --cc=vfalico@gmail.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 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.