kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
       [not found] <0000000000002cfc3a0598d42b70@google.com>
@ 2019-12-04 21:41 ` syzbot
  2019-12-05  1:59   ` Tetsuo Handa
  2019-12-05 10:13   ` Paolo Bonzini
  0 siblings, 2 replies; 13+ messages in thread
From: syzbot @ 2019-12-04 21:41 UTC (permalink / raw)
  To: aryabinin, b.zolnierkie, daniel.thompson, daniel.vetter,
	dri-devel, dvyukov, ghalat, gleb, gwshan, hpa, jmorris,
	kasan-dev, kvm, linux-fbdev, linux-kernel, linux-security-module,
	maarten.lankhorst, mingo, mpe, pbonzini, penguin-kernel, ruscur,
	sam, serge, stewart, syzkaller-bugs, takedakn, tglx, x86

syzbot has bisected this bug to:

commit 2de50e9674fc4ca3c6174b04477f69eb26b4ee31
Author: Russell Currey <ruscur@russell.cc>
Date:   Mon Feb 8 04:08:20 2016 +0000

     powerpc/powernv: Remove support for p5ioc2

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=127a042ae00000
start commit:   76bb8b05 Merge tag 'kbuild-v5.5' of git://git.kernel.org/p..
git tree:       upstream
final crash:    https://syzkaller.appspot.com/x/report.txt?x=117a042ae00000
console output: https://syzkaller.appspot.com/x/log.txt?x=167a042ae00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=dd226651cb0f364b
dashboard link: https://syzkaller.appspot.com/bug?extid=4455ca3b3291de891abc
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11181edae00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=105cbb7ae00000

Reported-by: syzbot+4455ca3b3291de891abc@syzkaller.appspotmail.com
Fixes: 2de50e9674fc ("powerpc/powernv: Remove support for p5ioc2")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-04 21:41 ` KASAN: slab-out-of-bounds Read in fbcon_get_font syzbot
@ 2019-12-05  1:59   ` Tetsuo Handa
  2019-12-05 10:13   ` Paolo Bonzini
  1 sibling, 0 replies; 13+ messages in thread
From: Tetsuo Handa @ 2019-12-05  1:59 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Daniel Vetter, Maarten Lankhorst,
	Sam Ravnborg, Grzegorz Halat
  Cc: syzbot, aryabinin, daniel.thompson, dri-devel, dvyukov, gleb,
	gwshan, hpa, jmorris, kasan-dev, kvm, linux-fbdev, linux-kernel,
	linux-security-module, mingo, mpe, pbonzini, ruscur, serge,
	stewart, syzkaller-bugs, takedakn, tglx, x86

Hello.

syzbot is reporting that memory allocation size at fbcon_set_font() is too small
because font's height is rounded up from 10 to 16 after memory allocation.

----------
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index c9235a2f42f8..68fe66e435d3 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -2461,6 +2461,7 @@ static int fbcon_get_font(struct vc_data *vc, struct console_font *font)
 
 	if (font->width <= 8) {
 		j = vc->vc_font.height;
+		printk("ksize(fontdata)=%lu font->charcount=%d vc->vc_font.height=%d font->width=%u\n", ksize(fontdata), font->charcount, j, font->width);
 		for (i = 0; i < font->charcount; i++) {
 			memcpy(data, fontdata, j);
 			memset(data + j, 0, 32 - j);
@@ -2661,6 +2662,8 @@ static int fbcon_set_font(struct vc_data *vc, struct console_font *font,
 	size = h * pitch * charcount;
 
 	new_data = kmalloc(FONT_EXTRA_WORDS * sizeof(int) + size, GFP_USER);
+	if (new_data)
+		printk("ksize(new_data)=%lu h=%u pitch=%u charcount=%u font->width=%u\n", ksize(new_data), h, pitch, charcount, font->width);
 
 	if (!new_data)
 		return -ENOMEM;
----------

Normal usage:

[   27.305293] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.328527] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.362551] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.385084] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.387653] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.417562] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.437808] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.440738] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.461157] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.495346] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.607372] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.655674] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.675310] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8
[   27.702193] ksize(new_data)=8192 h=16 pitch=1 charcount=256 font->width=8

syzbot's testcase:

[  115.784893] ksize(new_data)=4096 h=10 pitch=1 charcount=256 font->width=8
[  115.790269] ksize(fontdata)=4096 font->charcount=256 vc->vc_font.height=16 font->width=8

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-04 21:41 ` KASAN: slab-out-of-bounds Read in fbcon_get_font syzbot
  2019-12-05  1:59   ` Tetsuo Handa
@ 2019-12-05 10:13   ` Paolo Bonzini
  2019-12-05 10:16     ` Dmitry Vyukov
  1 sibling, 1 reply; 13+ messages in thread
From: Paolo Bonzini @ 2019-12-05 10:13 UTC (permalink / raw)
  To: syzbot, aryabinin, b.zolnierkie, daniel.thompson, daniel.vetter,
	dri-devel, dvyukov, ghalat, gleb, gwshan, hpa, jmorris,
	kasan-dev, kvm, linux-fbdev, linux-kernel, linux-security-module,
	maarten.lankhorst, mingo, mpe, penguin-kernel, ruscur, sam,
	serge, stewart, syzkaller-bugs, takedakn, tglx, x86

On 04/12/19 22:41, syzbot wrote:
> syzbot has bisected this bug to:
> 
> commit 2de50e9674fc4ca3c6174b04477f69eb26b4ee31
> Author: Russell Currey <ruscur@russell.cc>
> Date:   Mon Feb 8 04:08:20 2016 +0000
> 
>     powerpc/powernv: Remove support for p5ioc2
> 
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=127a042ae00000
> start commit:   76bb8b05 Merge tag 'kbuild-v5.5' of
> git://git.kernel.org/p..
> git tree:       upstream
> final crash:    https://syzkaller.appspot.com/x/report.txt?x=117a042ae00000
> console output: https://syzkaller.appspot.com/x/log.txt?x=167a042ae00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=dd226651cb0f364b
> dashboard link:
> https://syzkaller.appspot.com/bug?extid=4455ca3b3291de891abc
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11181edae00000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=105cbb7ae00000
> 
> Reported-by: syzbot+4455ca3b3291de891abc@syzkaller.appspotmail.com
> Fixes: 2de50e9674fc ("powerpc/powernv: Remove support for p5ioc2")
> 
> For information about bisection process see:
> https://goo.gl/tpsmEJ#bisection
> 

Why is everybody being CC'd, even if the bug has nothing to do with the
person's subsystem?

Thanks,

Paolo


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 10:13   ` Paolo Bonzini
@ 2019-12-05 10:16     ` Dmitry Vyukov
  2019-12-05 10:22       ` Paolo Bonzini
  2019-12-05 10:30       ` Tetsuo Handa
  0 siblings, 2 replies; 13+ messages in thread
From: Dmitry Vyukov @ 2019-12-05 10:16 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: syzbot, Andrey Ryabinin, Bartlomiej Zolnierkiewicz,
	Daniel Thompson, Daniel Vetter, DRI, ghalat, Gleb Natapov,
	gwshan, H. Peter Anvin, James Morris, kasan-dev, KVM list,
	Linux Fbdev development list, LKML, linux-security-module,
	Maarten Lankhorst, Ingo Molnar, Michael Ellerman, Tetsuo Handa,
	Russell Currey, Sam Ravnborg, Serge E. Hallyn, stewart,
	syzkaller-bugs, Kentaro Takeda, Thomas Gleixner,
	the arch/x86 maintainers

On Thu, Dec 5, 2019 at 11:13 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 04/12/19 22:41, syzbot wrote:
> > syzbot has bisected this bug to:
> >
> > commit 2de50e9674fc4ca3c6174b04477f69eb26b4ee31
> > Author: Russell Currey <ruscur@russell.cc>
> > Date:   Mon Feb 8 04:08:20 2016 +0000
> >
> >     powerpc/powernv: Remove support for p5ioc2
> >
> > bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=127a042ae00000
> > start commit:   76bb8b05 Merge tag 'kbuild-v5.5' of
> > git://git.kernel.org/p..
> > git tree:       upstream
> > final crash:    https://syzkaller.appspot.com/x/report.txt?x=117a042ae00000
> > console output: https://syzkaller.appspot.com/x/log.txt?x=167a042ae00000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=dd226651cb0f364b
> > dashboard link:
> > https://syzkaller.appspot.com/bug?extid=4455ca3b3291de891abc
> > syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11181edae00000
> > C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=105cbb7ae00000
> >
> > Reported-by: syzbot+4455ca3b3291de891abc@syzkaller.appspotmail.com
> > Fixes: 2de50e9674fc ("powerpc/powernv: Remove support for p5ioc2")
> >
> > For information about bisection process see:
> > https://goo.gl/tpsmEJ#bisection
> >
>
> Why is everybody being CC'd, even if the bug has nothing to do with the
> person's subsystem?

The To list should be intersection of 2 groups of emails: result of
get_maintainers.pl on the file identified as culprit in the crash
message + emails extracted from the bisected to commit.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 10:16     ` Dmitry Vyukov
@ 2019-12-05 10:22       ` Paolo Bonzini
  2019-12-05 10:31         ` Dmitry Vyukov
  2019-12-05 10:41         ` Tetsuo Handa
  2019-12-05 10:30       ` Tetsuo Handa
  1 sibling, 2 replies; 13+ messages in thread
From: Paolo Bonzini @ 2019-12-05 10:22 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: syzbot, Andrey Ryabinin, Bartlomiej Zolnierkiewicz,
	Daniel Thompson, Daniel Vetter, DRI, ghalat, Gleb Natapov,
	gwshan, H. Peter Anvin, James Morris, kasan-dev, KVM list,
	Linux Fbdev development list, LKML, linux-security-module,
	Maarten Lankhorst, Ingo Molnar, Michael Ellerman, Tetsuo Handa,
	Russell Currey, Sam Ravnborg, Serge E. Hallyn, stewart,
	syzkaller-bugs, Kentaro Takeda, Thomas Gleixner,
	the arch/x86 maintainers

On 05/12/19 11:16, Dmitry Vyukov wrote:
> On Thu, Dec 5, 2019 at 11:13 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 04/12/19 22:41, syzbot wrote:
>>> syzbot has bisected this bug to:
>>>
>>> commit 2de50e9674fc4ca3c6174b04477f69eb26b4ee31
>>> Author: Russell Currey <ruscur@russell.cc>
>>> Date:   Mon Feb 8 04:08:20 2016 +0000
>>>
>>>     powerpc/powernv: Remove support for p5ioc2
>>>
>>> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=127a042ae00000
>>> start commit:   76bb8b05 Merge tag 'kbuild-v5.5' of
>>> git://git.kernel.org/p..
>>> git tree:       upstream
>>> final crash:    https://syzkaller.appspot.com/x/report.txt?x=117a042ae00000
>>> console output: https://syzkaller.appspot.com/x/log.txt?x=167a042ae00000
>>> kernel config:  https://syzkaller.appspot.com/x/.config?x=dd226651cb0f364b
>>> dashboard link:
>>> https://syzkaller.appspot.com/bug?extid=4455ca3b3291de891abc
>>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11181edae00000
>>> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=105cbb7ae00000
>>>
>>> Reported-by: syzbot+4455ca3b3291de891abc@syzkaller.appspotmail.com
>>> Fixes: 2de50e9674fc ("powerpc/powernv: Remove support for p5ioc2")
>>>
>>> For information about bisection process see:
>>> https://goo.gl/tpsmEJ#bisection
>>>
>>
>> Why is everybody being CC'd, even if the bug has nothing to do with the
>> person's subsystem?
> 
> The To list should be intersection of 2 groups of emails: result of
> get_maintainers.pl on the file identified as culprit in the crash
> message + emails extracted from the bisected to commit.

Ah, and because the machine is a KVM guest, kvm_wait appears in a lot of
backtrace and I get to share syzkaller's joy every time. :)

This bisect result is bogus, though Tetsuo found the bug anyway.
Perhaps you can exclude commits that only touch architectures other than
x86?

Paolo


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 10:16     ` Dmitry Vyukov
  2019-12-05 10:22       ` Paolo Bonzini
@ 2019-12-05 10:30       ` Tetsuo Handa
  1 sibling, 0 replies; 13+ messages in thread
From: Tetsuo Handa @ 2019-12-05 10:30 UTC (permalink / raw)
  To: Dmitry Vyukov, Paolo Bonzini
  Cc: syzbot, Andrey Ryabinin, Bartlomiej Zolnierkiewicz,
	Daniel Thompson, Daniel Vetter, DRI, ghalat, Gleb Natapov,
	gwshan, H. Peter Anvin, James Morris, kasan-dev, KVM list,
	Linux Fbdev development list, LKML, linux-security-module,
	Maarten Lankhorst, Ingo Molnar, Michael Ellerman, Russell Currey,
	Sam Ravnborg, Serge E. Hallyn, stewart, syzkaller-bugs,
	Kentaro Takeda, Thomas Gleixner, the arch/x86 maintainers

On 2019/12/05 19:16, Dmitry Vyukov wrote:
> On Thu, Dec 5, 2019 at 11:13 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 04/12/19 22:41, syzbot wrote:
>>> syzbot has bisected this bug to:
>>>
>>> commit 2de50e9674fc4ca3c6174b04477f69eb26b4ee31
>>> Author: Russell Currey <ruscur@russell.cc>
>>> Date:   Mon Feb 8 04:08:20 2016 +0000
>>>
>>>     powerpc/powernv: Remove support for p5ioc2
>>>
>>> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=127a042ae00000
>>> start commit:   76bb8b05 Merge tag 'kbuild-v5.5' of
>>> git://git.kernel.org/p..
>>> git tree:       upstream
>>> final crash:    https://syzkaller.appspot.com/x/report.txt?x=117a042ae00000
>>> console output: https://syzkaller.appspot.com/x/log.txt?x=167a042ae00000
>>> kernel config:  https://syzkaller.appspot.com/x/.config?x=dd226651cb0f364b
>>> dashboard link:
>>> https://syzkaller.appspot.com/bug?extid=4455ca3b3291de891abc
>>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11181edae00000
>>> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=105cbb7ae00000
>>>
>>> Reported-by: syzbot+4455ca3b3291de891abc@syzkaller.appspotmail.com
>>> Fixes: 2de50e9674fc ("powerpc/powernv: Remove support for p5ioc2")
>>>
>>> For information about bisection process see:
>>> https://goo.gl/tpsmEJ#bisection
>>>
>>
>> Why is everybody being CC'd, even if the bug has nothing to do with the
>> person's subsystem?
> 
> The To list should be intersection of 2 groups of emails: result of
> get_maintainers.pl on the file identified as culprit in the crash
> message + emails extracted from the bisected to commit.
> 

There is "#syz uncc" command but it is too hard to utilize?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 10:22       ` Paolo Bonzini
@ 2019-12-05 10:31         ` Dmitry Vyukov
  2019-12-05 10:53           ` Paolo Bonzini
  2019-12-05 10:41         ` Tetsuo Handa
  1 sibling, 1 reply; 13+ messages in thread
From: Dmitry Vyukov @ 2019-12-05 10:31 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: syzbot, Andrey Ryabinin, Bartlomiej Zolnierkiewicz,
	Daniel Thompson, Daniel Vetter, DRI, ghalat, Gleb Natapov,
	gwshan, H. Peter Anvin, James Morris, kasan-dev, KVM list,
	Linux Fbdev development list, LKML, linux-security-module,
	Maarten Lankhorst, Ingo Molnar, Michael Ellerman, Tetsuo Handa,
	Russell Currey, Sam Ravnborg, Serge E. Hallyn, stewart,
	syzkaller-bugs, Kentaro Takeda, Thomas Gleixner,
	the arch/x86 maintainers

On Thu, Dec 5, 2019 at 11:22 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 05/12/19 11:16, Dmitry Vyukov wrote:
> > On Thu, Dec 5, 2019 at 11:13 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
> >>
> >> On 04/12/19 22:41, syzbot wrote:
> >>> syzbot has bisected this bug to:
> >>>
> >>> commit 2de50e9674fc4ca3c6174b04477f69eb26b4ee31
> >>> Author: Russell Currey <ruscur@russell.cc>
> >>> Date:   Mon Feb 8 04:08:20 2016 +0000
> >>>
> >>>     powerpc/powernv: Remove support for p5ioc2
> >>>
> >>> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=127a042ae00000
> >>> start commit:   76bb8b05 Merge tag 'kbuild-v5.5' of
> >>> git://git.kernel.org/p..
> >>> git tree:       upstream
> >>> final crash:    https://syzkaller.appspot.com/x/report.txt?x=117a042ae00000
> >>> console output: https://syzkaller.appspot.com/x/log.txt?x=167a042ae00000
> >>> kernel config:  https://syzkaller.appspot.com/x/.config?x=dd226651cb0f364b
> >>> dashboard link:
> >>> https://syzkaller.appspot.com/bug?extid=4455ca3b3291de891abc
> >>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11181edae00000
> >>> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=105cbb7ae00000
> >>>
> >>> Reported-by: syzbot+4455ca3b3291de891abc@syzkaller.appspotmail.com
> >>> Fixes: 2de50e9674fc ("powerpc/powernv: Remove support for p5ioc2")
> >>>
> >>> For information about bisection process see:
> >>> https://goo.gl/tpsmEJ#bisection
> >>>
> >>
> >> Why is everybody being CC'd, even if the bug has nothing to do with the
> >> person's subsystem?
> >
> > The To list should be intersection of 2 groups of emails: result of
> > get_maintainers.pl on the file identified as culprit in the crash
> > message + emails extracted from the bisected to commit.
>
> Ah, and because the machine is a KVM guest, kvm_wait appears in a lot of
> backtrace and I get to share syzkaller's joy every time. :)

I don't see any mention of "kvm" in the crash report. And it's only 1
file, not all of them, in this case I would expect it to be
drivers/video/fbdev/core/fbcon.c. So it should be something different.

> This bisect result is bogus, though Tetsuo found the bug anyway.
> Perhaps you can exclude commits that only touch architectures other than
> x86?

We do this. It work sometimes. But sometimes it hits non-deterministic
kernel build bugs:
https://github.com/google/syzkaller/issues/1271#issuecomment-559093018
And in this case it hit some git bisect weirdness which I can't explain yet:
https://github.com/google/syzkaller/issues/1527

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 10:22       ` Paolo Bonzini
  2019-12-05 10:31         ` Dmitry Vyukov
@ 2019-12-05 10:41         ` Tetsuo Handa
  2019-12-05 11:35           ` Dmitry Vyukov
  2019-12-05 11:36           ` Dmitry Vyukov
  1 sibling, 2 replies; 13+ messages in thread
From: Tetsuo Handa @ 2019-12-05 10:41 UTC (permalink / raw)
  To: Paolo Bonzini, Dmitry Vyukov
  Cc: syzbot, Andrey Ryabinin, Bartlomiej Zolnierkiewicz,
	Daniel Thompson, Daniel Vetter, DRI, ghalat, Gleb Natapov,
	gwshan, H. Peter Anvin, James Morris, kasan-dev, KVM list,
	Linux Fbdev development list, LKML, linux-security-module,
	Maarten Lankhorst, Ingo Molnar, Michael Ellerman, Russell Currey,
	Sam Ravnborg, Serge E. Hallyn, stewart, syzkaller-bugs,
	Kentaro Takeda, Thomas Gleixner, the arch/x86 maintainers

On 2019/12/05 19:22, Paolo Bonzini wrote:
> Ah, and because the machine is a KVM guest, kvm_wait appears in a lot of
> backtrace and I get to share syzkaller's joy every time. :)
> 
> This bisect result is bogus, though Tetsuo found the bug anyway.
> Perhaps you can exclude commits that only touch architectures other than
> x86?
> 

It would be nice if coverage functionality can extract filenames in the source
code and supply the list of filenames as arguments for bisect operation.

Also, (unrelated but) it would be nice if we can have "make yes2modconfig"
target which converts CONFIG_FOO=y to CONFIG_FOO=m if FOO is tristate.
syzbot is testing kernel configs close to "make allyesconfig" but I want to
save kernel rebuild time by disabling unrelated functionality when manually
"debug printk()ing" kernels.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 10:31         ` Dmitry Vyukov
@ 2019-12-05 10:53           ` Paolo Bonzini
  2019-12-05 11:27             ` Dmitry Vyukov
  0 siblings, 1 reply; 13+ messages in thread
From: Paolo Bonzini @ 2019-12-05 10:53 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: syzbot, Andrey Ryabinin, Bartlomiej Zolnierkiewicz,
	Daniel Thompson, Daniel Vetter, DRI, ghalat, Gleb Natapov,
	gwshan, H. Peter Anvin, James Morris, kasan-dev, KVM list,
	Linux Fbdev development list, LKML, linux-security-module,
	Maarten Lankhorst, Ingo Molnar, Michael Ellerman, Tetsuo Handa,
	Russell Currey, Sam Ravnborg, Serge E. Hallyn, stewart,
	syzkaller-bugs, Kentaro Takeda, Thomas Gleixner,
	the arch/x86 maintainers

On 05/12/19 11:31, Dmitry Vyukov wrote:
>> Ah, and because the machine is a KVM guest, kvm_wait appears in a lot of
>> backtrace and I get to share syzkaller's joy every time. :)
> I don't see any mention of "kvm" in the crash report.

It's there in the stack trace, not sure if this is what triggered my Cc:

 [<ffffffff810c7c3a>] kvm_wait+0xca/0xe0 arch/x86/kernel/kvm.c:612

Paolo


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 10:53           ` Paolo Bonzini
@ 2019-12-05 11:27             ` Dmitry Vyukov
  2019-12-05 11:29               ` Paolo Bonzini
  0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Vyukov @ 2019-12-05 11:27 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: syzbot, Andrey Ryabinin, Bartlomiej Zolnierkiewicz,
	Daniel Thompson, Daniel Vetter, DRI, ghalat, Gleb Natapov,
	gwshan, H. Peter Anvin, James Morris, kasan-dev, KVM list,
	Linux Fbdev development list, LKML, linux-security-module,
	Maarten Lankhorst, Ingo Molnar, Michael Ellerman, Tetsuo Handa,
	Russell Currey, Sam Ravnborg, Serge E. Hallyn, stewart,
	syzkaller-bugs, Kentaro Takeda, Thomas Gleixner,
	the arch/x86 maintainers

On Thu, Dec 5, 2019 at 11:53 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 05/12/19 11:31, Dmitry Vyukov wrote:
> >> Ah, and because the machine is a KVM guest, kvm_wait appears in a lot of
> >> backtrace and I get to share syzkaller's joy every time. :)
> > I don't see any mention of "kvm" in the crash report.
>
> It's there in the stack trace, not sure if this is what triggered my Cc:
>
>  [<ffffffff810c7c3a>] kvm_wait+0xca/0xe0 arch/x86/kernel/kvm.c:612
>
> Paolo


Oh, you mean the final bisection crash. Indeed it contains a kvm frame
and it turns out to be a bug in syzkaller code that indeed
misattributed it to kvm instead of netfilter.
Should be fixed now, you may read the commit message for details:
https://github.com/google/syzkaller/commit/4fb74474cf0af2126be3a8989d770c3947ae9478

Overall this "making sense out of kernel output" task is the ultimate
insanity, you may skim through this file to get a taste of amount of
hardcoding and special corner cases that need to be handled:
https://github.com/google/syzkaller/blob/master/pkg/report/linux.go
And this is never done, such "exception from exception corner case"
things pop up every week. There is always something to shuffle and
tune. It only keeps functioning due to 500+ test cases for all
possible insane kernel outputs:
https://github.com/google/syzkaller/tree/master/pkg/report/testdata/linux/report
https://github.com/google/syzkaller/tree/master/pkg/report/testdata/linux/guilty

So thanks for persisting and questioning! We are getting better with
each new test.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 11:27             ` Dmitry Vyukov
@ 2019-12-05 11:29               ` Paolo Bonzini
  0 siblings, 0 replies; 13+ messages in thread
From: Paolo Bonzini @ 2019-12-05 11:29 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: syzbot, Andrey Ryabinin, Bartlomiej Zolnierkiewicz,
	Daniel Thompson, Daniel Vetter, DRI, ghalat, Gleb Natapov,
	gwshan, H. Peter Anvin, James Morris, kasan-dev, KVM list,
	Linux Fbdev development list, LKML, linux-security-module,
	Maarten Lankhorst, Ingo Molnar, Michael Ellerman, Tetsuo Handa,
	Russell Currey, Sam Ravnborg, Serge E. Hallyn, stewart,
	syzkaller-bugs, Kentaro Takeda, Thomas Gleixner,
	the arch/x86 maintainers

On 05/12/19 12:27, Dmitry Vyukov wrote:
> Oh, you mean the final bisection crash. Indeed it contains a kvm frame
> and it turns out to be a bug in syzkaller code that indeed
> misattributed it to kvm instead of netfilter.
> Should be fixed now, you may read the commit message for details:
> https://github.com/google/syzkaller/commit/4fb74474cf0af2126be3a8989d770c3947ae9478
> 
> Overall this "making sense out of kernel output" task is the ultimate
> insanity, you may skim through this file to get a taste of amount of
> hardcoding and special corner cases that need to be handled:
> https://github.com/google/syzkaller/blob/master/pkg/report/linux.go
> And this is never done, such "exception from exception corner case"
> things pop up every week. There is always something to shuffle and
> tune. It only keeps functioning due to 500+ test cases for all
> possible insane kernel outputs:
> https://github.com/google/syzkaller/tree/master/pkg/report/testdata/linux/report
> https://github.com/google/syzkaller/tree/master/pkg/report/testdata/linux/guilty
> 
> So thanks for persisting and questioning! We are getting better with
> each new test.

Thanks to you!  I "complain" because I know you're so responsive. :)

Paolo


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 10:41         ` Tetsuo Handa
@ 2019-12-05 11:35           ` Dmitry Vyukov
  2019-12-05 11:36           ` Dmitry Vyukov
  1 sibling, 0 replies; 13+ messages in thread
From: Dmitry Vyukov @ 2019-12-05 11:35 UTC (permalink / raw)
  To: Tetsuo Handa
  Cc: Paolo Bonzini, syzbot, Andrey Ryabinin,
	Bartlomiej Zolnierkiewicz, Daniel Thompson, Daniel Vetter, DRI,
	ghalat, Gleb Natapov, gwshan, H. Peter Anvin, James Morris,
	kasan-dev, KVM list, Linux Fbdev development list, LKML,
	linux-security-module, Maarten Lankhorst, Ingo Molnar,
	Michael Ellerman, Russell Currey, Sam Ravnborg, Serge E. Hallyn,
	stewart, syzkaller-bugs, Kentaro Takeda, Thomas Gleixner,
	the arch/x86 maintainers

On Thu, Dec 5, 2019 at 11:41 AM Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> On 2019/12/05 19:22, Paolo Bonzini wrote:
> > Ah, and because the machine is a KVM guest, kvm_wait appears in a lot of
> > backtrace and I get to share syzkaller's joy every time. :)
> >
> > This bisect result is bogus, though Tetsuo found the bug anyway.
> > Perhaps you can exclude commits that only touch architectures other than
> > x86?
> >
>
> It would be nice if coverage functionality can extract filenames in the source
> code and supply the list of filenames as arguments for bisect operation.

What is the criteria for file name extraction? What will bisect
operation do with the set of files?
If you have a feature/improvement request, please file it at:
https://github.com/google/syzkaller/issues/new

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: KASAN: slab-out-of-bounds Read in fbcon_get_font
  2019-12-05 10:41         ` Tetsuo Handa
  2019-12-05 11:35           ` Dmitry Vyukov
@ 2019-12-05 11:36           ` Dmitry Vyukov
  1 sibling, 0 replies; 13+ messages in thread
From: Dmitry Vyukov @ 2019-12-05 11:36 UTC (permalink / raw)
  To: Tetsuo Handa
  Cc: Paolo Bonzini, syzbot, Andrey Ryabinin,
	Bartlomiej Zolnierkiewicz, Daniel Thompson, Daniel Vetter, DRI,
	ghalat, Gleb Natapov, gwshan, H. Peter Anvin, James Morris,
	kasan-dev, KVM list, Linux Fbdev development list, LKML,
	linux-security-module, Maarten Lankhorst, Ingo Molnar,
	Michael Ellerman, Russell Currey, Sam Ravnborg, Serge E. Hallyn,
	stewart, syzkaller-bugs, Kentaro Takeda, Thomas Gleixner,
	the arch/x86 maintainers

On Thu, Dec 5, 2019 at 11:41 AM Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> On 2019/12/05 19:22, Paolo Bonzini wrote:
> > Ah, and because the machine is a KVM guest, kvm_wait appears in a lot of
> > backtrace and I get to share syzkaller's joy every time. :)
> >
> > This bisect result is bogus, though Tetsuo found the bug anyway.
> > Perhaps you can exclude commits that only touch architectures other than
> > x86?
> >
>
> It would be nice if coverage functionality can extract filenames in the source
> code and supply the list of filenames as arguments for bisect operation.
>
> Also, (unrelated but) it would be nice if we can have "make yes2modconfig"
> target which converts CONFIG_FOO=y to CONFIG_FOO=m if FOO is tristate.
> syzbot is testing kernel configs close to "make allyesconfig" but I want to
> save kernel rebuild time by disabling unrelated functionality when manually
> "debug printk()ing" kernels.

I thought that maybe sed "s#=y#=m#g" && make olddefconfig will do, but
unfortunately, it turns off non-tristate configs...

$ egrep "CONFIG_MEMORY_HOTPLUG|CONFIG_TCP_CONG_DCTCP" .config
CONFIG_MEMORY_HOTPLUG=y
CONFIG_TCP_CONG_DCTCP=y
# sed -i "s/CONFIG_MEMORY_HOTPLUG=y/CONFIG_MEMORY_HOTPLUG=m/g" .config
# sed -i "s/CONFIG_TCP_CONG_DCTCP=y/CONFIG_TCP_CONG_DCTCP=m/g" .config
# egrep "CONFIG_MEMORY_HOTPLUG|CONFIG_TCP_CONG_DCTCP" .config
CONFIG_MEMORY_HOTPLUG=m
CONFIG_TCP_CONG_DCTCP=m
# make olddefconfig
# egrep "CONFIG_MEMORY_HOTPLUG|CONFIG_TCP_CONG_DCTCP" .config
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_TCP_CONG_DCTCP=m

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-12-05 11:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0000000000002cfc3a0598d42b70@google.com>
2019-12-04 21:41 ` KASAN: slab-out-of-bounds Read in fbcon_get_font syzbot
2019-12-05  1:59   ` Tetsuo Handa
2019-12-05 10:13   ` Paolo Bonzini
2019-12-05 10:16     ` Dmitry Vyukov
2019-12-05 10:22       ` Paolo Bonzini
2019-12-05 10:31         ` Dmitry Vyukov
2019-12-05 10:53           ` Paolo Bonzini
2019-12-05 11:27             ` Dmitry Vyukov
2019-12-05 11:29               ` Paolo Bonzini
2019-12-05 10:41         ` Tetsuo Handa
2019-12-05 11:35           ` Dmitry Vyukov
2019-12-05 11:36           ` Dmitry Vyukov
2019-12-05 10:30       ` Tetsuo Handa

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).