projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b40607f
)
[PATCH] unshare: Error if passed unsupported flags
author
Eric W. Biederman
<
[email protected]
>
Wed, 22 Mar 2006 08:07:40 +0000
(
00:07
-0800)
committer
Linus Torvalds
<
[email protected]
>
Wed, 22 Mar 2006 15:53:55 +0000
(07:53 -0800)
A bare bones trivial patch to ensure we always get -EINVAL on the
unsupported cases for sys_unshare. If this goes in before 2.6.16 it allows
us to forward compatible with future applications using sys_unshare.
Signed-off-by: Eric W. Biederman <
[email protected]
>
Cc: JANAK DESAI <
[email protected]
>
Cc: <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
kernel/fork.c
patch
|
blob
|
history
diff --git
a/kernel/fork.c
b/kernel/fork.c
index b373322ca4977a632bed40a38de125e9db482228..9bd7b65ee418b8a05498d3cd8b89c53dcb66e6fc 100644
(file)
--- a/
kernel/fork.c
+++ b/
kernel/fork.c
@@
-1534,6
+1534,12
@@
asmlinkage long sys_unshare(unsigned long unshare_flags)
check_unshare_flags(&unshare_flags);
+ /* Return -EINVAL for all unsupported flags */
+ err = -EINVAL;
+ if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND|
+ CLONE_VM|CLONE_FILES|CLONE_SYSVSEM))
+ goto bad_unshare_out;
+
if ((err = unshare_thread(unshare_flags)))
goto bad_unshare_out;
if ((err = unshare_fs(unshare_flags, &new_fs)))