From nobody Mon Feb 9 06:49:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=quarkslab.com ARC-Seal: i=1; a=rsa-sha256; t=1615216725; cv=none; d=zohomail.com; s=zohoarc; b=O+vy4x5WbjwNzuUoLQTCFpyFLY3qDJPFLse5s6NE6J0B2oHE9BTuG3CFwQ07xtWr2MBndjIwrC0kx43XE6PlHO8Oxkev60RTBLhG0BcGqGWsj3JPfc6a7VoOFY3NIRps11RWNxMwxrJZ0jnz55Q7uu7L6PwREciIdNwmdbKQjqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615216725; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=L/qePHpuYe0/XQDDH9d6PGH2Whfk+pnfWij+WngfCEs=; b=Oudahl1MY/YNYdm4b1Q6BPZTQKTYlKMmN3UJBHhsf4WQE/gL1LglVvx1kT5PvJv5zC/scyrG3VYfsbQIwqoWJME8C0zKyX3g/siAE1lLoHRHJebUi1P5iMsWrrGOEnMaggWHLy0oyC9yRRM10IvOoWc5z51sbXWTXO9PMOXtQf8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615216725366983.3868018856881; Mon, 8 Mar 2021 07:18:45 -0800 (PST) Received: from localhost ([::1]:48644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJHee-0003da-3Q for importer@patchew.org; Mon, 08 Mar 2021 10:18:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJC41-0004M1-Fu for qemu-devel@nongnu.org; Mon, 08 Mar 2021 04:20:33 -0500 Received: from [2001:bc8:24f6:500::1] (port=42288 helo=mx5.quarkslab.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJC3o-0007oL-Cx for qemu-devel@nongnu.org; Mon, 08 Mar 2021 04:20:32 -0500 Received: from Muon.usr.qb (lstlambert-657-1-110-45.w92-154.abo.wanadoo.fr [92.154.21.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx5.quarkslab.com (Postfix) with ESMTPSA id 4DvCVR258Gz7srZ; Mon, 8 Mar 2021 10:20:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=quarkslab.com; s=mail; t=1615195215; bh=vwswMcuP4UTAWU/yjiEDFQPedvgysCE5qLHA8C1U0gk=; h=From:To:Cc:Subject:Date; b=Q4KGsbUFaL2ZepMnqRMRzeMCvZnh9jLpsO32Hcb+w3XqdjeeBsjal99PI1sVvsKsT RUwdAHg7TRaULEprcpsHOr5SzunlqCJ07YgJCrU+8FUAQ2x5xjh50x1FUtsSwHUEgm vnUgIIhQlweh0mCG6mRfc5wSpZeRTh58LZDAOUFg= From: Nicolas Surbayrole To: qemu-devel@nongnu.org Subject: [PATCH v2] linux-user: Fix executable page of /proc/self/maps Date: Mon, 8 Mar 2021 10:19:59 +0100 Message-Id: <20210308091959.986540-1-nsurbayrole@quarkslab.com> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:bc8:24f6:500::1 (failed) 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: pass client-ip=2001:bc8:24f6:500::1; envelope-from=nsurbayrole@quarkslab.com; helo=mx5.quarkslab.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 08 Mar 2021 10:17:35 -0500 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: Nicolas Surbayrole , laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Acked-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- 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 =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.30.1