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

From: KOSAKI Motohiro
Date: Wed Dec 03 2008 - 20:57:53 EST


> @@ -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@xxxxxxxxxxxxxx>



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/