From: Alexander Potapenko <glider@google.com> To: Phong Tran <tranmanphong@gmail.com> Cc: syzbot+eaaaf38a95427be88f4b@syzkaller.appspotmail.com, Andrey Konovalov <andreyknvl@google.com>, hans.verkuil@cisco.com, mchehab@kernel.org, skhan@linuxfoundation.org, gregkh@linuxfoundation.org, Kees Cook <keescook@chromium.org>, LKML <linux-kernel@vger.kernel.org>, linux-media@vger.kernel.org, linux-usb@vger.kernel.org, syzkaller-bugs <syzkaller-bugs@googlegroups.com>, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH] media: usb: technisat-usb2: fix buffer overflow Date: Tue, 2 Jul 2019 16:23:11 +0200 [thread overview] Message-ID: <CAG_fn=VHpZW69TfK35aqL7o6CvgsPazL5raeW1QmWpu9ReYkhw@mail.gmail.com> (raw) In-Reply-To: <20190702140211.28399-1-tranmanphong@gmail.com> On Tue, Jul 2, 2019 at 4:02 PM Phong Tran <tranmanphong@gmail.com> wrote: > > The buffer will be overflow in case of the while loop can not break. > Add the checking buffer condition in while loop for avoiding > overlooping index. > > This issue was reported by syzbot > > Reported-by: syzbot+eaaaf38a95427be88f4b@syzkaller.appspotmail.com > > Tested by: > https://groups.google.com/d/msg/syzkaller-bugs/CySBCKuUOOs/0hKq1CdjCwAJ > > Signed-off-by: Phong Tran <tranmanphong@gmail.com> > --- > drivers/media/usb/dvb-usb/technisat-usb2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/usb/dvb-usb/technisat-usb2.c b/drivers/media/usb/dvb-usb/technisat-usb2.c > index c659e18b358b..4e0b6185666a 100644 > --- a/drivers/media/usb/dvb-usb/technisat-usb2.c > +++ b/drivers/media/usb/dvb-usb/technisat-usb2.c > @@ -655,7 +655,7 @@ static int technisat_usb2_get_ir(struct dvb_usb_device *d) > #endif > > ev.pulse = 0; > - while (1) { > + while (b != (buf + 63)) { I think it won't hurt to either use ARRAY_SIZE here, or define some magic constant for the buffer size in struct technisat_usb2_state. > ev.pulse = !ev.pulse; > ev.duration = (*b * FIRMWARE_CLOCK_DIVISOR * FIRMWARE_CLOCK_TICK) / 1000; > ir_raw_event_store(d->rc_dev, &ev); > -- > 2.11.0 > > -- > You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group. > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/20190702140211.28399-1-tranmanphong%40gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg
next prev parent reply other threads:[~2019-07-02 14:28 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-14 20:06 KASAN: slab-out-of-bounds Read in technisat_usb2_rc_query syzbot 2019-07-02 14:02 ` [PATCH] media: usb: technisat-usb2: fix buffer overflow Phong Tran 2019-07-02 14:23 ` Alexander Potapenko [this message] 2019-07-02 16:03 ` Kees Cook 2019-07-03 2:14 ` [PATCH V2] " Phong Tran 2019-07-03 2:26 ` Kees Cook 2019-07-03 14:52 ` [PATCH] media: technisat-usb2: break out of loop at end of buffer Sean Young 2019-07-03 16:54 ` Kees Cook
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='CAG_fn=VHpZW69TfK35aqL7o6CvgsPazL5raeW1QmWpu9ReYkhw@mail.gmail.com' \ --to=glider@google.com \ --cc=andreyknvl@google.com \ --cc=gregkh@linuxfoundation.org \ --cc=hans.verkuil@cisco.com \ --cc=keescook@chromium.org \ --cc=linux-kernel-mentees@lists.linuxfoundation.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-media@vger.kernel.org \ --cc=linux-usb@vger.kernel.org \ --cc=mchehab@kernel.org \ --cc=skhan@linuxfoundation.org \ --cc=syzbot+eaaaf38a95427be88f4b@syzkaller.appspotmail.com \ --cc=syzkaller-bugs@googlegroups.com \ --cc=tranmanphong@gmail.com \ --subject='Re: [PATCH] media: usb: technisat-usb2: fix buffer overflow' \ /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
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).