Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp7051876rdb; Fri, 15 Dec 2023 16:54:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGg/QqGTL7enpoHEQD4iSZCIDFhrSMDNaze6hU+9wwR/OGQbddx8RklFgJvOcSLZ/pms9CH X-Received: by 2002:a50:a69b:0:b0:551:a444:2a4d with SMTP id e27-20020a50a69b000000b00551a4442a4dmr4005820edc.77.1702688057946; Fri, 15 Dec 2023 16:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702688057; cv=none; d=google.com; s=arc-20160816; b=EZBPDNi5ZymQ0e2bB2KI4Ehc3sDoEog3Uihez7MvSKkO2iO33SOtwq8ivDVdlqzlmi jTyKZuf26vXupkYgFzc7jX7cFDpIR3Ye5x/4YrPL8Y0I4oyvSLOymPmmtuNcXrRlAaEL 9gR32t1i+kDFn+IEHcvzdpvvjtKj2IEIMfJmGGeKgV0XQ81e7PuVoUhIdTdTLyIK8UU7 O6uj4bFOcLjZqYSDkafCcmwZ2iU65Djlqhe6y8nNVlZSW3RSZvtvr6Msuw0fHHr21IEX QLxyVVxPVBSy2yvuKK2IwdNMm4BXdUFQS7+MKgdBM5pcSUbWS3PXotJkpj3DVCnRV3pA D03Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=I0wkBeN2mknWfCaYD90okNAjhG97xOBmh5EL3y5dSjM=; fh=BovaZeSYrBPsuTnuOr8T7OA0s5Cjs6GQ6cMhhyWP/rg=; b=P0XWZx4qPDY/G3gb8XZlmdaA3g2l9F7gJNikhxJzTMFgW9QSoaIx96t/tzvSJDP30H cJxOztK67rIl8ERuyabvBRudRPo6TZc58IHy8amS9La8vZvH6iYvTKYxPhH/n/J439+Y QTcruzc8e6erR60ZICDxglbk2/X/+Mwo4RwWXBWa9uPZBcVKfDn9FdqyogBYoClBbnkp HrevuNd9lCCvyR9m5Du/738A3Hr06aKDRIM4VSiMvKLWwMzCNoA9XqTccTCN5eRJKxqw ekiAGgXGQ5UOCNAQ5KzaZ3+j8osGVE1kCyRUWGeYKJfurWYnJeQ11YwCwJW/9bufWZmv 0qYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gyqciA6i; spf=pass (google.com: domain of linux-kernel+bounces-1914-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m4-20020a056402430400b00550db4d6ec5si6603624edc.340.2023.12.15.16.54.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 16:54:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1914-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gyqciA6i; spf=pass (google.com: domain of linux-kernel+bounces-1914-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B08A31F24DED for ; Sat, 16 Dec 2023 00:54:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57ED115AF; Sat, 16 Dec 2023 00:54:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gyqciA6i" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 0E7DE7F2; Sat, 16 Dec 2023 00:54:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40c256ffdbcso14139625e9.2; Fri, 15 Dec 2023 16:54:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702688040; x=1703292840; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=I0wkBeN2mknWfCaYD90okNAjhG97xOBmh5EL3y5dSjM=; b=gyqciA6i/mJasUIygwZqT91L2RbW+6l4OPQaxt0zuF0AL5S3f3tBNiZj0MPm7hSnfh 6clUfr1NIs2Li/E/e9VgOh0AJeM6on0arofnNyZSrQPSo9W4RpItqzYbO2uBBRCH8O7r NAPnZd1lKCz/JXLTAfgENF1VCRtHTtZmDI1DPTqkU26XIS8N9LiLURuTcIq5XshKFPCR vhVM7TOv+21aPYw6C+PRhra7d22qRyBf9Z1T5IVXRefXyzRG/tL0Z2FjuMWS7LT0HPmB AM/Skj2oXcVgWw1kzy5FI3G5+cn6YfjFkZ5z5p66PM3DaqFozKI6tIhqwsfntp6Zp4ho ogpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702688040; x=1703292840; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I0wkBeN2mknWfCaYD90okNAjhG97xOBmh5EL3y5dSjM=; b=ZEtRGCTrAFjlW+hF1j7OfRcc/1UD4ZhnueZ6oV3GeDqxYuW7gYbMi2rKJSXjY0dhYR mfEz6wyFzTIwiguJcFQzXQZ1WiIc56IF1o2GTf6U8kBHgMwGNEnvgKJcvWPNee0U3Bio +Y2NKO53JzwR2BI12SM2oUvOgoF11po8i2+ENN1xNtH3hehV3CctmLhjlR8oL6Rw5DuY MQOjcqZTxXPnBtsk7rXvARTPrfd6ASYqtQo/L5sAKAiy/0WOdqqBRGJ+SnevQzOlVmPD uLeHl1TywqW0VxdpX1ANBz4kRkkmN13OIHtcRc/H4d98EBSwU9XJfy/ydwNoMYAoRKKR vcSw== X-Gm-Message-State: AOJu0Yx/KaTsG9jW/H4ecF5xoD7wzW9iUuLhZO6b7Z5FHDvcB9nV5cIx 0e1irjkncRAwwHoOqv71v+I+oi3l0fWzIS2J0wk= X-Received: by 2002:adf:f609:0:b0:336:458b:38d with SMTP id t9-20020adff609000000b00336458b038dmr2405362wrp.115.1702688040032; Fri, 15 Dec 2023 16:54:00 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231215091216.135791411@infradead.org> In-Reply-To: <20231215091216.135791411@infradead.org> From: Alexei Starovoitov Date: Fri, 15 Dec 2023 16:53:48 -0800 Message-ID: Subject: Re: [PATCH v3 0/7] x86/cfi,bpf: Fix CFI vs eBPF To: Peter Zijlstra , Ilya Leoshkevich , Martin KaFai Lau Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , X86 ML , "H. Peter Anvin" , "David S. Miller" , David Ahern , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Arnd Bergmann , Sami Tolvanen , Kees Cook , Nathan Chancellor , Nick Desaulniers , linux-riscv , LKML , Network Development , bpf , linux-arch , clang-built-linux , Josh Poimboeuf , Joao Moreira , Mark Rutland Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 15, 2023 at 1:33=E2=80=AFAM Peter Zijlstra wrote: > > Hi! > > What started with the simple observation that bpf_dispatcher_*_func() was > broken for calling CFI functions with a __nocfi calling context for FineI= BT > ended up with a complete BPF wide CFI fixup. > > With these changes on the BPF selftest suite passes without crashing -- t= here's > still a few failures, but Alexei has graciously offered to look into thos= e. > > (Alexei, I have presumed your SoB on the very last patch, please update > as you see fit) > > Changes since v2 are numerous but include: > - cfi_get_offset() -- as a means to communicate the offset (ast) > - 5 new patches fixing various BPF internals to be CFI clean Looks great to me. Pushed to bpf-next. There is a failure on s390 that I temporarily denylisted with an extra patch. And sent a proposed fix: https://lore.kernel.org/bpf/20231216004549.78355-1-alexei.starovoitov@gmail= .com/ Ilya, please take a look. > Note: it *might* be possible to merge the > bpf_bpf_tcp_ca.c:unsupported_ops[] thing into the CFI stubs, as is > get_info will have a NULL stub, unlike the others. That's a good idea. Will clean up unsupported_ops. Either myself or Martin will follow up.