From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F216C433FE for ; Fri, 15 Apr 2022 01:13:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BF5C6B0071; Thu, 14 Apr 2022 21:13:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 670446B0073; Thu, 14 Apr 2022 21:13:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50F906B0074; Thu, 14 Apr 2022 21:13:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 422D96B0071 for ; Thu, 14 Apr 2022 21:13:39 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 14445122ACF for ; Fri, 15 Apr 2022 01:13:39 +0000 (UTC) X-FDA: 79357340958.21.FF4EBA8 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 47CD4140003 for ; Fri, 15 Apr 2022 01:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1649985218; x=1681521218; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=2o3hbZhROctTrf9/YEdToCbep6cUQhIveDuZAWOBAjM=; b=DQyX/OHVwG9JWFzbIbwT8TsheJpZp93v2hnQg4p7B8GFCHDDbPqlpwkk iKBmNNJztSGihFVwhVCYOdr6yj0X5v/lWiR41Ub/7ZFT4vQ1AJFYWzHET LKFkCAGzbD+cX187uZufbYtfusqU/63EkL7Gu+GvR7Vj+4qsVmXytqO8E lfnc00WrHDZDTsFax+Tf/b0O6x2yaxettkOz7WEeoNjRZz7jwlBdmJBDt fWD/9yhfxihZXHB7TpSQ+Sv9Ac7v0Qaxg37wwxgNu9vOugKENRp1oalA8 yCol5Ap/zLnT4bo3Fjtn8oUbm3VinKVoraW9U0SYQmutiDMxhnpKZj5SF w==; X-IronPort-AV: E=Sophos;i="5.90,261,1643644800"; d="scan'208";a="302149922" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 15 Apr 2022 09:13:37 +0800 IronPort-SDR: kwIZKZUvT4dWDr61J1SIDgsv0xtHlF9RKMFg4WyXmWz7nv1Cj0QHralcUqv3Gt49RDx8AG3R6q I+7dMElHccEOqtYhVqOOE4sZYCSlJRKAzCwmGhzPY8QHR9uply+SNLn+r5kRqKIIzlQK0uPWL0 bDtVcUXiXWiQbHQc1Qzf1Xq/URT7KCk5PNeZyRjd7VQEGqYBeNQvKNT4eR5B1sa/EtOhWbgeW4 T7CXAZU7pPkKBSW7Iz4wDXjmJS82YuYrSFwJlWVJhjZ+8cTuOq0KvcazTCpVImwM9M2vX8jj0Z XKL2Ttif4Zs0mlgJI87nB0Xp Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Apr 2022 17:44:01 -0700 IronPort-SDR: y5Vln15XqhmYaRyLizGGNHeig5EKuKFtJOmYuVJcwniUPlxwBugFqjci2NKpBuxeQkQWRZpM9J EspGosA7tClAFZ4+Bd999l6j5OmO7qHvKENqm0tzE51abiHVf85BdbL8ZFq0uFugAzV1slOlAw 5EjG3O38GOSHXsbvO/JUyzuWNRrSL3UDlHfgQ1ChvLKphLfcqoAabp949IBaQ5lGaPUaOkou8I IZaNRFLC2vZaIVo6aH4+g+JVpvzrHu+WSqx+Jf9OVD5311OY9ggVUsJAkjVNVZ9gGN7Cs8Gv07 www= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Apr 2022 18:13:36 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4Kfdcv3rRrz1SVp4 for ; Thu, 14 Apr 2022 18:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1649985214; x=1652577215; bh=2o3hbZhROctTrf9/YEdToCbep6cUQhIveDu ZAWOBAjM=; b=mWJ7/209jF5f6cH7UXv/Nyw7kMvCcMKmosSacEyi84ORPLbeYJQ MtUB3jAAFeHPNpA8o+sWbphgyyUNQYB8OZ5diOrgk9B7KoXA2yecdJ4CPlqgi0zL X7gNmQToLzBFQR8a23dn9UnxA7nz1U3gm4qx6SZyK+2/dHZc0je0n5KbV/l9B2xH gK4Kfaqn7Nwu1VunDYoDJD7KwWLLKzn9IQqxk0vKWAbRtNdVl1uDlsiv/0jNo8cv xCYXVwG3tp64CBUPTC1Qyl37g2PHLfG3O0Xz5HzP+cChYa98sC49qe95xjj26W74 5xSEMLfkgGl/VvMtJsCUkoM/fpFgWzarxOA== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LjU2NOtpNDct for ; Thu, 14 Apr 2022 18:13:34 -0700 (PDT) Received: from [10.225.163.9] (unknown [10.225.163.9]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4Kfdcr4SBfz1Rvlx; Thu, 14 Apr 2022 18:13:32 -0700 (PDT) Message-ID: <9a9a4dcf-0ea1-01ac-d599-16c10b547beb@opensource.wdc.com> Date: Fri, 15 Apr 2022 10:13:31 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2] binfmt_flat: do not stop relocating GOT entries prematurely on riscv Content-Language: en-US To: Niklas Cassel Cc: Alexander Viro , Eric Biederman , Kees Cook , Paul Walmsley , Palmer Dabbelt , Albert Ou , Greg Ungerer , Mike Frysinger , "stable@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "linux-riscv@lists.infradead.org" References: <20220414091018.896737-1-niklas.cassel@wdc.com> <6ee62ced-7a49-be56-442d-ba012782b8e2@opensource.wdc.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 47CD4140003 X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="DQyX/OHV"; dkim=pass header.d=opensource.wdc.com header.s=dkim header.b="mWJ7/209"; spf=pass (imf23.hostedemail.com: domain of "prvs=0972008b0=damien.lemoal@opensource.wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=0972008b0=damien.lemoal@opensource.wdc.com"; dmarc=pass (policy=quarantine) header.from=opensource.wdc.com X-Stat-Signature: uzmffc6oj3cy56gfs4y6cm4ahe9gz31r X-HE-Tag: 1649985218-320779 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 4/15/22 10:08, Niklas Cassel wrote: > On Fri, Apr 15, 2022 at 09:56:38AM +0900, Damien Le Moal wrote: >> On 4/15/22 09:30, Niklas Cassel wrote: >>> On Fri, Apr 15, 2022 at 08:51:27AM +0900, Damien Le Moal wrote: >>>> On 4/14/22 18:10, Niklas Cassel wrote: > > (snip) > >> So if we are sure that we can just skip the first 16B/8B for riscv, I >> would not bother checking the header content. But as mentioned, the >> current code is fine too. > > That was my point, I'm not sure that we can be sure that we can always > skip it in the future. E.g. if the elf2flt linker script decides to swap > the order of .got and .got.plt for some random reason in the future, > we would skip data that really should have been relocated. Good point. Your current patch is indeed better then. BUT that would also mean that the skip header function needs to be called inside the loop then, no ? If the section orders are reversed, we would still need to skip that header in the middle of the relocation loop... > > So I think that it is better to keep it, even if it is a bit verbose. > > > Kind regards, > Niklas -- Damien Le Moal Western Digital Research