From nobody Mon Feb 9 18:46:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556971856; cv=none; d=zoho.com; s=zohoarc; b=QRRDH45Lzp9LrqBpR1G2uV5f9AHk95GREi192EEj+VKjJHkVFoiAv6fKEDUdgZHBBuQHE9n7DaUsO8EIGnPH0SjLYsHhpbnASUtO0sWbvtcgD0wud2ni8J45URjcYZR3tqNKaUxOmNKfdIhqLiAULkiT5UtgO4mnRdGnhztz4mo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556971856; h=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:ARC-Authentication-Results; bh=/mCFCVnZxjs86hd/2IkgmcY0FzqDfdRP5Dh6XiOK0Bo=; b=Ynhpv/TZwJRMRCOHa85OqCaxyWCD8zoLOQtZ1xYGbylnx7ISvzVbGjx64z6e/3/2LylD3trzlMB0ke/W97E5eAmipdUk+bE6nMvyIEzgYihJ+WSgTjzr7tGgqYipTk3b0Nj2LE1CBq/PdJ/1KqNaTlZepSTNNL0eefAkz15NSp4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1556971856934364.1167176636899; Sat, 4 May 2019 05:10:56 -0700 (PDT) Received: from localhost ([127.0.0.1]:55730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMtVF-0002iH-Nl for importer@patchew.org; Sat, 04 May 2019 08:10:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMtQN-0007Ki-EH for qemu-devel@nongnu.org; Sat, 04 May 2019 08:05:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMtQL-0001IO-Gc for qemu-devel@nongnu.org; Sat, 04 May 2019 08:05:51 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:44869) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMtQL-0001EA-AU; Sat, 04 May 2019 08:05:49 -0400 Received: by mail-oi1-x244.google.com with SMTP id t184so6328714oie.11; Sat, 04 May 2019 05:05:40 -0700 (PDT) Received: from localhost.localdomain ([198.59.53.9]) by smtp.gmail.com with ESMTPSA id s26sm1844978otk.24.2019.05.04.05.05.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2019 05:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/mCFCVnZxjs86hd/2IkgmcY0FzqDfdRP5Dh6XiOK0Bo=; b=RsekO3nG+gnOS+8ZCJ6wGbx02ghB74NNj4NL+ZMwJY5XIxvc7h2RegOpSfeFUKTcE4 bxaP3bv8qBAIOuy+f3EHxp3Z4A1fIwxLU7eeSO2/NjxyYVMssCgE0doPNnn8ItqOEgqG CU0B9LkQ4FlbxLDn67KtU64uoWFVSEsGTScBcemgEsn4l3z76NHCgV/T4BUvFX3muuiN +ru9m5Pnf7j+6d7r/LQWfG1+cdULQMSMFODN54TF5Tt0zN5PSEELgR8FM0Z3s368AXCk Z/cqfHAOiAqhXYcuMiIOY7y4dDG0HHfKZjMsbnzMcuzHV5PkqaPolYyEuAiQeCrx9l+h qZcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/mCFCVnZxjs86hd/2IkgmcY0FzqDfdRP5Dh6XiOK0Bo=; b=aofCtycGJla4PEQl8TNXbKbtUbRC374YXnqxZLJSSqBz9vJWYQlIvpR3jSjAQb+Nkf kc1+j3DVpYvEKJvAiNhNCSDBcYBlJs/IQ/aU6Mrat+fI2cc5RGaaScbMSkJmT0pr0pjX tUMoYti/ngQqOFTvpQJEElzWEiJfvnMLjM3gvGOw0e8CexCIfRiALLpeqjFiUv79VjS4 lQQHBg1OXLlJGO5OX/SZCRf9Ws3cMq0Dnq3z2ocVJCUYOj99ZtP1THiHawLM+Uwsfl9Y toGhsPiZQVfR6k1WzJxScIIpMYKOJrxujQ1uM10d8BiO6cteIDB8VDW/9WO26lDXQeo8 l+Jg== X-Gm-Message-State: APjAAAVDwhTx6P5MBePXfCGtsbPIY9TC5Xy2AU2IczX/oReRvBn93x3R yt24fGmYE9pftQ3IKqEvMagC0Tb6 X-Google-Smtp-Source: APXvYqwmVMK6pSlmdJHC8xzc241FVkbp6YNMBKYF9tUWG0hi3ERxdpWJzgvvB+5nl6UfzfQZOtdqig== X-Received: by 2002:aca:4f10:: with SMTP id d16mr2311035oib.17.1556971539772; Sat, 04 May 2019 05:05:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 4 May 2019 06:05:27 -0600 Message-Id: <20190504120528.6389-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190504120528.6389-1-pbonzini@redhat.com> References: <20190504120528.6389-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::244 Subject: [Qemu-devel] [PATCH 9/9] linux-user: add IBT support to x86 safe-syscall.S X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, cohuck@redhat.com, richard.henderson@linaro.org, qemu-block@nongnu.org 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" Because safe-syscall.S does not go through the C compiler, the .note.gnu.property note has to be added manually. Safe syscalls do not involve any indirect branch or stack unwinding, so they are trivially safe for IBT or shadow stacks. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- linux-user/host/i386/safe-syscall.inc.S | 19 +++++++++++++++++++ linux-user/host/x86_64/safe-syscall.inc.S | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/linux-user/host/i386/safe-syscall.inc.S b/linux-user/host/i386= /safe-syscall.inc.S index 9e58fc6504..6c6d568d62 100644 --- a/linux-user/host/i386/safe-syscall.inc.S +++ b/linux-user/host/i386/safe-syscall.inc.S @@ -98,3 +98,22 @@ safe_syscall_end: .cfi_endproc =20 .size safe_syscall_base, .-safe_syscall_base + + .pushsection ".note.gnu.property", "a" + .p2align 2 + .long 1f - 0f /* name length. */ + .long 4f - 1f /* data length. */ + .long 5 /* NT_GNU_PROPERTY_TYPE_0. */ +0: + .asciz "GNU" /* vendor name. */ + .p2align 2 +1: + /* GNU_PROPERTY_X86_FEATURE_1_AND. */ + .long 0xc0000002 /* pr_type. */ + .long 3f - 2f /* pr_datasz. */ +2: + .long 0x3 /* IBT, SHSTK */ +3: + .p2align 2 +4: + .popsection diff --git a/linux-user/host/x86_64/safe-syscall.inc.S b/linux-user/host/x8= 6_64/safe-syscall.inc.S index f36992daa3..e1a57db338 100644 --- a/linux-user/host/x86_64/safe-syscall.inc.S +++ b/linux-user/host/x86_64/safe-syscall.inc.S @@ -89,3 +89,22 @@ safe_syscall_end: .cfi_endproc =20 .size safe_syscall_base, .-safe_syscall_base + + .pushsection ".note.gnu.property", "a" + .p2align 3 + .long 1f - 0f /* name length. */ + .long 4f - 1f /* data length. */ + .long 5 /* NT_GNU_PROPERTY_TYPE_0. */ +0: + .asciz "GNU" /* vendor name. */ + .p2align 3 +1: + /* GNU_PROPERTY_X86_FEATURE_1_AND. */ + .long 0xc0000002 /* pr_type. */ + .long 3f - 2f /* pr_datasz. */ +2: + .long 0x3 /* IBT, SHSTK */ +3: + .p2align 3 +4: + .popsection --=20 2.21.0