git: 4385147547d9 - main - linux(4): Return ENOSYS for unsupported clone3 option bits.
Dmitry Chagin
dchagin at FreeBSD.org
Thu Aug 12 08:57:27 UTC 2021
The branch main has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=4385147547d9f2f8b93f08012c0a18aa6d895403
commit 4385147547d9f2f8b93f08012c0a18aa6d895403
Author: Dmitry Chagin <dchagin at FreeBSD.org>
AuthorDate: 2021-08-12 08:56:36 +0000
Commit: Dmitry Chagin <dchagin at FreeBSD.org>
CommitDate: 2021-08-12 08:56:36 +0000
linux(4): Return ENOSYS for unsupported clone3 option bits.
Differential Revision: https://reviews.freebsd.org/D31483
MFC after: 2 weeks
---
sys/compat/linux/linux_fork.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c
index 77dd8446c588..ba169ff98923 100644
--- a/sys/compat/linux/linux_fork.c
+++ b/sys/compat/linux/linux_fork.c
@@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
#include <compat/linux/linux_emul.h>
#include <compat/linux/linux_fork.h>
#include <compat/linux/linux_futex.h>
+#include <compat/linux/linux_mib.h>
#include <compat/linux/linux_misc.h>
#include <compat/linux/linux_util.h>
@@ -411,6 +412,20 @@ linux_clone3_args_valid(struct l_user_clone_args *uca)
if (uca->stack != 0 && uca->stack_size == 0)
return (EINVAL);
+ /* Verify that no unsupported flags are passed along. */
+ if ((uca->flags & LINUX_CLONE_NEWTIME) != 0) {
+ LINUX_RATELIMIT_MSG("unsupported clone3 option CLONE_NEWTIME");
+ return (ENOSYS);
+ }
+ if ((uca->flags & LINUX_CLONE_INTO_CGROUP) != 0) {
+ LINUX_RATELIMIT_MSG("unsupported clone3 option CLONE_INTO_CGROUP");
+ return (ENOSYS);
+ }
+ if (uca->set_tid != 0 || uca->set_tid_size != 0) {
+ LINUX_RATELIMIT_MSG("unsupported clone3 set_tid");
+ return (ENOSYS);
+ }
+
return (0);
}
More information about the dev-commits-src-main
mailing list