WARNING: refcount bug in find_key_to_update

Tetsuo Handa penguin-kernel at I-love.SAKURA.ne.jp
Fri Oct 18 10:54:07 UTC 2019

On 2019/10/18 1:00, Eric Biggers wrote:
> The key is supposed to have refcount >= 1 since it's in a keyring.
> So some bug is causing it to have refcount 0.  Perhaps some place calling
> key_put() too many times.
> Unfortunately I can't get the reproducer to work locally.
> Note that there are 2 other syzbot reports that look related.
> No reproducers for them, though:
> Title:              KASAN: use-after-free Read in key_put
> Last occurred:      1 day ago
> Reported:           28 days ago
> Branches:           Mainline
> Dashboard link:     https://syzkaller.appspot.com/bug?id=f13750b1124e01191250cf930086dcc40740fa30
> Original thread:    https://lore.kernel.org/lkml/0000000000008c3e590592cf4b7f@google.com/T/#u
> Title:              KASAN: use-after-free Read in keyring_compare_object
> Last occurred:      49 days ago
> Reported:           84 days ago
> Branches:           Mainline
> Dashboard link:     https://syzkaller.appspot.com/bug?id=529ab6a98286c2a97c445988a62760a58d4a1d4b
> Original thread:    https://lore.kernel.org/lkml/000000000000038ef6058e6f3592@google.com/T/#u

I don't know about keys, but I rather suspect lack of serialization locks between
"looking up for checking existing keys" versus "looking up for garbage collection".
Can we dump locks held by current thread when panic() is called?

More information about the Linux-security-module-archive mailing list