Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4096720ybi; Tue, 11 Jun 2019 00:37:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCfJehapG8JwOB6cTMEJjdRCp8op2QGOHlxrc1rL5XWEX+nncKvtsRb6DXy7wv2gKK8xQ7 X-Received: by 2002:a65:624f:: with SMTP id q15mr19056829pgv.436.1560238664819; Tue, 11 Jun 2019 00:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560238664; cv=none; d=google.com; s=arc-20160816; b=zoMU8+AbXLVucsSG6BydoYliJrpIUqUeVEkyn+IgsnIOEOHszOXYNoqoRLfWvVNucr 8VE4UalXD+x2Mv2fDIn4tNRMNi6+j910CzOvWUlG+JNY0t3F5g4fc49Oe4nqXdsbptLr Q4x7Spdy0A7c21BxHmBvKPiS+tDFTwGKqQ3fch4VJL9WG5vT3OIFn+HHHSM4JimwMQ9w cEgu//JAsCg9kW+M3yYLwpL2PxnNAxnBcU20KDzB709i848BFVeG7g0g5UGqd7980PYL 5GcxrjQSv3uTgCyFakNmS85QCGufiVeSxkCfGpTj7pWMIiqCZ4egMcuBPGBHbdcu8DSY EGsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yUMfS9iVgGZM4529DzRM1aX151c1TEWkj5UgeaINe8M=; b=oN+I1QHHWjA5pJVp4uncvYaZM3pPKv4LvdhrRh3fxPGHr7Vp0Og1ZqTrER08OToNIs MCu4Gibibhv/bSB+cPTdVV75TvKtXm249SvapBaaqyL0le9uACfsKyCO8JX9fP8RwK9O V7oZHzb/SDHfhwjla6VtFb9edjSWQLcTK99+gqfxpEZV7UdYRUWYoRsDYii/Zmn6Q7El 4aEjHnWjCMhGo+ZqkLBn7Lxj42D9xar3sRVtWOkTFE2QB6iR63s5HYZ2fnZceVcJ/DbX KsDWCrFXP9Zk8zUtDZRWWWn0xVadSpwKArjN+U6r3NPAEL5tdfpVTGz9AuS1/XS3DP3E ybmw== 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 y19si11412478pgi.587.2019.06.11.00.37.29; Tue, 11 Jun 2019 00:37:44 -0700 (PDT) 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 S2404189AbfFKHhR (ORCPT + 99 others); Tue, 11 Jun 2019 03:37:17 -0400 Received: from verein.lst.de ([213.95.11.211]:48840 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404009AbfFKHhR (ORCPT ); Tue, 11 Jun 2019 03:37:17 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id ADA6868B02; Tue, 11 Jun 2019 09:36:48 +0200 (CEST) Date: Tue, 11 Jun 2019 09:36:48 +0200 From: Christoph Hellwig To: Greg Ungerer Cc: Christoph Hellwig , Michal Simek , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, uclinux-h8-devel@lists.sourceforge.jp, linux-m68k@lists.linux-m68k.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/15] binfmt_flat: remove flat_old_ram_flag Message-ID: <20190611073648.GA21522@lst.de> References: <20190610212015.9157-1-hch@lst.de> <20190610212015.9157-5-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 11, 2019 at 04:04:39PM +1000, Greg Ungerer wrote: >> index c0e4535dc1ec..18d82fd5f57c 100644 >> --- a/fs/binfmt_flat.c >> +++ b/fs/binfmt_flat.c >> @@ -488,7 +488,8 @@ static int load_flat_file(struct linux_binprm *bprm, >> * fix up the flags for the older format, there were all kinds >> * of endian hacks, this only works for the simple cases >> */ >> - if (rev == OLD_FLAT_VERSION && flat_old_ram_flag(flags)) >> + if (IS_ENABLED(CONFIG_BINFMT_FLAT_OLD_ALWAYS_RAM) && >> + rev == OLD_FLAT_VERSION) > > The flags are from the binary file header here, so this is going to lose > that check for most platforms (except h8300 where it would always have > been true). Indeed. The old code is: if (rev == OLD_FLAT_VERSION && flat_old_ram_flag(flags)) flags = FLAT_FLAG_RAM; which for !h8300 evaluates to: if (rev == OLD_FLAT_VERSION && flags) flags = FLAT_FLAG_RAM; so basically if any flag was set it was turned into FLAT_FLAG_RAM. Was that really intentional? I guess even if it wasn't the is no point in changing this historic behavior now. So I guess what we could do it something like: if (rev == OLD_FLAT_VERSION && (flags || IS_ENABLED(CONFIG_BINFMT_FLAT_OLD_ALWAYS_RAM))) flags = FLAT_FLAG_RAM;