Date: Thu, 29 Jul 2021 09:59:00 GMT From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 626cbd464814 - main - linux(4): Handle incorrect FUTEX_CLOCK_REALTIME option bit. Message-ID: <202107290959.16T9x0p0070667@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=626cbd4648141929502b953111dc8a71d550c7e8 commit 626cbd4648141929502b953111dc8a71d550c7e8 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2021-07-29 09:55:33 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2021-07-29 09:55:33 +0000 linux(4): Handle incorrect FUTEX_CLOCK_REALTIME option bit. Return ENOSYS if the FUTEX_CLOCK_REALTIME option bit is specified for an inappropriate futex operation. MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index fcac2eba4956..5f18c93b0988 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -224,6 +224,12 @@ linux_futex(struct thread *td, struct linux_futex_args *args) args->clockrt = args->op & LINUX_FUTEX_CLOCK_REALTIME; args->op = args->op & ~LINUX_FUTEX_CLOCK_REALTIME; + if (args->clockrt && + args->op != LINUX_FUTEX_WAIT_BITSET && + args->op != LINUX_FUTEX_WAIT_REQUEUE_PI && + args->op != LINUX_FUTEX_LOCK_PI2) + return (ENOSYS); + switch (args->op) { case LINUX_FUTEX_WAIT: args->val3 = FUTEX_BITSET_MATCH_ANY;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107290959.16T9x0p0070667>