Re: [PATCH] - support inheritance of mlocks across fork/exec V2

KOSAKI Motohiro
2008-12-04T01:57:43Z

> @@ -600,9 +603,15 @@ asmlinkage long sys_mlockall(int flags)
> unsigned long lock_limit;
> int ret = -EINVAL;
>
> - if (!flags || (flags & ~(MCL_CURRENT | MCL_FUTURE)))
> + if (!(flags & (MCL_CURRENT | MCL_FUTURE)))
> goto out;
>
> + if (flags & ~(MCL_CURRENT | MCL_FUTURE | MCL_INHERIT | MCL_RECURSIVE))
> + goto out; /* undefined flag bits */
> +
> + if ((flags & (MCL_INHERIT | MCL_RECURSIVE)) == MCL_RECURSIVE)
> + goto out; /* 'RECURSIVE undefined without 'INHERIT */
> +
> ret = -EPERM;
> if (!can_do_mlock())
> goto out;

looks good to me.

Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>