Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6732110ybf; Fri, 6 Mar 2020 03:30:40 -0800 (PST) X-Google-Smtp-Source: ADFU+vvsdBjej0hXK/8rKBQyIqSKHJ9B4M98XiDPjhkdo2UcuPl6zkzunNZDAzMlA0sxDVLspaD9 X-Received: by 2002:a05:6830:1d5:: with SMTP id r21mr2180498ota.54.1583494240171; Fri, 06 Mar 2020 03:30:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583494240; cv=none; d=google.com; s=arc-20160816; b=KBAFec36Ml86KJX8uwiAvPPH7vrygqBagDqERgp7fZEpnCI4HeVTlRoh+DZ3h3A4W+ 7kXB6BwJX1WCy9cJRgBRT0E5gT6hWvv92NruFLoWsguDq+5BN5vPi3H/GPryQM84ufY2 oLfOaZYk234dIBsY9GBN3MeQb9sbin8/22u6ZsAF8Gu2B37su1M5N1LcDEvT3e+Pwdsr iDIoYBG301lhDQNKEqapF4CpFSYWSbWFBaGe7xdJOjkZQ6JgEEu3psM/LFyKmMyGEsGt T45yCur3Wk+3mqyQYvF0DdheEgBHq4k1psrt9I62ftZOBktrCgVDezzCSTsVbc5FWcIq okng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=sHkKPh1KyWt5zzYryaKR5oeNgPiDqV3jER+2FC9+Mak=; b=lHxicmooMV0UFqWmz4cASIIJalw/MQmIBTXrme3Q/KRnD9ViJgIyB7Z/NlMLRqH25K +XYmcdo1g8V6YmMszM56Dja7YivALQoYxekG1NlusO/r2LZEf2GymkTD6zFNvLNZVKzd UvNYfJbkGnqzXyGomhBt8YoujlFpUySgVqiuMehBPU8OLee6N2YTyZ8N0Wyn12R6iVim QU+XJJy0XfDpzzEsupuruoNYmOkttuPI7Zr4d/+mDHbxdMId58MUxGozTl0AUd1MUI7I E+wITQxu1JB/1G9tm/DFNYvGys06NazTMaoAS++1DsvUhOWHZk4bo20TsQtSrmI1ldQX Zb6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si1176520ota.103.2020.03.06.03.30.26; Fri, 06 Mar 2020 03:30:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726300AbgCFLaK convert rfc822-to-8bit (ORCPT + 99 others); Fri, 6 Mar 2020 06:30:10 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:44732 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726108AbgCFLaK (ORCPT ); Fri, 6 Mar 2020 06:30:10 -0500 Received: by mail-qk1-f196.google.com with SMTP id f198so1889167qke.11; Fri, 06 Mar 2020 03:30:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Nna0nsguv2U+v9ziNQRL80k09HbQlLvP1j4KtjoAo7M=; b=P7EcwBcK7dx8cF79C9pN3P6os2Z3YL6AU/wh0wx1LLH1l78jY4kiL53d5woVTM5qNl zOzIhESzoLvN1T5kdKAfTD6rEiWYYQmj+xeoVvPw7HKmTpokbVUhNvpt/vCeC++Y0PcH wHOg/i20WypsCUUFgbqe6UFtxftO/ptP3eLWTbAjYWfrB/oSVIeVXeKCRK/Mq3AiPiwG k4Z1KVUXJK31T5j3cxAUY4fkAhBuFMhJ9kQquP2yjt/XYVvIHr687XaoKLW7wJ1X81a6 3WHz4RRRyGYR3Cz2V8fxrqB+uhS0usmz1JcTQn6297qOtrPwKhMR0BC3oFg/fOhY8eh/ o9wg== X-Gm-Message-State: ANhLgQ2znZ8XFgc+mygHmuNsTYQFfSoyz/gjmjdDUHVshFUUVC/DZaxY LOX4AjZ68l09qOI7Cmd7s9HwHNWz9Jum35wfD7Q= X-Received: by 2002:a37:6646:: with SMTP id a67mr2383615qkc.457.1583494209166; Fri, 06 Mar 2020 03:30:09 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <40da389d-4e74-2644-2e7c-04d988fcc26f@vivier.eu> From: YunQiang Su Date: Fri, 6 Mar 2020 19:29:57 +0800 Message-ID: Subject: Re: [PATCH] binfmt_misc: pass binfmt_misc P flag to the interpreter To: Laurent Vivier Cc: Florian Weimer , torvalds@linux-foundation.org, Greg KH , akpm@linux-foundation.org, Al Viro , James Bottomley , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Laurent Vivier 于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