Page MenuHomeFreeBSD

timerfd: kernel random crash due to race condition to access the timerfd list
Needs RevisionPublic

Authored by weike.chen_dell.com on Sep 26 2023, 10:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 30, 8:37 PM
Unknown Object (File)
Mon, Sep 22, 11:44 PM
Unknown Object (File)
Fri, Sep 19, 7:28 PM
Unknown Object (File)
Wed, Sep 17, 6:24 AM
Unknown Object (File)
Sun, Sep 14, 2:54 AM
Unknown Object (File)
Sat, Sep 13, 9:05 AM
Unknown Object (File)
Sep 11 2025, 11:21 PM
Unknown Object (File)
Sep 1 2025, 4:41 PM
Subscribers

Details

Reviewers
jfree
imp
Summary

Add locker while add/remove/read the timerfd list.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

https://cgit.freebsd.org/src/commit/sys/kern/sys_timerfd.c?id=02f534b57f84d6f4f97c337b05b383c8b3aaf18c

btw, do you have a reproducer? I assume that it is sufficient to use the CK_LIST without locking

https://cgit.freebsd.org/src/commit/sys/kern/sys_timerfd.c?id=02f534b57f84d6f4f97c337b05b383c8b3aaf18c

btw, do you have a reproducer? I assume that it is sufficient to use the CK_LIST without locking

^^^^^^

ah, never mind, CK is not lock free

sys/kern/sys_timerfd.c
62

where do you initialize this lock?

imp added inline comments.
sys/kern/sys_timerfd.c
62

Ah, never mind, I see that's the next line.

This revision is now accepted and ready to land.Sep 27 2023, 7:38 PM
imp requested changes to this revision.Sep 27 2023, 10:08 PM

I'm confused... this has actually already been committed.

This revision now requires changes to proceed.Sep 27 2023, 10:08 PM
In D41982#957755, @imp wrote:

I'm confused... this has actually already been committed.

Yes, I see: https://cgit.freebsd.org/src/commit/sys/kern/sys_timerfd.c?id=02f534b57f84d6f4f97c337b05b383c8b3aaf18c. But it looks like this commit hasn't been merged to releng/14.0 yet.