From: Florian Weimer Subject: Re: [PATCH] binfmt_misc: pass binfmt_misc P flag to the interpreter Date: Fri, 06 Mar 2020 09:37:31 +0100 Message-ID: <87mu8t3mlw.fsf@mid.deneb.enyo.de> References: <20200306080905.173466-1-syq@debian.org> <87r1y53npd.fsf@mid.deneb.enyo.de> <8441f497-61eb-5c14-bf1e-c90a464105a7@vivier.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: <8441f497-61eb-5c14-bf1e-c90a464105a7@vivier.eu> (Laurent Vivier's message of "Fri, 6 Mar 2020 09:21:46 +0100") Sender: linux-kernel-owner@vger.kernel.org To: Laurent Vivier Cc: YunQiang Su , torvalds@linux-foundation.org, gregkh@linuxfoundation.org, akpm@linux-foundation.org, viro@zeniv.linux.org.uk, James.Bottomley@hansenpartnership.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, libc-alpha@sourceware.org List-Id: linux-arch.vger.kernel.org * 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.