From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796184427; b=S1vzrMlWlU5OJ/H3bWwmk376LjGsuxR+XyV5NwSGFkrM7DE4UA0Gl7d0kgOmG8vEs9QF 0xG/6cpB2FPZon0N79obfaY/imuzO5zawPOrkuun/Z90AS4zxteX2t1KcN2ycjPAf6xFy /v7biSzSaWisyTOAL25vQgn4V0SwUx9ZZ4obsHqpkctWz9XMu8LfzB+Ey8rXLsIFzhADK +Koz1Wdevrwaz1Gyk0+Uzv7c6UlOJjhiFFTk8ZSvRiNk1RY0hoKYCrIRKbQ+3yHZDkWeS MI6ukc4ct+MN+35swnHLh+7q6umn/8BRStVTTuNdrSIDgq0z5tCmhGXEZe3cWSW02JQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796184427; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Content-Type:Date:Message-Id:Subject:From:To:Cc:In-Reply-To: References:Content-Transfer-Encoding:MIME-Version; bh=ICAIu5rsNFAEp+o5alrfqdl+znI9wwcst/4cqHXUf6U=; b=GI/B22A/BuIHqQMYZDtK/bifjHr/qSkrcZJIn6edFNd2nF+qC/VkTHfoWrI88hlfUXSV yfpGcKxX+61TTatsv6pHBmUT5M5Tjcn/UHSlUU30e38MsJp3E2m7OH6+I/TBvfSGhDlMp jcV3Jk7dLJGmalbHDBz5sgMmvfUzqF4k2bglZvaxySDRMJAP92Qc19br7T1wA9ieoWW5F qyEyti017UlecXiV8iXHr66lyEdBiVgy0aGyvI0/dWtzXeL6Maxt/uEbApadaVr2gGjfB skz4QpFQFx9NuZKwaa4wLE6L7W8GFJ/EeLwCFQJvBn4ExZDlCPN7Ryor2tN96ezLasQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XHjqw7LS; arc=none smtp.remote-ip=209.85.210.178 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02027606A322 for ; Wed, 2 Dec 2026 04:07:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 02027606A322 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XHjqw7LS Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-8a05b210703so5909886b3a.0 for ; Tue, 01 Dec 2026 20:07:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796184426; x=1796789226; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:references:in-reply-to:cc:to :from:subject:message-id:date:content-type:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ICAIu5rsNFAEp+o5alrfqdl+znI9wwcst/4cqHXUf6U=; b=XHjqw7LS97Jf6ow0mBEQacQDjPFfNoOCJ1DEpKaIWdZbjptrkLaKjWCTLMQRA6Jiqs GvhGHMRibNLz1l0tN7yeme5B8HFYdRuK+jl2EbPwbrz/9ighFcY6vD3UJJbsrBpFy5Xj JYGb99XVJs5sWaN9K/4NLt7RPuZlvBRyo+6jrJ6NzWDnxCdqx1DG9hAeASSv1Aay/KRa mIxOkOb/fOjTSDgn05YvOJoyN7aaNAyBTysiP66wOY1biU/D2c8lPSMygyxYmKQzWDEK kFrwoTILFkjwzLVCdNaDLPKOyyQjBh7JC0HjxQHHb3qwz/eO/ZWm1rD5Li7BlrS4z6pE ngtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796184426; x=1796789226; h=mime-version:content-transfer-encoding:references:in-reply-to:cc:to :from:subject:message-id:date:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ICAIu5rsNFAEp+o5alrfqdl+znI9wwcst/4cqHXUf6U=; b=Yqq7/GLiHg6NlfqHNkTzxxhlJqTb1Y3uzBpDMn1hWu3SPhbk7QoNdP+YmfP0MAqLKd LVu9xY/yFApZJbF59UUWwhLHtNdCB42SFJ92AEp6h4EcRyjxdjQv0E+EAdppFhzshvH6 BKeyMUtiok4BmeSqbq7er8gpdpppgZ97EdJWJBerNZcMZir0i14xnm4++ehN/wtGWpc/ eSXfwJAdE2v3PmyRABe/BpAbF//Xvp6ISLURb132KlgNUb77ZnY1pOhMn1MKsSTDat6F vflXcqFpwkhXDu69/bNmb3NnqUePpchH2mKh7+wYwd2wQWBudb+wQcoOlfT3MEPUi7hW y9hQ== X-Forwarded-Encrypted: i=1; AL+hErHGAxnu0wqv7KlTZnTUsV8aLti3MTxDFfT9vQg4oLrwSMDcT7ysKPTQ8Vyf5//NjG2AakR0zjoEdcHxfz0=@vger.kernel.org X-Gm-Message-State: APuU4Z+UIjBAMT1CIjfJi2E0biLknuD19BFCpPMa4ahcZM4sDsrF+/+A F1PtLDR/DFSJNABUZP4GksQPwUwtiebl6MkPCZ5PrQMKF0McxdPY9yNL X-Gm-Gg: AZFdTZfrRfJrE9VT2n8Y3n9vQq4SIbdFX13tGpDcweHsJbWi1s7TpUNSLXqyHLH2y95 tVjEJNrprJYHM7sA3KMv6M66qtVvyVCoj0EfOfgJyDQMBNiJptIqtwhbaxr3JkGoTH2IYBrFNiC eefJ3MwMFJcozbc13sn6/NLRkQecb17rzqQ1IvN5tvTkJ2JruBEF1VzkBFhnGbLCplvR+exKgA3 AGnPX9i52dLjZehNjA6iUilu3uoFzk3ijCl2ZarB6zZhh0+25hRXTUE9s+on0k+/bqzvfbS/fH0 uDQxEEnqzM+BKPZxMPSQlYCQTJ0RcLRdWJnDwJP22IDModwf/YwfEkyX1497pwViiFBYO6D6Ha9 sD9X4LHcsw5TU4igQNLG2D5IgCcizZCQjXML8fSvuzysKe95nbwNCCse/P1IIl8yT/SlxQnhfme eAVRY7Q+vaD9WcOFKWnvr7JqbqMmyNy9YsboVk7AGMUmwMO2GymVBmDXaeoFHbYBPoex5JsnI43 Njo44oPUuJINtI+FobQHU4tNHYoOtiWpe2I1ZKSgNOQFTflM6/R7IV6LAdfBqW2tlGVSmg/k22E wFawaYZKncBYmxHxVsPValAMtnAMF3kAYRJh/WHaKew6LYQPPzT24Z4lt5nOvbIP80J1xcyMr4H 4B9RNO3nQDHIlI/v7ZoE19zNjUDVgidM1bwQnFLTUbVu7NpBiCph5O90= X-Received: by 2002:a05:6a00:10c4:b0:886:3bd6:fe65 with SMTP id d2e1a72fcca58-8c87b9d0526mr41994300b3a.19.1796184426014; Tue, 01 Dec 2026 20:07:06 -0800 (PST) Received: from localhost ([153.61.198.254]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c872951febsm20735054b3a.14.2026.12.01.20.07.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 20:07:05 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Date: Wed, 02 Dec 2026 04:07:04 +0000 Message-Id: Subject: Re: [PATCH v2 06/12] bpf: Don't read user memory without an mm in tracing helpers From: "Alexei Starovoitov" To: "James Houghton" , "Andrew Morton" , "Alexander Viro" , "Arnd Bergmann" Cc: "Sean Christopherson" , "Paolo Bonzini" , "Jim Mattson" , "Jens Axboe" , "David Hildenbrand" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , , "Catalin Marinas" , "Will Deacon" , "Paul Walmsley" , "Palmer Dabbelt" , "Albert Ou" , "Madhavan Srinivasan" , "Chris Zankel" , "Max Filippov" , "Dinh Nguyen" , "Simon Schuster" , "David Sterba" , "Daniel Borkmann" , "Andrii Nakryiko" , "Eduard Zingerman" , "Kumar Kartikeya Dwivedi" , "KP Singh" , "Matt Bobrowski" , "Peter Zijlstra" , "Arnaldo Carvalho de Melo" , "Namhyung Kim" , "Steven Rostedt" , "Masami Hiramatsu" , , , , , , , , , , , , , , In-Reply-To: <20261202023920.595207-7-jthoughton@google.com> References: <20261202023920.595207-1-jthoughton@google.com> <20261202023920.595207-7-jthoughton@google.com> Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Tue, Dec 01, 2026 at 06:39 PM James Houghton wrote: > + /* > + * Tracing programs may run in any context, including kernel threads > + * and exiting tasks, which have no user memory to read. That's not a > + * kernel bug, so fail before the user copy helpers warn about it. > + */ > + if (unlikely(!current->mm)) > + ret = -EFAULT; > + else > + ret = copy_from_user_nofault(dst, unsafe_ptr, size); The nofault helpers exist for callers that run in any context. v1 had the check inside the helpers. That was the right place. Nack to v2. pw-bot: cr