From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F6311B0414 for ; Fri, 8 Aug 2025 17:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754673624; cv=none; b=uuTBpuPD0XAQ1odBnLMB/TI0dzjauH6j2VfEmHnvGQI60m0lFMQht6KhhxkxH3GB4z2v2l0CdA/yNFq72KbgOM9Nev/8ZjW+LteJSgqa8QDgljxV5npq+aGJ9I3/ma4bUnWpmPN4blSv9wpuaKNnHhCDyvtDj99BFONm9WRP80c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754673624; c=relaxed/simple; bh=RqNZJ9llYxg5119nPvsoAte+UupsM8m84wjkhwHB7S4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=akQopT3CYypvUdr6fx45yPHla2Tz0LBpbnBjXuTp0/PX8jYuGRMMaWXGtHit7GSfIjjGIC1p7Y1oE8mXzGlSYCE2TjryIob7Lwp76EdlVx8GNzA8veN3Fdb2ryiEd6lYsoqM0LtlCpsceneEu7OWVU7FIRxdYC+sK3Bm/j2FttU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc.com header.i=@rivosinc.com header.b=a8M63Uui; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc.com header.i=@rivosinc.com header.b="a8M63Uui" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-b42254ea4d5so1606887a12.1 for ; Fri, 08 Aug 2025 10:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc.com; s=google; t=1754673622; x=1755278422; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=e5KtmNZscqY46KvhQCHs24ev6RrXWd+1XTPfyk6qu6o=; b=a8M63UuieKcX26TzVIbNSA88Yn2tSAaxOYC3qXip6DTpLgrn22RYAPzvTl7GC4X9n7 z/MTSt5RmjktrSErLR5LGgZ5yeeSVtDdy7r2tM2Vu46CreMC2xvBV/xJ4kk/9gTLtBME XD6iQ6/bTVbnM06BTpJ3Wqoamucgcv6vA+OIF0+0vPh9mB6sBnKW8qCfSS5KlftSo3az WCQrHVGt76H8CJWQDS7PnRtch2s5ptTFKFYwdOWhLRTPtvqtNEO2M2/DWyUucdKdhrXG PfX0jt+/QtWvkyBjDFhL2MK1WtIdbK19Ej4ghyPEM4jpSiVz2OOVtdPLEqDkQS/C0a4r xzhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754673622; x=1755278422; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=e5KtmNZscqY46KvhQCHs24ev6RrXWd+1XTPfyk6qu6o=; b=qfbCSRUIROavxr9X1CVcArlqweJKc5NGoB+QsItAP9/Gwb8PLUp19kckTB/NiCjFnj oWJN5nKkrb1C8lVtAgNpMjZylxoST/MsFvfm6gQUjsfY2vd+S5ryIsVwL/Byllr+9wN5 7PcB9MQZvPpsMtBdvS6gZ8gKSDEcbxT1s6JdddbY0zbOJvbxrGlXwE39suXi5UXu4bmH nXycFNQbn+1odNTjWyRV9E6a2pyRaDfOvWgm6eFCorg+Hlhrb7eS1mH+FTQnTGK624ip 2itJjxum0z5PWrnGIx6ehnKCvV0vEBaewnT9R3QlSnMQ04gVc75WjZ3w6mS1JTISIr95 4TtA== X-Forwarded-Encrypted: i=1; AJvYcCX1gDP9c7Bs1fgFhtOfNpeV121fpj+zcUH6kjokyF+VeKL9xAbgwhKe8BSAEKr1MqKmrlSfBIjurx6B@vger.kernel.org X-Gm-Message-State: AOJu0YxBLHPIRfES+xzLfpLo6lwn/Jrbs32dsY/1TK1PMssCt6HCirqs iP5kRT7uQl2Srr4Upghmgl0Q1SFdXIZad8Ns5zUgcb3uJCTUglRvdnPgPVXbM4djM0c= X-Gm-Gg: ASbGncvxbwR5HKj5udvYnXI+diq3wzKa9i5qVIy3PsZ1cHPT7swMFxbpF4sBomjr5D0 XN8KrL6VPG4OQW3UTiLrNFRxdaKLv6aRgeyNZtQBsdMaX5tRWK7/M03GYkI/deX+phxosCkcnnV Jp6/dxq3xLbCkAy9aakxeYFhvyoCzs/NWLFNBTFXSdth+l9fUCxRaPyDXBQLOM+/XHyIVLLZPVy PuDpJiaOxWICiOWMn8fpIOI1Y2gfqravdLt8MpXjO/X6TskhFX9H3mfR4X0GqcCnVRcuYMj4bP0 7WhXDc58lK2uNgt21eiD7TUvdzfo0H860OcFdFxUOBNNPeVsO1Bb5h7uXX8Tj3cpJGQ32BUnVeb GHEaKWusT5lNB+k//KG6gfIGxyAVP8xxwPOh077Li+0U= X-Google-Smtp-Source: AGHT+IEbXOfCcMMF+EKLeMi8xU3SNI8Lg4qkWBu83GI5zB4sNqf//XXj2WJssysLa22zlDPxSEkl6g== X-Received: by 2002:a17:902:da82:b0:240:c678:c1ee with SMTP id d9443c01a7336-242c1ffb211mr57743355ad.11.1754673622272; Fri, 08 Aug 2025 10:20:22 -0700 (PDT) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-241e8aafa77sm213263625ad.174.2025.08.08.10.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Aug 2025 10:20:21 -0700 (PDT) Date: Fri, 8 Aug 2025 10:20:17 -0700 From: Deepak Gupta To: Mark Brown Cc: patchwork-bot+linux-riscv@kernel.org, linux-riscv@lists.infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, akpm@linux-foundation.org, Liam.Howlett@oracle.com, vbabka@suse.cz, lorenzo.stoakes@oracle.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, conor@kernel.org, robh@kernel.org, krzk+dt@kernel.org, arnd@arndb.de, brauner@kernel.org, peterz@infradead.org, oleg@redhat.com, ebiederm@xmission.com, kees@kernel.org, corbet@lwn.net, shuah@kernel.org, jannh@google.com, conor+dt@kernel.org, ojeda@kernel.org, alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, lossin@kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, alistair.francis@wdc.com, richard.henderson@linaro.org, jim.shu@sifive.com, andybnac@gmail.com, kito.cheng@sifive.com, charlie@rivosinc.com, atishp@rivosinc.com, evan@rivosinc.com, cleger@rivosinc.com, alexghiti@rivosinc.com, samitolvanen@google.com, rick.p.edgecombe@intel.com, rust-for-linux@vger.kernel.org, zong.li@sifive.com, david@redhat.com Subject: Re: [PATCH v19 00/27] riscv control-flow integrity for usermode Message-ID: References: <20250731-v5_user_cfi_series-v19-0-09b468d7beab@rivosinc.com> <175450053775.2863135.11568399057706626223.git-patchwork-notify@kernel.org> <09081487-89ac-4f8d-b9fc-e563f09726d2@sirena.org.uk> Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <09081487-89ac-4f8d-b9fc-e563f09726d2@sirena.org.uk> On Fri, Aug 08, 2025 at 12:48:31PM +0100, Mark Brown wrote: >On Fri, Aug 08, 2025 at 01:23:15AM -0700, Deepak Gupta wrote: >> On Thu, Aug 07, 2025 at 01:28:36PM +0100, Mark Brown wrote: > >> > Do you have an update for my clone3() shadow > >> No I don't. > >> > stack series that I could roll in for when I repost that after the merge >> > window, and/or instructions for how to run this stuff for RISC-V on some >> > emulated platform? > >> I would want to write-up instructions. But I don't want you to go through >> a lot of hassle of building toolchain and bunch of other stuff. >> Let me see how I can make it easy for you. Will report back. > >Thanks. FWIW I should already be sorted for the kernel build, unless >there's a super new or specialist toolchain required for this feature Unlike x86 shadow stack and arm's GCS, push on RISC-V shadow stack is done using dedicated `sspush` instruction and pop is done using instruction `sspopchk`. RISC-V vDSO has certain `C` files and they would need shadow stack push and pop (along with landing pad on them). So that's why kernel compile would require the toolchain. I'll point you to it. >(I'd guess I should be fine for the shadow stacks bit?) - it's userspace >and emulation for the extension I'm missing. Qemu changes are upstream. I'll provide the command line option. On userspace, I'll point you to something pre-compiled rootfs. 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C29FC87FDA for ; Fri, 8 Aug 2025 17:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=h8YfyZWJQtj7fRoLDf5uGSOcR+KqEZg+DDxIhipaEDo=; b=CmsaWoSZLaZJeYhL1XsyHsn6jE dP1rZj+SlNRPj63g+bWv+2ytXoNSm3NSXsbufm7wif7nIK+D1jcioV5SmWi+9GlXVhW7wMHCQkovs 26VAI7BRAH3TEV9CGsyWcE1JUGs7IPhTpDCbzpGPIW38lZTuIYmI8mbhKtenYSQ7LAB8t5OZ2S1zP fPiQFlBAagZvTneUQTk2DZOf2VAH+zUb1Tyu/bF0TDwoEZgYMtMQI1D48S5/+BOR+1HcHTIIvXlLS 3QQ1l8wtLZiRMJHarIlPTR9MZAFMHRLx4hdj0iE07f0m3eVzZRGa6RdVH6/wQLqpXZl4DALCLJbTL PWGA4QEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ukQlV-00000003OHm-084k; Fri, 08 Aug 2025 17:20:25 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1ukQlT-00000003OGk-0trB for linux-riscv@lists.infradead.org; Fri, 08 Aug 2025 17:20:24 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-76bdce2ee10so2156997b3a.2 for ; Fri, 08 Aug 2025 10:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc.com; s=google; t=1754673622; x=1755278422; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=e5KtmNZscqY46KvhQCHs24ev6RrXWd+1XTPfyk6qu6o=; b=MCHuqdu/LylPdjDkiy/ce7PEkUXXiGg8XnOCFNGKkDABC/3aq0vEwW6tWYlO5TgbBA 41hzSkG0n/NuHsTE72F3ufYIGsC1vIEvo6K01dpVVdGj2xtMF012LxJ5OFBpWuqLaZRt lB1K5hb5pajmbeN/tg0FHe+4/yLHjWv01GUNhY+OXjjpBHQKPM2p9rFHniXZdybuQXjM RKViIrcIxr4JfKuSgW5RsKz85RQjd1lcPoJOYwUU2qB4sLFOebD8CCQEIHdOLbJk++Yf sNPdedtuRkVhGaf2orq1u3hofTpAOTy9jBn+0dOx6veAcLpGyY5enj53gk9kwqbLxB2V 04PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754673622; x=1755278422; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=e5KtmNZscqY46KvhQCHs24ev6RrXWd+1XTPfyk6qu6o=; b=a2yjPcj0iarNIKjWdu+r3ikyHVWeQcxOM4zWNymKHYBo0CBSKsCaODHrIghVMpAe6D pn5xUI+QhXkuwf23/AeLqbQKFP4aGHqz3vBESpK+k3tV/2P4W1Yfzv/4EDxWdtfv9+Tb XeS9iyi5SCzOrEF7I9f+SNjm3wZ2cSNzLFlt/2lIT10tMTKCZaFSQ6OTVhiINtB0kEoh ZEnjTftzcotvCN07pkBXLhX1cK++h9PIgTtR1mFFiI3cExOl0ivqIDeiAnbyABFRKaUm wimkUAqCZf0X4E/qPpVMmVHq3kBWaU1nJzE5Ezvmzl1k0UN4HfgGslpVohZn3jy1LE6c rZMA== X-Forwarded-Encrypted: i=1; AJvYcCU/vbrIRz0A9Fmg587LMae0DdQT4spcj8vN3Cm+OKdyC4OvZVSg9xpeqB+mWoPb75bwcmwj8QC/u2qG7g==@lists.infradead.org X-Gm-Message-State: AOJu0YysGART98Djb2PO+QO7mPQMKTaBLmXOkdy548JdM4ii9gWD2n9F D232kZNGY5JD6+4+Jwkgch/R5W9d0XkRvXj8W8L86HEnl1JJ0UbcMDHq3aFoozWssaE= X-Gm-Gg: ASbGnctqg4FwLThOiSc3MH5zXqqhVDSb3hygCVMwK22427Cxe6fLybDmknhRz6HbFO5 E6pu4P3sJ1XmKJvWoqM/+55PujFoFGGJAYIeMwygLezh2g6oPgUj7xEVH3HqgR+V51V+XubAZ/d H+T7KGC2gR8VsnEHOMV3vy9Hr+FEeUUci6ascL1P2Wx9yiMMTnUOWOIqTPrQgT04feXUfjSarhr j7wbd9yPTBuociRTzJRcVDyXFgbiBQeU1P6sYV3B0kxnHN2yfas2PXSTl9DWFZXwezMQa/VJe0S cHaEGBImZKUqpgAycY6tIS3hycewjDS/lE6Xs0SUVwsjn+Aiq/EV3aq4boWsrYICV1CmDfcaNyB EO4yA9WdkriAmYiAbNZKj64XnIm5zCt9Nz7Xok+Vnxvw= X-Google-Smtp-Source: AGHT+IEbXOfCcMMF+EKLeMi8xU3SNI8Lg4qkWBu83GI5zB4sNqf//XXj2WJssysLa22zlDPxSEkl6g== X-Received: by 2002:a17:902:da82:b0:240:c678:c1ee with SMTP id d9443c01a7336-242c1ffb211mr57743355ad.11.1754673622272; Fri, 08 Aug 2025 10:20:22 -0700 (PDT) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-241e8aafa77sm213263625ad.174.2025.08.08.10.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Aug 2025 10:20:21 -0700 (PDT) Date: Fri, 8 Aug 2025 10:20:17 -0700 From: Deepak Gupta To: Mark Brown Cc: patchwork-bot+linux-riscv@kernel.org, linux-riscv@lists.infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, akpm@linux-foundation.org, Liam.Howlett@oracle.com, vbabka@suse.cz, lorenzo.stoakes@oracle.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, conor@kernel.org, robh@kernel.org, krzk+dt@kernel.org, arnd@arndb.de, brauner@kernel.org, peterz@infradead.org, oleg@redhat.com, ebiederm@xmission.com, kees@kernel.org, corbet@lwn.net, shuah@kernel.org, jannh@google.com, conor+dt@kernel.org, ojeda@kernel.org, alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, lossin@kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, alistair.francis@wdc.com, richard.henderson@linaro.org, jim.shu@sifive.com, andybnac@gmail.com, kito.cheng@sifive.com, charlie@rivosinc.com, atishp@rivosinc.com, evan@rivosinc.com, cleger@rivosinc.com, alexghiti@rivosinc.com, samitolvanen@google.com, rick.p.edgecombe@intel.com, rust-for-linux@vger.kernel.org, zong.li@sifive.com, david@redhat.com Subject: Re: [PATCH v19 00/27] riscv control-flow integrity for usermode Message-ID: References: <20250731-v5_user_cfi_series-v19-0-09b468d7beab@rivosinc.com> <175450053775.2863135.11568399057706626223.git-patchwork-notify@kernel.org> <09081487-89ac-4f8d-b9fc-e563f09726d2@sirena.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <09081487-89ac-4f8d-b9fc-e563f09726d2@sirena.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250808_102023_259145_EC900421 X-CRM114-Status: GOOD ( 13.87 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Aug 08, 2025 at 12:48:31PM +0100, Mark Brown wrote: >On Fri, Aug 08, 2025 at 01:23:15AM -0700, Deepak Gupta wrote: >> On Thu, Aug 07, 2025 at 01:28:36PM +0100, Mark Brown wrote: > >> > Do you have an update for my clone3() shadow > >> No I don't. > >> > stack series that I could roll in for when I repost that after the merge >> > window, and/or instructions for how to run this stuff for RISC-V on some >> > emulated platform? > >> I would want to write-up instructions. But I don't want you to go through >> a lot of hassle of building toolchain and bunch of other stuff. >> Let me see how I can make it easy for you. Will report back. > >Thanks. FWIW I should already be sorted for the kernel build, unless >there's a super new or specialist toolchain required for this feature Unlike x86 shadow stack and arm's GCS, push on RISC-V shadow stack is done using dedicated `sspush` instruction and pop is done using instruction `sspopchk`. RISC-V vDSO has certain `C` files and they would need shadow stack push and pop (along with landing pad on them). So that's why kernel compile would require the toolchain. I'll point you to it. >(I'd guess I should be fine for the shadow stacks bit?) - it's userspace >and emulation for the extension I'm missing. Qemu changes are upstream. I'll provide the command line option. On userspace, I'll point you to something pre-compiled rootfs. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv