lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLe0KGjbSim5Qxxr6o0AjJVs7-h79UvMMXKOgGKQUosiA@mail.gmail.com>
Date: Wed, 6 Mar 2024 11:41:39 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Florian Westphal <fw@...len.de>
Cc: xingwei lee <xrivendell7@...il.com>, pabeni@...hat.com, davem@...emloft.net, 
	kuba@...nel.org, linux-hams@...r.kernel.org, linux-kernel@...r.kernel.org, 
	netdev@...r.kernel.org, ralf@...ux-mips.org, syzkaller-bugs@...glegroups.com, 
	samsun1006219@...il.com
Subject: Re: KASAN: slab-use-after-free Read in ip_finish_output

On Wed, Mar 6, 2024 at 11:36 AM Florian Westphal <fw@...len.de> wrote:
>
> Eric Dumazet <edumazet@...gle.com> wrote:
> > On Wed, Mar 6, 2024 at 11:00 AM xingwei lee <xrivendell7@...il.com> wrote:
> > >
> > > Hello, I found a new bug titled "KASAN: slab-use-after-free Read in
> > > ip_finish_output” or “KASAN: slab-use-after-free in sk_to_full_sk" and
> > > confirmed it in the latest net and net-next branch. After my simple
> > > analysis, it may be related to the net/rose or AF_PACKET/PF_PACKET
> > > socket.
> >
> > I already had a syzbot report for this issue, thanks.
> >
> > Adding Florian to the discussion.
> > The issue is cause by ip defrag layer, which calls skb_orphan()
> > These were my notes, I had little time to work on it so far.
>
> > Calling ip_defrag() in output path is also implying skb_orphan(),
> > which is buggy because output path relies on sk not disappearing.
>
> Ugh.  Thanks for your annotations and notes, this is very helpful.
>
> ipvlan (and two spots in ip_output.c do):
>
>    err = ip_local_out(net, skb->sk, skb);
>
> so skb->sk gets propagated down to __ip_finish_output(), long
> after connrack defrag has called skb_orphan().
>
> No idea yet how to fix it,

My plan was to refine "inet: frag: Always orphan skbs inside
ip_defrag()" and only do the skb_orphan()
for skb added to a frag_list.

The head skb would keep a reference to the socket.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ