mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hou Tao <houtao@huaweicloud.com>
To: syzbot <syzbot+9459b5d7fab774cf182f@syzkaller.appspotmail.com>,
	bpf@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	netdev@vger.kernel.org
Cc: andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net,
	eddyz87@gmail.com, haoluo@google.com, john.fastabend@gmail.com,
	kpsingh@kernel.org, jolsa@kernel.org, martin.lau@linux.dev,
	sdf@google.com, song@kernel.org, yonghong.song@linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [syzbot] [bpf?] KASAN: stack-out-of-bounds Read in hash
Date: Sun, 7 Apr 2024 17:09:28 +0800	[thread overview]
Message-ID: <b764fde2-cbf3-6446-d437-45af0964b062@huaweicloud.com> (raw)
In-Reply-To: <000000000000b97fba06156dc57b@google.com>

Hi,

On 4/6/2024 9:44 PM, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit:    443574b03387 riscv, bpf: Fix kfunc parameters incompatibil..
> git tree:       bpf
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=148ad855180000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=6fb1be60a193d440
> dashboard link: https://syzkaller.appspot.com/bug?extid=9459b5d7fab774cf182f
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13d86795180000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=143eff76180000

According to the reproducer, it passes a big value_size (0xfffffe00)
when creating bloom filter map. The big value_size bypasses the check in
check_stack_access_within_bounds(). I think a proper fix needs to add
these following two checks:
(1) in check_stack_access_within_bounds()  add check for negative
access_size
(2) in bloom_map_alloc() limit the max value of bloom_map_alloc().

Will post a patch to fix the syzbot report. Will also check whether or
not there are similar problems for other bpf maps.


  reply	other threads:[~2024-04-07  9:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06 13:44 syzbot
2024-04-07  9:09 ` Hou Tao [this message]
2024-04-07 14:24   ` Alexei Starovoitov
2024-04-08  1:11     ` Hou Tao
2024-05-15 15:29 ` syzbot
2024-05-16  1:35   ` Hou Tao

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=b764fde2-cbf3-6446-d437-45af0964b062@huaweicloud.com \
    --to=houtao@huaweicloud.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=syzbot+9459b5d7fab774cf182f@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=yonghong.song@linux.dev \
    /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

all inboxes | Powered by JetHome®