Summary: | compat10 semaphore interface internal race may lead to application hang | ||
---|---|---|---|
Product: | Base System | Reporter: | firk |
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | emaste, kib |
Priority: | --- | ||
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
firk
2022-08-23 04:56:23 UTC
Differential revision: https://reviews.freebsd.org/D36272 A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=768f6373eb3d60e346d3bfa495e04315aeed8ff9 commit 768f6373eb3d60e346d3bfa495e04315aeed8ff9 Author: firk <firk@cantconnect.ru> AuthorDate: 2022-08-26 08:05:56 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-08-26 17:34:29 +0000 Fix compat10 semaphore interface race Wrong has-waiters and missing unconditional _count==0 check may cause infinite waiting with already non-zero count. 1) properly clear _has_waiters flag when waiting failed to start 2) always check _count before start waiting PR: 265997 Reviewed by: kib MFC after: 1 week Differential revision: https://reviews.freebsd.org/D36272 sys/kern/kern_umtx.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7e8fa3c9a2102cff1a76cc74c4c739e039c59d23 commit 7e8fa3c9a2102cff1a76cc74c4c739e039c59d23 Author: firk <firk@cantconnect.ru> AuthorDate: 2022-08-26 08:05:56 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-08-31 01:20:29 +0000 Fix compat10 semaphore interface race PR: 265997 (cherry picked from commit 768f6373eb3d60e346d3bfa495e04315aeed8ff9) sys/kern/kern_umtx.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3e39cbb10e0d4cf9db17ac38a0cca39aa3c5e403 commit 3e39cbb10e0d4cf9db17ac38a0cca39aa3c5e403 Author: firk <firk@cantconnect.ru> AuthorDate: 2022-08-26 08:05:56 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-08-31 01:33:38 +0000 Fix compat10 semaphore interface race PR: 265997 (cherry picked from commit 768f6373eb3d60e346d3bfa495e04315aeed8ff9) sys/kern/kern_umtx.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) |