]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
lio_listio: Don't post a completion notification if none was requested
authorMark Johnston <markj@FreeBSD.org>
Fri, 16 Jul 2021 02:38:46 +0000 (22:38 -0400)
committerMark Johnston <markj@FreeBSD.org>
Fri, 30 Jul 2021 00:32:58 +0000 (20:32 -0400)
commit9ac0aec3a32c84599cfbcc9f70ca2e035a3ddc0b
treeeda7cc6dcd5423800854c823e2cf98b5a5d8d925
parent24c558ca3c04e23681ddefe13d0cd5f98bba9fac
lio_listio: Don't post a completion notification if none was requested

One is allowed to use LIO_NOWAIT without specifying a sigevent.  In this
case, lj->lioj_signal is left uninitialized, but several code paths
examine liov_signal.sigev_notify to figure out which notification to
post.  Unconditionally initialize that field to SIGEV_NONE.

Add a dumb test case which triggers the bug.

Reported by: KMSAN+syzkaller
Reviewed by: asomers
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 2e5f6152952e4cfbaab3d96368c3dc4218786632)
sys/kern/vfs_aio.c
tests/sys/aio/lio_test.c