Messages in this thread | | | Date | Sat, 18 Mar 2006 10:33:42 -0500 | From | Janak Desai <> | Subject | Re: [PATCH] unshare: Error if passed unsupported flags |
| |
Thanks Eric. I had just started to do this based on Andrew's request.
-Janak
Eric W. Biederman wrote:
>This patch does 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 <ebiederm@xmission.com> > > >--- > > kernel/fork.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > >46868b4b6ebeb9042dded68a6f6301ffe06820c9 >diff --git a/kernel/fork.c b/kernel/fork.c >index 46060cb..411b10d 100644 >--- a/kernel/fork.c >+++ b/kernel/fork.c >@@ -1535,6 +1535,12 @@ asmlinkage long sys_unshare(unsigned lon > struct sem_undo_list *new_ulist = NULL; > > 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; > >
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |