Message ID | 20240329044459.3990638-4-debug@rivosinc.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09A3CCD1283 for <linux-mm@archiver.kernel.org>; Fri, 29 Mar 2024 04:45:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B5C06B0095; Fri, 29 Mar 2024 00:45:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 863C76B0096; Fri, 29 Mar 2024 00:45:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DD2C6B0098; Fri, 29 Mar 2024 00:45:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5191A6B0095 for <linux-mm@kvack.org>; Fri, 29 Mar 2024 00:45:58 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id DC3FD1410CF for <linux-mm@kvack.org>; Fri, 29 Mar 2024 04:45:57 +0000 (UTC) X-FDA: 81948839154.13.E42C941 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by imf07.hostedemail.com (Postfix) with ESMTP id 1766D40010 for <linux-mm@kvack.org>; Fri, 29 Mar 2024 04:45:55 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=00wb5pqw; dmarc=none; spf=pass (imf07.hostedemail.com: domain of debug@rivosinc.com designates 209.85.210.45 as permitted sender) smtp.mailfrom=debug@rivosinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711687556; a=rsa-sha256; cv=none; b=3whAr6PykZLGooSvNevnBHTSSQt5VrCkf5Zt0+yYV83PTLGqBU6Uu11WTr6ZlXrWf15LCS VI024mXk391yzGsaqbAtRO1Lii8rNUeebi767P5RTJVtPwGlVw5OCfDo8JDfV2zkoSR51b aXlrgXh8tFtpO5y0RM5TZ5yeDHkpcpQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=00wb5pqw; dmarc=none; spf=pass (imf07.hostedemail.com: domain of debug@rivosinc.com designates 209.85.210.45 as permitted sender) smtp.mailfrom=debug@rivosinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711687556; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qng37K3M8eikqBpPaGOFEE/tLaKw4gdTCP/Sk21HmlA=; b=rWX/hThcFgUOA0Er7dhj8ppXUNlsco9FRcGzBHOQjvZM4oHFp+h+1pREdEVvTolJhpP2Cc M9XLlDZSelGO0Sa/kQE/t6o7gBY8fLw4D9XvjAwHf9Bsf3Qc4shFWRlbPNsYTsF8ZLfibO +khtbr3/JuFNJny6KSbZC6zwWT9kbjo= Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6e445b4f80bso656309a34.0 for <linux-mm@kvack.org>; Thu, 28 Mar 2024 21:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1711687555; x=1712292355; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qng37K3M8eikqBpPaGOFEE/tLaKw4gdTCP/Sk21HmlA=; b=00wb5pqw2RalWFL+VI3c/5yRRRqBO+ZUoMr0aDiWeBdRf1kPIx3+QhEx6woyqE57dS KwOwHaQP+Jvgx1E9NRdIg8cLUp545VV3SVMqG+dlFWPBPI3IhcE3jwSBUsTIAL2Y1+6v zxWkDJ2bGhEA8RUIDpiyPv4sQWINmcviDUfcz7ACRzhaPfjU0qr79CjAfRIm5B/fB/5s 8QTi8Oj+9ywamyrwy/K6MrVnd00iEZhterz8us1EEXTzKaiBcA7ZduiKZmjIc9ZFeL0Y vfeWfG0ekY1TKnvUNIUDgEx9XVbIbr4xXQoRpAfrgWlhpTR4vKAxDTqN3Xk41Pp3O3/7 9etA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711687555; x=1712292355; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qng37K3M8eikqBpPaGOFEE/tLaKw4gdTCP/Sk21HmlA=; b=XVXZ4+trjSAwGxBZRn/oay+5oD6oeWjSB6uUlao+j1FkY2QJsAGrR2dVTsrUTc76LY ms9lDLJZTHbLaFSJVDOH71/Bn9P5oKhzcmEnpiT0n+5jU91h9EvEh523HKbnFI4wDLqy C8sELa1MTlyJBWkwhvSaBeKAKVPGgMLw0+0fRhzXwP+dFvKayTFwcdFyofIk+A5MiXKw WUKvAuVL80FgPpgLXO0RyQET65ZB6F+ntbr9YSWylDBzQ9KbS7hP2wAAnH3BARngVYXf 8pK7X+ynoevzASjl4Ak05bTPvzxy18n1BCeOHd+a73Q4hLTd4zAxLODGHb9orM52TH54 3y8Q== X-Forwarded-Encrypted: i=1; AJvYcCX/jXT2mvtgOLFUBzmDtyBohZOS8i1XvAPgp0ONs94NfGTSB3SuIouYcqNZScQ1h4Ex818EVOHFOvaoknCKvYNRZyY= X-Gm-Message-State: AOJu0YwtUidvnxKaPCO0T7WD/z6TsVXAT7uDghuHkg79gUIyY34pKu8e MAgiVJTWjVSCcinc7ZmrB/dzbtRoodlzKrWLZdIO41nofSo7XRwzZaLJ3/oj0wE= X-Google-Smtp-Source: AGHT+IEKOjTE3dTftWOMe2SOt89v3AzQ5X6q/KOwkPfLyYHAC9S2vY+NFOYACNL9schcS27A//V0AA== X-Received: by 2002:a05:6871:4096:b0:229:9cb5:4fe3 with SMTP id kz22-20020a056871409600b002299cb54fe3mr1713256oab.14.1711687554880; Thu, 28 Mar 2024 21:45:54 -0700 (PDT) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id i18-20020aa78b52000000b006ea7e972947sm2217120pfd.130.2024.03.28.21.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 21:45:54 -0700 (PDT) From: Deepak Gupta <debug@rivosinc.com> To: paul.walmsley@sifive.com, rick.p.edgecombe@intel.com, broonie@kernel.org, Szabolcs.Nagy@arm.com, kito.cheng@sifive.com, keescook@chromium.org, ajones@ventanamicro.com, conor.dooley@microchip.com, cleger@rivosinc.com, atishp@atishpatra.org, alex@ghiti.fr, bjorn@rivosinc.com, alexghiti@rivosinc.com, samuel.holland@sifive.com, palmer@sifive.com, conor@kernel.org, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: corbet@lwn.net, tech-j-ext@lists.risc-v.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, oleg@redhat.com, akpm@linux-foundation.org, arnd@arndb.de, ebiederm@xmission.com, Liam.Howlett@oracle.com, vbabka@suse.cz, lstoakes@gmail.com, shuah@kernel.org, brauner@kernel.org, debug@rivosinc.com, andy.chiu@sifive.com, jerry.shih@sifive.com, hankuan.chen@sifive.com, greentime.hu@sifive.com, evan@rivosinc.com, xiao.w.wang@intel.com, charlie@rivosinc.com, apatel@ventanamicro.com, mchitale@ventanamicro.com, dbarboza@ventanamicro.com, sameo@rivosinc.com, shikemeng@huaweicloud.com, willy@infradead.org, vincent.chen@sifive.com, guoren@kernel.org, samitolvanen@google.com, songshuaishuai@tinylab.org, gerg@kernel.org, heiko@sntech.de, bhe@redhat.com, jeeheng.sia@starfivetech.com, cyy@cyyself.name, maskray@google.com, ancientmodern4@gmail.com, mathis.salmen@matsal.de, cuiyunhui@bytedance.com, bgray@linux.ibm.com, mpe@ellerman.id.au, baruch@tkos.co.il, alx@kernel.org, david@redhat.com, catalin.marinas@arm.com, revest@chromium.org, josh@joshtriplett.org, shr@devkernel.io, deller@gmx.de, omosnace@redhat.com, ojeda@kernel.org, jhubbard@nvidia.com Subject: [PATCH v2 03/27] riscv/Kconfig: enable HAVE_EXIT_THREAD for riscv Date: Thu, 28 Mar 2024 21:44:35 -0700 Message-Id: <20240329044459.3990638-4-debug@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240329044459.3990638-1-debug@rivosinc.com> References: <20240329044459.3990638-1-debug@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 1766D40010 X-Stat-Signature: t9jddat8e9wrrziquzcxhgzuw95mzncb X-HE-Tag: 1711687555-268216 X-HE-Meta: U2FsdGVkX1/8HiGoygi4+X5O6o9Kf/FN2RdpGt5WBqDVvgCOpVu6TVRraderWAsOVi7AE/71TX73hYjBsKpcXGITV3OPAKBIcyHBj8kaounjU5CyIM6zTKtSPuLM4chSFWiXN/uG9KzIWn6IDXZDhkwikbyXHZB+50sQeMCoEEioPs6ZXfSznOjL8vdy9PlwSTUJrVhK5NxkCaax6oPz5GvQVp6cJ18Ny334Pw8elB29+vyTrozoDgE74ci5lTXcRrNVo+MNLk3S14V6EunIR5GuGZSveSin3pfkShBie4rZK9+MHhtMk8Otv/VGjWHyiKzx9xv7IyxfKDcz7szgCuUr2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yMqDp2ZrAMRABjdteKGQfzfgWx2VkMpGeCEvqij117XTGpBRjeINMvgHu8/4OJTnkbHW4kyBDwmaaEENdP5eXMX5LCyLe+EkvDpI72N9semOw473hawJ5pr6jCoBoz410k59NRp1xgmH1fWwQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
riscv control-flow integrity for usermode
|
expand
|
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index e3142ce531a0..7e0b2bcc388f 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -149,6 +149,7 @@ config RISCV select HAVE_SAMPLE_FTRACE_DIRECT_MULTI select HAVE_STACKPROTECTOR select HAVE_SYSCALL_TRACEPOINTS + select HAVE_EXIT_THREAD select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU select IRQ_DOMAIN select IRQ_FORCED_THREADING diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 9a85c9d4c902..d864eef5a10d 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -195,6 +195,11 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) return 0; } +void exit_thread(struct task_struct *tsk) +{ + return; +} + int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) { unsigned long clone_flags = args->flags;
riscv will need an implementation for exit_thread to clean up shadow stack when thread exits. If current thread had shadow stack enabled, shadow stack is allocated by default for any new thread. Signed-off-by: Deepak Gupta <debug@rivosinc.com> --- arch/riscv/Kconfig | 1 + arch/riscv/kernel/process.c | 5 +++++ 2 files changed, 6 insertions(+)