Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1375606 > unrolled thread

x86: bad pte in pageattr_test

Started byDmitry Vyukov <dvyukov@google.com>
First post2016-04-11 10:30 +0200
Last post2016-04-11 11:50 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  x86: bad pte in pageattr_test Dmitry Vyukov <dvyukov@google.com> - 2016-04-11 10:30 +0200
    Re: x86: bad pte in pageattr_test Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-04-11 11:00 +0200
      Re: x86: bad pte in pageattr_test Dmitry Vyukov <dvyukov@google.com> - 2016-04-11 11:10 +0200
        Re: x86: bad pte in pageattr_test Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-04-11 11:40 +0200
          Re: x86: bad pte in pageattr_test Dmitry Vyukov <dvyukov@google.com> - 2016-04-11 11:50 +0200

#1375606 — x86: bad pte in pageattr_test

FromDmitry Vyukov <dvyukov@google.com>
Date2016-04-11 10:30 +0200
Subjectx86: bad pte in pageattr_test
Message-ID<rmFon-2Ng-31@gated-at.bofh.it>
Hello,

I've got the following WARNING while running syzkaller fuzzer:

CPA ffff880054118000: bad pte after revert 8000000054118363
------------[ cut here ]------------
WARNING: CPU: 2 PID: 1503 at arch/x86/mm/pageattr-test.c:226
pageattr_test+0xa6c/0xd10
NOT PASSED. Please report.
Modules linked in:
CPU: 2 PID: 1503 Comm: pageattr-test Not tainted 4.6.0-rc2+ #346
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
 ffffffff87eb25c0 ffff88003b627a70 ffffffff82c8b17f ffffffff81490b58
 fffffbfff0fd64b8 ffff88003b627ae8 0000000000000000 ffffffff86a77e00
 ffffffff8129487c 0000000000000009 ffff88003b627ab8 ffffffff8136639f
Call Trace:
 [<     inline     >] __dump_stack lib/dump_stack.c:15
 [<ffffffff82c8b17f>] dump_stack+0x12e/0x18f lib/dump_stack.c:51
 [<ffffffff8136639f>] __warn+0x19f/0x1e0 kernel/panic.c:512
 [<ffffffff8136648c>] warn_slowpath_fmt+0xac/0xd0 kernel/panic.c:527
 [<ffffffff8129487c>] pageattr_test+0xa6c/0xd10 arch/x86/mm/pageattr-test.c:226
 [<ffffffff81294b3b>] do_pageattr_test+0x1b/0x60 arch/x86/mm/pageattr-test.c:240
 [<ffffffff813cde7f>] kthread+0x23f/0x2d0 drivers/block/aoe/aoecmd.c:1303
 [<ffffffff867b6252>] ret_from_fork+0x22/0x50 arch/x86/entry/entry_64.S:392
---[ end trace e669a8d69b836be8 ]---

Unfortunately it is not reproducible, tried bumping checking frequency to 1.

On commit 541d8f4d59d79f5d37c8c726f723d42ff307db57 (Apr 5).

For the repcord, full syzkaller log:
https://gist.githubusercontent.com/dvyukov/323ff7275c5ac38156cb40caeacac057/raw/0836f8dd81024e441f81caebdcb73ca1221aef97/gistfile1.txt

[toc] | [next] | [standalone]


#1375639

FromAndrey Ryabinin <ryabinin.a.a@gmail.com>
Date2016-04-11 11:00 +0200
Message-ID<rmFRp-2Ze-21@gated-at.bofh.it>
In reply to#1375606

On 04/11/2016 11:28 AM, Dmitry Vyukov wrote:
> Hello,
> 
> I've got the following WARNING while running syzkaller fuzzer:
> 
> CPA ffff880054118000: bad pte after revert 8000000054118363
> ------------[ cut here ]------------
> WARNING: CPU: 2 PID: 1503 at arch/x86/mm/pageattr-test.c:226
> pageattr_test+0xa6c/0xd10
> NOT PASSED. Please report.
> Modules linked in:
> CPU: 2 PID: 1503 Comm: pageattr-test Not tainted 4.6.0-rc2+ #346
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
>  ffffffff87eb25c0 ffff88003b627a70 ffffffff82c8b17f ffffffff81490b58
>  fffffbfff0fd64b8 ffff88003b627ae8 0000000000000000 ffffffff86a77e00
>  ffffffff8129487c 0000000000000009 ffff88003b627ab8 ffffffff8136639f
> Call Trace:
>  [<     inline     >] __dump_stack lib/dump_stack.c:15
>  [<ffffffff82c8b17f>] dump_stack+0x12e/0x18f lib/dump_stack.c:51
>  [<ffffffff8136639f>] __warn+0x19f/0x1e0 kernel/panic.c:512
>  [<ffffffff8136648c>] warn_slowpath_fmt+0xac/0xd0 kernel/panic.c:527
>  [<ffffffff8129487c>] pageattr_test+0xa6c/0xd10 arch/x86/mm/pageattr-test.c:226
>  [<ffffffff81294b3b>] do_pageattr_test+0x1b/0x60 arch/x86/mm/pageattr-test.c:240
>  [<ffffffff813cde7f>] kthread+0x23f/0x2d0 drivers/block/aoe/aoecmd.c:1303

It seems, that your script is buggy. It should be kthread() from kernel/kthread.c here.


>  [<ffffffff867b6252>] ret_from_fork+0x22/0x50 arch/x86/entry/entry_64.S:392
> ---[ end trace e669a8d69b836be8 ]---
> 
> Unfortunately it is not reproducible, tried bumping checking frequency to 1.
> 
> On commit 541d8f4d59d79f5d37c8c726f723d42ff307db57 (Apr 5).
> 
> For the repcord, full syzkaller log:
> https://gist.githubusercontent.com/dvyukov/323ff7275c5ac38156cb40caeacac057/raw/0836f8dd81024e441f81caebdcb73ca1221aef97/gistfile1.txt
> 

[toc] | [prev] | [next] | [standalone]


#1375644

FromDmitry Vyukov <dvyukov@google.com>
Date2016-04-11 11:10 +0200
Message-ID<rmG14-3kL-3@gated-at.bofh.it>
In reply to#1375639
On Mon, Apr 11, 2016 at 10:52 AM, Andrey Ryabinin
<ryabinin.a.a@gmail.com> wrote:
>
>
> On 04/11/2016 11:28 AM, Dmitry Vyukov wrote:
>> Hello,
>>
>> I've got the following WARNING while running syzkaller fuzzer:
>>
>> CPA ffff880054118000: bad pte after revert 8000000054118363
>> ------------[ cut here ]------------
>> WARNING: CPU: 2 PID: 1503 at arch/x86/mm/pageattr-test.c:226
>> pageattr_test+0xa6c/0xd10
>> NOT PASSED. Please report.
>> Modules linked in:
>> CPU: 2 PID: 1503 Comm: pageattr-test Not tainted 4.6.0-rc2+ #346
>> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
>>  ffffffff87eb25c0 ffff88003b627a70 ffffffff82c8b17f ffffffff81490b58
>>  fffffbfff0fd64b8 ffff88003b627ae8 0000000000000000 ffffffff86a77e00
>>  ffffffff8129487c 0000000000000009 ffff88003b627ab8 ffffffff8136639f
>> Call Trace:
>>  [<     inline     >] __dump_stack lib/dump_stack.c:15
>>  [<ffffffff82c8b17f>] dump_stack+0x12e/0x18f lib/dump_stack.c:51
>>  [<ffffffff8136639f>] __warn+0x19f/0x1e0 kernel/panic.c:512
>>  [<ffffffff8136648c>] warn_slowpath_fmt+0xac/0xd0 kernel/panic.c:527
>>  [<ffffffff8129487c>] pageattr_test+0xa6c/0xd10 arch/x86/mm/pageattr-test.c:226
>>  [<ffffffff81294b3b>] do_pageattr_test+0x1b/0x60 arch/x86/mm/pageattr-test.c:240
>>  [<ffffffff813cde7f>] kthread+0x23f/0x2d0 drivers/block/aoe/aoecmd.c:1303
>
> It seems, that your script is buggy. It should be kthread() from kernel/kthread.c here.


I probably used a non-matching vmlinux for symbolization.  Please
check the raw report below if the symbolized one does not make sense.

\/\/\/\/\/\/\/\/

>> For the repcord, full syzkaller log:
>> https://gist.githubusercontent.com/dvyukov/323ff7275c5ac38156cb40caeacac057/raw/0836f8dd81024e441f81caebdcb73ca1221aef97/gistfile1.txt

[toc] | [prev] | [next] | [standalone]


#1375658

FromAndrey Ryabinin <ryabinin.a.a@gmail.com>
Date2016-04-11 11:40 +0200
Message-ID<rmGu7-3xh-25@gated-at.bofh.it>
In reply to#1375644

On 04/11/2016 12:03 PM, Dmitry Vyukov wrote:
> On Mon, Apr 11, 2016 at 10:52 AM, Andrey Ryabinin
> <ryabinin.a.a@gmail.com> wrote:
>>
>>
>> On 04/11/2016 11:28 AM, Dmitry Vyukov wrote:
>>> Hello,
>>>
>>> I've got the following WARNING while running syzkaller fuzzer:
>>>
>>> CPA ffff880054118000: bad pte after revert 8000000054118363
>>> ------------[ cut here ]------------
>>> WARNING: CPU: 2 PID: 1503 at arch/x86/mm/pageattr-test.c:226
>>> pageattr_test+0xa6c/0xd10
>>> NOT PASSED. Please report.
>>> Modules linked in:
>>> CPU: 2 PID: 1503 Comm: pageattr-test Not tainted 4.6.0-rc2+ #346
>>> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
>>>  ffffffff87eb25c0 ffff88003b627a70 ffffffff82c8b17f ffffffff81490b58
>>>  fffffbfff0fd64b8 ffff88003b627ae8 0000000000000000 ffffffff86a77e00
>>>  ffffffff8129487c 0000000000000009 ffff88003b627ab8 ffffffff8136639f
>>> Call Trace:
>>>  [<     inline     >] __dump_stack lib/dump_stack.c:15
>>>  [<ffffffff82c8b17f>] dump_stack+0x12e/0x18f lib/dump_stack.c:51
>>>  [<ffffffff8136639f>] __warn+0x19f/0x1e0 kernel/panic.c:512
>>>  [<ffffffff8136648c>] warn_slowpath_fmt+0xac/0xd0 kernel/panic.c:527
>>>  [<ffffffff8129487c>] pageattr_test+0xa6c/0xd10 arch/x86/mm/pageattr-test.c:226
>>>  [<ffffffff81294b3b>] do_pageattr_test+0x1b/0x60 arch/x86/mm/pageattr-test.c:240
>>>  [<ffffffff813cde7f>] kthread+0x23f/0x2d0 drivers/block/aoe/aoecmd.c:1303
>>
>> It seems, that your script is buggy. It should be kthread() from kernel/kthread.c here.
> 
> 
> I probably used a non-matching vmlinux for symbolization. 

No, it's a bug in your script. To find out source location, it uses 'function_name + offset' instead of absolute address.
We have 2 kthread() functions in kernel and this confuses you script.


E.g. my vmlinux :
 $ addr2line -i -e vmlinux ffffffff811b5290
	/home/andrew/linux/kernel/kthread.c:178
 $ addr2line -i -e kasan_conf/vmlinux ffffffff825c7240
	/home/andrew/linux/drivers/block/aoe/aoecmd.c:1289


 $ echo '[<ffffffff811b5290>] kthread+0x00/0x00' | python kasan_symbolize.py vmlinux
	[<ffffffff811b5290>] kthread+0x00/0x00 drivers/block/aoe/aoecmd.c:462
 $ echo '[<ffffffff825c7240>] kthread+0x00/0x00' | python kasan_symbolize.py vmlinux
	[<ffffffff825c7240>] kthread+0x00/0x00 drivers/block/aoe/aoecmd.c:462

> Please
> check the raw report below if the symbolized one does not make sense.
> 
> \/\/\/\/\/\/\/\/
> 
>>> For the repcord, full syzkaller log:
>>> https://gist.githubusercontent.com/dvyukov/323ff7275c5ac38156cb40caeacac057/raw/0836f8dd81024e441f81caebdcb73ca1221aef97/gistfile1.txt

[toc] | [prev] | [next] | [standalone]


#1375661

FromDmitry Vyukov <dvyukov@google.com>
Date2016-04-11 11:50 +0200
Message-ID<rmGDM-3Br-3@gated-at.bofh.it>
In reply to#1375658
On Mon, Apr 11, 2016 at 11:32 AM, Andrey Ryabinin
<ryabinin.a.a@gmail.com> wrote:
>
>
> On 04/11/2016 12:03 PM, Dmitry Vyukov wrote:
>> On Mon, Apr 11, 2016 at 10:52 AM, Andrey Ryabinin
>> <ryabinin.a.a@gmail.com> wrote:
>>>
>>>
>>> On 04/11/2016 11:28 AM, Dmitry Vyukov wrote:
>>>> Hello,
>>>>
>>>> I've got the following WARNING while running syzkaller fuzzer:
>>>>
>>>> CPA ffff880054118000: bad pte after revert 8000000054118363
>>>> ------------[ cut here ]------------
>>>> WARNING: CPU: 2 PID: 1503 at arch/x86/mm/pageattr-test.c:226
>>>> pageattr_test+0xa6c/0xd10
>>>> NOT PASSED. Please report.
>>>> Modules linked in:
>>>> CPU: 2 PID: 1503 Comm: pageattr-test Not tainted 4.6.0-rc2+ #346
>>>> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
>>>>  ffffffff87eb25c0 ffff88003b627a70 ffffffff82c8b17f ffffffff81490b58
>>>>  fffffbfff0fd64b8 ffff88003b627ae8 0000000000000000 ffffffff86a77e00
>>>>  ffffffff8129487c 0000000000000009 ffff88003b627ab8 ffffffff8136639f
>>>> Call Trace:
>>>>  [<     inline     >] __dump_stack lib/dump_stack.c:15
>>>>  [<ffffffff82c8b17f>] dump_stack+0x12e/0x18f lib/dump_stack.c:51
>>>>  [<ffffffff8136639f>] __warn+0x19f/0x1e0 kernel/panic.c:512
>>>>  [<ffffffff8136648c>] warn_slowpath_fmt+0xac/0xd0 kernel/panic.c:527
>>>>  [<ffffffff8129487c>] pageattr_test+0xa6c/0xd10 arch/x86/mm/pageattr-test.c:226
>>>>  [<ffffffff81294b3b>] do_pageattr_test+0x1b/0x60 arch/x86/mm/pageattr-test.c:240
>>>>  [<ffffffff813cde7f>] kthread+0x23f/0x2d0 drivers/block/aoe/aoecmd.c:1303
>>>
>>> It seems, that your script is buggy. It should be kthread() from kernel/kthread.c here.
>>
>>
>> I probably used a non-matching vmlinux for symbolization.
>
> No, it's a bug in your script. To find out source location, it uses 'function_name + offset' instead of absolute address.
> We have 2 kthread() functions in kernel and this confuses you script.
>
>
> E.g. my vmlinux :
>  $ addr2line -i -e vmlinux ffffffff811b5290
>         /home/andrew/linux/kernel/kthread.c:178
>  $ addr2line -i -e kasan_conf/vmlinux ffffffff825c7240
>         /home/andrew/linux/drivers/block/aoe/aoecmd.c:1289
>
>
>  $ echo '[<ffffffff811b5290>] kthread+0x00/0x00' | python kasan_symbolize.py vmlinux
>         [<ffffffff811b5290>] kthread+0x00/0x00 drivers/block/aoe/aoecmd.c:462
>  $ echo '[<ffffffff825c7240>] kthread+0x00/0x00' | python kasan_symbolize.py vmlinux
>         [<ffffffff825c7240>] kthread+0x00/0x00 drivers/block/aoe/aoecmd.c:462


Agree. Filed https://github.com/google/sanitizers/issues/668
Thanks!

>> Please
>> check the raw report below if the symbolized one does not make sense.
>>
>> \/\/\/\/\/\/\/\/
>>
>>>> For the repcord, full syzkaller log:
>>>> https://gist.githubusercontent.com/dvyukov/323ff7275c5ac38156cb40caeacac057/raw/0836f8dd81024e441f81caebdcb73ca1221aef97/gistfile1.txt

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web