From nobody Tue Feb 10 13:55:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1615629178; cv=none; d=zohomail.com; s=zohoarc; b=ZBJJrsnDAc9qiRC7CAzi7L2ipaHOHmA3aQG6rtBKOGz9O5vRCVm6m/QrZIEwSyqPzYSn4AkLkQEL3wi9FBxI3PN2f5ahypcI44V63ODhYSvSXRkvePB2n8+yxin4OPCzfO8Zw/b920JzupsAk/ZM8JCSNLMObgLhF5+y68o8+NM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615629178; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vHEPp9cTKgg7IhBU0b0nKduzIP/fWcsAn7vcxF6zIjw=; b=iDNpy0ua+4oxQfgc0d026lAI/O0QeUowf5t4J0Hn/ZZBgNFtup4b2+Ma6VIptVx6lqsXPFEfO9+tY3cegzB0TyWh0nzTXlbRkC/GMzFGeNAutkHdqI9vcdsbqOw0/sjSrN8n4aZ635cuhl6Xp56fZyDdMZPytFsyZNDEMlHfhz0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615629178748310.6560845912559; Sat, 13 Mar 2021 01:52:58 -0800 (PST) Received: from localhost ([::1]:52604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lL0x7-0005CP-Nw for importer@patchew.org; Sat, 13 Mar 2021 04:52:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lL0sQ-0007A4-1s for qemu-devel@nongnu.org; Sat, 13 Mar 2021 04:48:07 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:58929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lL0sG-00075z-CK for qemu-devel@nongnu.org; Sat, 13 Mar 2021 04:48:05 -0500 Received: from localhost.localdomain ([82.142.6.26]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MJW18-1l1H4B1zce-00JsC6; Sat, 13 Mar 2021 10:47:51 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 1/5] linux-user: Fix executable page of /proc/self/maps Date: Sat, 13 Mar 2021 10:47:43 +0100 Message-Id: <20210313094747.2966948-2-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313094747.2966948-1-laurent@vivier.eu> References: <20210313094747.2966948-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:58f61JmWhBGlKAKy+RjXaa97JGJB9HibKxZ2CCi0B/msB295f0z BjiLQRjYiVaYDHRFiZDtNJ7OJKn3SrWsX09Hmv+3xz5BFhRTvmMYbSNmZSNtVDueUvMkd3U DL0Evc1sD33ypugZkEbUhVkJSUshwQUo274bm87wRvdqa0qoHLsD0B1FOnhIozIEM31pr2i f4w7W4IDAxb/Yuwjnj5sA== X-UI-Out-Filterresults: notjunk:1;V03:K0:T93sL277CIg=:xpoCgX1RB8wm31btYbwGc3 /m9GXHtXd40EkxErUtK/upAAtK9V4B6awuLlj0sWYVpJc7dUQmytqQMq5Vmr2/q2n0fvHPvHr zIx/CkpRh2TPrWtojfbf1J+X7fhAqsEYhw56WVuLd6iHfivvcWuQQxcP4cZO9dNx13K6Anb6Z mm1V/yqmOpafySz832MrqWWLmKXiHNnCVLN+mBGWHRpVdB8dK3XRaI7Hsco8fgCV27QTFLgU1 r5N6KItNWUbONYeheYpPzXi+eCy7loC2I1mtDYDEjJlM0aG2tWSr0cYym+mJyfUnT++QLd/aN IKzCrGZ22wIVL5HnKnPt2Qh9ny+WW2CZdFJhVOOxeKpN1emsLShiOYuVLouhqypBsnsddkRMF uzO3u95DYPh59sgA01FFpa5hMgaGZ3KH5/wp8XNMBGGRKYXLc9TJWmARKZD6TPJIHWLjhW5ug JvtZ/saWHw== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.17.24; 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, 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: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Nicolas Surbayrole , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Nicolas Surbayrole 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 Reviewed-by: Richard Henderson Acked-by: Alex Benn=C3=A9e Message-Id: <20210308091959.986540-1-nsurbayrole@quarkslab.com> Signed-off-by: Laurent Vivier --- 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 9522f603aad6..1e508576c73e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7890,9 +7890,9 @@ static int open_self_maps(void *cpu_env, int fd) count =3D 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) { --=20 2.29.2