Skip to contentSkip to conversation

Reminder: 2 open syzbot bugs in "security/tomoyo" subsystem

DISCUSSION Eric Biggers 2 participants 5 messages Jul 24, 2019 Security (LSM)

lore
Share & tools
lore
#0 lore raw

[This email was generated by a script. Let me know if you have any suggestions to make it better, or if you want it re-generated with the latest status.]

Of the currently open syzbot reports against the upstream kernel, I've manually marked 2 of them as possibly being bugs in the "security/tomoyo" subsystem. I've listed these reports below, sorted by an algorithm that tries to list first the reports most likely to be still valid, important, and actionable.

If you believe a bug is no longer valid, please close the syzbot report by sending a '#syz fix', '#syz dup', or '#syz invalid' command in reply to the original thread, as explained at https://goo.gl/tpsmEJ#status

If you believe I misattributed a bug to the "security/tomoyo" subsystem, please let me know, and if possible forward the report to the correct people or mailing list.

Here are the bugs:

--------------------------------------------------------------------------------

Title:              KASAN: use-after-free Read in tomoyo_realpath_from_path
Last occurred:      28 days ago
Reported:           48 days ago
Branches:           Mainline and others
Dashboard link:     https://syzkaller.appspot.com/bug?id=73d590010454403d55164cca23bd0565b1eb3b74
Original thread:    https://lkml.kernel.org/lkml/[email protected]/T/#u

This bug has a syzkaller reproducer only.

The original thread for this bug has received 7 replies; the last was 31 days ago.

If you fix this bug, please add the following tag to the commit:

    Reported-by: [email protected]

If you send any email or patch for this bug, please consider replying to the original thread. For the git send-email command to use, or tips on how to reply if the thread isn't in your mailbox, see the "Reply instructions" at
https://lkml.kernel.org/r/[email protected]

--------------------------------------------------------------------------------

Title:              KASAN: invalid-free in tomoyo_realpath_from_path
Last occurred:      57 days ago
Reported:           56 days ago
Branches:           net-next
Dashboard link:     https://syzkaller.appspot.com/bug?id=e9e5a1d41c3fb5d0f79aeea0e4cd535f160a6702
Original thread:    https://lkml.kernel.org/lkml/[email protected]/T/#u

Unfortunately, this bug does not have a reproducer.

The original thread for this bug has received 1 reply, 56 days ago.

If you fix this bug, please add the following tag to the commit:

Reported-by [email protected]

If you send any email or patch for this bug, please consider replying to the original thread. For the git send-email command to use, or tips on how to reply if the thread isn't in your mailbox, see the "Reply instructions" at
https://lkml.kernel.org/r/[email protected]

#1 lore raw
Quoted 7 lines · Eric Biggers

--------------------------------------------------------------------------------

Title:              KASAN: use-after-free Read in tomoyo_realpath_from_path
Last occurred:      28 days ago
Reported:           48 days ago
Branches:           Mainline and others
Dashboard link:     https://syzkaller.appspot.com/bug?id=73d590010454403d55164cca23bd0565b1eb3b74
Original thread:    https://lkml.kernel.org/lkml/[email protected]/T/#u

A patch is available, but I can't find a chance to setup my git tree for sending a pull request for the patch.

Quoted 7 lines

--------------------------------------------------------------------------------

Title:              KASAN: invalid-free in tomoyo_realpath_from_path
Last occurred:      57 days ago
Reported:           56 days ago
Branches:           net-next
Dashboard link:     https://syzkaller.appspot.com/bug?id=e9e5a1d41c3fb5d0f79aeea0e4cd535f160a6702
Original thread:    https://lkml.kernel.org/lkml/[email protected]/T/#u

This cannot be a TOMOYO's bug. We are waiting for a reproducer but no crash occurred since then. Maybe it is time to close as invalid.

#2 lore raw
Quoted 10 lines · Tetsuo Handa
Quoted 7 lines

--------------------------------------------------------------------------------

Title:              KASAN: invalid-free in tomoyo_realpath_from_path
Last occurred:      57 days ago
Reported:           56 days ago
Branches:           net-next
Dashboard link:     https://syzkaller.appspot.com/bug?id=e9e5a1d41c3fb5d0f79aeea0e4cd535f160a6702
Original thread:    https://lkml.kernel.org/lkml/[email protected]/T/#u

This cannot be a TOMOYO's bug. We are waiting for a reproducer but no crash occurred since then. Maybe it is time to close as invalid.

Maybe. Did you check for stack buffer overflows in the functions that tomoyo_realpath_from_path() calls? Perhaps something is corrupting the 'buf' variable in the parent's stack frame.

- Eric

#3 lore raw
Quoted 9 lines · Eric Biggers
Quoted 8 lines · Tetsuo Handa
Quoted 7 lines

--------------------------------------------------------------------------------

Title:              KASAN: invalid-free in tomoyo_realpath_from_path
Last occurred:      57 days ago
Reported:           56 days ago
Branches:           net-next
Dashboard link:     https://syzkaller.appspot.com/bug?id=e9e5a1d41c3fb5d0f79aeea0e4cd535f160a6702
Original thread:    https://lkml.kernel.org/lkml/[email protected]/T/#u
Quoted 7 lines
Quoted 2 lines

This cannot be a TOMOYO's bug. We are waiting for a reproducer but no crash occurred since then. Maybe it is time to close as invalid.

Maybe. Did you check for stack buffer overflows in the functions that tomoyo_realpath_from_path() calls? Perhaps something is corrupting the 'buf' variable in the parent's stack frame.

What do you mean? If this crash were a stack buffer overflow, this crash should have already occurred again.

Since the "buf" variable is a local variable, it cannot be shared between two threads. Since "buf" is assigned as

  buf = kmalloc(buf_len, GFP_NOFS);

and nobody else is reassigning "buf",

  kfree(buf);

can't become an invalid free.

#4 lore raw
Quoted 13 lines · Tetsuo Handa
Quoted 12 lines · Eric Biggers
Quoted 10 lines · Tetsuo Handa
Quoted 7 lines

--------------------------------------------------------------------------------

Title:              KASAN: invalid-free in tomoyo_realpath_from_path
Last occurred:      57 days ago
Reported:           56 days ago
Branches:           net-next
Dashboard link:     https://syzkaller.appspot.com/bug?id=e9e5a1d41c3fb5d0f79aeea0e4cd535f160a6702
Original thread:    https://lkml.kernel.org/lkml/[email protected]/T/#u

This cannot be a TOMOYO's bug. We are waiting for a reproducer but no crash occurred since then. Maybe it is time to close as invalid.

Quoted 8 lines
Quoted 4 lines

Maybe. Did you check for stack buffer overflows in the functions that tomoyo_realpath_from_path() calls? Perhaps something is corrupting the 'buf' variable in the parent's stack frame.

What do you mean? If this crash were a stack buffer overflow, this crash should have already occurred again.

Well not necessarily, it could be very rare.

That being said, it was only seen on net-next and only once; so it could have been caused by some broken patch elsewhere in the kernel that was only present for a short time.

So if you aren't going to do anything else with this, please just go ahead and invalidate it.

Quoted 11 lines

Since the "buf" variable is a local variable, it cannot be shared between two threads. Since "buf" is assigned as

  buf = kmalloc(buf_len, GFP_NOFS);

and nobody else is reassigning "buf",

  kfree(buf);

can't become an invalid free.

- Eric