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

KOSAKI Motohiro
2008-11-30T05:21:02Z

Hi

> Hello, Kosaki-san:
>
> Thanks for looking at this. I think you mean that:
>
> 1) don't allow MCL_INHERIT | MCL_RECURSIVE without either MCL_CURRENT or
> MCL_FUTURE, and
>
> 2) MCL_RECURSIVE without MCL_INHERIT does not make sense, either.
>
> Is this correct?

Yup. you describe just my opnion.
thanks.

> I guess I agree with you. As is stands, my patch would allow
> MCL_INHERIT[|MCL_RECURSIVE] to sneak through with neither MCL_CURRENT
> nor MCL_FUTURE set. Looks like this would result in mlock_fixup() being
> called with a newflags that does not containing VM_LOCKED. This would
> be treated as munlockall(). Not good. Your first check would catch
> this.
>
> The second condition would be a no-op, I think. We only look at look
> for MCL_RECURSIVE in mm->mcl_inherit when mcl_inherit is non-zero; and
> we only set mcl_inherit when MCL_INHERIT is specified. But, if the
> caller specified MCL_RECURSIVE, they probably intended something to
> happen, and since it won't, best to return an error.
>
> I'll fix this up and send it out to the wider distribution that Andrew
> requested.
>
> Thanks, again.

I am one of most appointee from this patch :)