Skip to contentSkip to conversation

KASAN: use-after-free Write in config_item_get

DISCUSSION Greg KH 1 participant 1 message May 11, 2020 1 message not in the archive

lore
Share & tools
lore

Greg KH

author
#1 lore raw
In reply to a message not in the archive
Quoted 6 lines · Kyungtae Kim

We report a bug (in linux-5.6.8) found by FuzzUSB (a modified version of syzkaller)

kernel config: https://kt0755.github.io/etc/config_v5.6.8

Quoted 8 lines

This bug happened when accessing a configfs_item instance right after being deallocated.
Specifically, config_item_get() tries to access ci_kref element in a config_item instance. But this led to memory access violation because that instance (held by a fsg_opts structure) had been freed by fsg_free_inst() in another thread (PID: 2603).

To fix, it needs to check if the config_item instance is still in use when trying to deallocate it.

Great, can you create a patch to fix this now that you have a solid test for it?

thanks,

greg k-h