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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67885E71085 for ; Thu, 21 Sep 2023 14:53:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjL2W-0004VO-9p; Thu, 21 Sep 2023 10:52:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjL2Q-0004VC-MZ; Thu, 21 Sep 2023 10:52:18 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjL2O-0001mD-KA; Thu, 21 Sep 2023 10:52:18 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 47F2B23FF2; Thu, 21 Sep 2023 17:52:27 +0300 (MSK) Received: from [192.168.177.130] (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with ESMTP id 784EA29D1F; Thu, 21 Sep 2023 17:52:05 +0300 (MSK) Message-ID: <2bbd5d06-e62c-a608-c776-a330bd33f4db@tls.msk.ru> Date: Thu, 21 Sep 2023 17:52:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2] linux-user: Fixes for zero_bss Content-Language: en-US To: Richard Henderson , qemu-devel@nongnu.org Cc: thuth@redhat.com, philmd@linaro.org, qemu-stable@nongnu.org References: <20230909184559.36504-1-richard.henderson@linaro.org> From: Michael Tokarev In-Reply-To: <20230909184559.36504-1-richard.henderson@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -83 X-Spam_score: -8.4 X-Spam_bar: -------- X-Spam_report: (-8.4 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-1.473, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 09.09.2023 21:45, Richard Henderson wrote: > The previous change, 2d385be6152, assumed !PAGE_VALID meant that > the page would be unmapped by the elf image. However, since we > reserved the entire image space via mmap, PAGE_VALID will always > be set. Instead, assume PROT_NONE for the same condition. > > Furthermore, assume bss is only ever present for writable segments, > and that there is no page overlap between PT_LOAD segments. > Instead of an assert, return false to indicate failure. > > Cc: qemu-stable@nongnu.org > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1854 > Fixes: 2d385be6152 ("linux-user: Do not adjust zero_bss for host page size") > Signed-off-by: Richard Henderson > --- > v2: Pass errp to zero_bss, so we can give a reasonable error message. > --- > linux-user/elfload.c | 53 +++++++++++++++++++++++++++++++++----------- > 1 file changed, 40 insertions(+), 13 deletions(-) Ping? Has this been forgotten? I picked this one up for debian 8.1 package, at least I don't see regressions with it applied (together with stuff staging for 8.1.1). Thanks, /mjt