This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] binfmt_misc: pass binfmt_misc P flag to the interpreter
- From: YunQiang Su <syq at debian dot org>
- To: Laurent Vivier <laurent at vivier dot eu>
- Cc: Florian Weimer <fw at deneb dot enyo dot de>, torvalds at linux-foundation dot org, Greg KH <gregkh at linuxfoundation dot org>, akpm at linux-foundation dot org, Al Viro <viro at zeniv dot linux dot org dot uk>, James Bottomley <James dot Bottomley at hansenpartnership dot com>, linux-kernel at vger dot kernel dot org, linux-fsdevel at vger dot kernel dot org, linux-arch at vger dot kernel dot org, linux-api at vger dot kernel dot org, libc-alpha at sourceware dot org
- Date: Fri, 6 Mar 2020 19:29:57 +0800
- Subject: Re: [PATCH] binfmt_misc: pass binfmt_misc P flag to the interpreter
- References: <20200306080905.173466-1-syq@debian.org> <87r1y53npd.fsf@mid.deneb.enyo.de> <8441f497-61eb-5c14-bf1e-c90a464105a7@vivier.eu> <87mu8t3mlw.fsf@mid.deneb.enyo.de> <40da389d-4e74-2644-2e7c-04d988fcc26f@vivier.eu>
Laurent Vivier <laurent@vivier.eu> 于2020年3月6日周五 下午7:13写道:
>
> Le 06/03/2020 à 09:37, Florian Weimer a écrit :
> > * Laurent Vivier:
> >
> >> Le 06/03/2020 à 09:13, Florian Weimer a écrit :
> >>> * YunQiang Su:
> >>>
> >>>> + if (bprm->interp_flags & BINPRM_FLAGS_PRESERVE_ARGV0)
> >>>> + flags |= AT_FLAGS_PRESERVE_ARGV0;
> >>>> + NEW_AUX_ENT(AT_FLAGS, flags);
> >>>
> >>> Is it necessary to reuse AT_FLAGS? I think it's cleaner to define a
> >>> separate AT_ tag dedicated to binfmt_misc.
> >>
> >> Not necessary, but it seemed simpler and cleaner to re-use a flag that
> >> is marked as unused and with a name matching the new role. It avoids to
> >> patch other packages (like glibc) to add it as it is already defined.
> >
> > You still need to define AT_FLAGS_PRESERVE_ARGV0. At that point, you
> > might as well define AT_BINFMT and AT_BINFMT_PRESERVE_ARGV0.
> >
>
> Yes, you're right.
>
> But is there any reason to not reuse AT_FLAGS?
AT_* only has 32 slot and now. I was afraid that maybe we shouldn't take one.
/* AT_* values 18 through 22 are reserved */
27,28,29,30 are not used now.
Which should we use?
>
> Thanks,
> Laurent