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 X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E63EBC433E0 for ; Tue, 9 Mar 2021 20:38:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8BF0265253 for ; Tue, 9 Mar 2021 20:38:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BF0265253 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJj7c-0004sN-Lw for qemu-devel@archiver.kernel.org; Tue, 09 Mar 2021 15:38:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJihP-0006eQ-2w for qemu-devel@nongnu.org; Tue, 09 Mar 2021 15:11:24 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:53881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJihJ-0001eI-4T for qemu-devel@nongnu.org; Tue, 09 Mar 2021 15:11:22 -0500 Received: from [192.168.100.1] ([82.142.6.26]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.119]) with ESMTPSA (Nemesis) id 1MNtny-1l8dw045l2-00OGeS; Tue, 09 Mar 2021 21:11:13 +0100 Subject: Re: [PATCH v2] linux-user: Fix executable page of /proc/self/maps To: Nicolas Surbayrole , qemu-devel@nongnu.org References: <20210308091959.986540-1-nsurbayrole@quarkslab.com> From: Laurent Vivier Message-ID: <331c0372-e8ed-43a3-a3f3-a41d2503d57e@vivier.eu> Date: Tue, 9 Mar 2021 21:11:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210308091959.986540-1-nsurbayrole@quarkslab.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:i2BVds2k9tP++FMswYcO9ciBh0WToyHNisopxLHROlAjtsHKqbj HD7iNaBa4dZLO4fx6GTHfrCzy277hfu/LHtfC4EOcdK1jclKgQ05sZwoy0EIGtOREhcFRLd VdlmEvQXKr2TTVuiIqwEQico8iCN7a4oE6bam+bq3XChYsN7fJqPw/RFuBxwz2GQEDICGhm +HeOdV/czAdKqdkMyDXMg== X-UI-Out-Filterresults: notjunk:1;V03:K0:lE5lL4zMcWY=:ekkv7nUCfYaSHxmBwm6dz6 ZW82pvlBGDwP1X+hAiuswVGjUnmiLGWLOTRGq4lhJ40X4KLUj4J6xeUtNIIQOhyw8+ETlnQ5o eGUbNkNGpgAL0hStv3qF5GyPVqGc+jH3ZFwhhkqMYuIpwrEovIHOrOgVcNq8CP/q2Bfnyx5Bc my8KbKzigotKCYmYWVfT1AKxFbZTNVyLW1IGyUxkB+MHRryVdC7wsu7dbTY6x8lYCZSj7AKbL 9/jjs/r4SJbehJC+iG0GSukf9XQ8HWEQBTzU+35t3HhS4qMMyQdvJVYcGS7277e3mC/9AvMIP UU+XY31emdk1rXeeNWJcaBTWRaL2HL0nuhLHPOZbgQd+gKQVVgBhnLhLYBtJPnDsz6ZEfBM4z YOV8iloFgoA/NANRCrmthhHeBRxfl/WZK3bm6xcxANx1Lq+HUdIJHv6vE+nqMgVbfwGrX1scH YTGIglCi4g== Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Le 08/03/2021 à 10:19, Nicolas Surbayrole a écrit : > The guest binary and libraries are not always map with the > executable bit in the host process. The guest may read a > /proc/self/maps with no executable address range. The > perm fields should be based on the guest permission inside > Qemu. > > Signed-off-by: Nicolas Surbayrole > --- > linux-user/syscall.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index 389ec09764..0bbb2ff9c7 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -7888,9 +7888,9 @@ static int open_self_maps(void *cpu_env, int fd) > count = dprintf(fd, TARGET_ABI_FMT_ptr "-" TARGET_ABI_FMT_ptr > " %c%c%c%c %08" PRIx64 " %s %"PRId64, > h2g(min), h2g(max - 1) + 1, > - e->is_read ? 'r' : '-', > - e->is_write ? 'w' : '-', > - e->is_exec ? 'x' : '-', > + (flags & PAGE_READ) ? 'r' : '-', > + (flags & PAGE_WRITE_ORG) ? 'w' : '-', > + (flags & PAGE_EXEC) ? 'x' : '-', > e->is_priv ? 'p' : '-', > (uint64_t) e->offset, e->dev, e->inode); > if (path) { > Applied to my linux-user-for-6.0 branch. Thanks, Laurent