From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.177 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796184427; b=ZbBjr+g8sV7oTbbnDWi67xGoNmQogh8pQ5UJNRO7i4/n83W5CEU5QhiHkf0gQOQFlhN3 dv1Q7/Vbr6HUgCOHjSFu3oMg1++JkS2+AvY6PFvI7nc2LmaCn2JDn3gz5adUGOuGktKiy 50bECz8f19353kBaw7W9cdillyYbJ1uOtuBQAh1BUv9jGtGPixXSuIDG7qKRmhrkyYyJj AZyzHWg7usTSvTikSo4wXMfRAgITqwFtfAnagktfS+jCcJI+5o6RPONqEulH5+sHKsBFk oAGLLuWCDYf4p+fyqTA5nEtWRqtRFSdIuGhUEVir338Wpf78Up9HOXFUJzwuA+HsXhA== 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=h6TsX6/ATyB8gFU6INk8m1xmZQUnmbL+wpLS2HQgyfN+rL5gjRHlHAGTa3TU03dzhySw +VAP1GFyimn9RAa26CGKpnpomU7o1MhAszzTESs4wX+w+iXSO7L/p6c+q0II/ZMjiOASB 1sgnlwFzvk7NbVY81gEtRZfniWgGKaJXYnxQhPhv0c/s4TaTk+hzWBosr5SETpt3UG+ze 4G3rHGdY6RJg+6HWkYQFImeIbXO8aAISxmQ9oTxIIGXOzB64MdMswPe8bRygTMVs0k0ab bSzvWzkze5NzLWXhlQcIpcm5PgTZDtTxywA7cvqzTkhPTsDwhd8c8Rnhp69qILSAqTQ== 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.177 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (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 098A9606A329 for ; Wed, 2 Dec 2026 04:07:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 098A9606A329 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-f177.google.com with SMTP id d2e1a72fcca58-8a070781f63so6006107b3a.1 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=iQXoc0Z5nx54HFl4Xwt4MKZcLL36MOoCM1p8S6T10l0yM1tEA0r/Q8SIEy8ATRubM8 gfpm3rHg9OGvqfjm0NJNUA/U8mRJSxxCQutQWEb6K9EaKZh7waEBK5UV4LksgVnelEzO kF9a0S8ouIllRJBDKKcU+dbr08CY7Zzu1SFFcTPWL9KqQFht+STY2K1u9g2cJYwl8jsd W7bSfinPgP8AtfDjBxA9bCRInTGwsMcoMt6JbGN8ei4OZpQ26P68tlIRyxD8bWzUwAK+ w4BFmbFtFs1R3pGFQDyrJyIXkmGrg8I7UiGMLbdHUA2jrHiDg99XKkG4peOEUZdxqhPS btLQ== X-Forwarded-Encrypted: i=1; AL+hErE6XYPkIDgoUxqdEbhg3AKO4EOWPFq5VDKvRFS+h14Rk9XDHZR/NbdMoAP+rOb6mgzyH/6ZCuBCDJtJmQ==@vger.kernel.org X-Gm-Message-State: APuU4Z8Q+qBHXE15QZTj32WIaIGO2KnZRsVd3IsnG+roHwI4rkUH/w2g eVQQ4oZnpL2P5VTl0p5poW4RbYtRXNSkVQztbRFhkQjwIH5ERJW6UE/l X-Gm-Gg: AZFdTZfByoLQUYEJkBSDtG6A5yeF1eGdhCZQIYfEEbBhHdI5EiMLEKzZoRd00LrHBpk bVH05FpUw2d8pSgS/nP3ovziHSPxANSdm0JaqvP2Kir3C3p4picQRJadOtMZIsae6ngubCvO2ZH g3igRvUIrgZHAsT2GqdlJn7V8YQJgdllhqmiraGPd8ZQxyXHi6ZZx/fdSr6iGhFrXmFlgG2KAZT CphG0oI2PN6fW4KbX27jb6TApQR4Av2yp+4Z6NwSPJ+UBRMW4ZDQFHtiNkmx0XxyiAu40i+Ngnd f1yC4THhKIqYSlHR5xm6KRF/9WFxOaGC/3x393gSo3zJKUqKwvX7wmTjQuvK5IINrIoC371A3Pw fzvFrVqNq8EnpLBAieqkpmE/Rx9qPt1PR7OutWJYOlqxjOwuYy2rszod35L0Fb6JogKgfMjbXMe DM46AyxsD/0tDvU9qCVzwtMZOPZ+dsSBH99y2q0vX7wbyEb/dej0PjZu7ADlHC6JodzPb0b1MRQ ymk9VOkIykz7SAUJlgEBlBjPQhp7viljF0hkISO+/yF5dBKL9MaL8Q2amDa52oq2DPGHOxODtxx ZjdtxFHnrH9mVvUoHwytiv2eWjXwfvHrgU6IRdd4nhrgDttKCIU0RiDPBBTUIoOwhK4UX1zJJX5 4D8niBqKc4VAvERcUUSAr1WCK3tl+Im+vinOZJlaE+o7ge/06ZEhdB54= 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-btrfs@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