From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381388; b=YNBKWUpThcowjs0vUOZFiObh+RRQ26DNuCikFhHI+rrZ563qK2UZT/b9qwULgydVZKap Q0lb/1tNmYDnT0Al9cPqTIRJpYqQI2bWP69gfCXs240ZtyG2TxCOYvnSeYYjicaubtcdk xE1LE3dWNvg8kj6NGGBYPFywaW1BExDbyovI3fJnaVOzQ2aCJnLtkIp6XjbE/DB+m98V2 S0E34sFuJx9qcgnu5nsIonWpMyVRxBDeA8Roxh2RU94BGOhsiTKYzyJUPjfkgduDVXMTs clpv4X6YSVlgW/Lu6SMSNBVcLtvhcyQmXi0duXP39hhj+m/ivKY6h8wSuVEOPBti0Vg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381388; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=6t5QJreHRjtOh6pSkRwi2xO6CBo21PjLGbBWqySwBCY=; b=rxxw3WqSGH4lZz9/fDXqYoohPOy61xuYbFSlOqVG0/F4sipXZjBprv3IA6u9xU5HFBko mYL983kjxooSjvFTIkWp55G/YsGIDKeuz4Kx6VudwY0s/h+LWVeumJErfsNKseRFmjDwA 1QcOOpXYgjIsvJk/4j0wbnomOwZxe/3zCIJ4dyYchWMF1kwE8VNBWsojn85byP0GJtAZM HVPz4vL0Ody+eNMKuhI20aaRIDfQnrNdIitDsaZ9y5eroMw/fxvFiEhX8Jmie41758+f/ 12Lz7pha89+KHgbMXEdF3RyrfIDJFtDZj8kAsrvO6hqEBicqrYxlm841sVCGzfKcwqQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=RLE7eUpB; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 115BE606A322; Fri, 4 Dec 2026 10:49:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=RLE7eUpB Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B38E1F000C2; Fri, 4 Dec 2026 10:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381387; bh=6t5QJreHRjtOh6pSkRwi2xO6CBo21PjLGbBWqySwBCY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RLE7eUpB0nfXYAno7g0efL491yZg3a30vLi7chYnpeZRvtx2tdMmE0ep/KBY9D3Qg Mrpm8rFnvbfGPa+ROC0BvQxo1FgXLyB1dJWvtqxZp+Pl0eCb/+a1O3vemJAX9A2JX+ M16KAZhwg79wn6hzNCyW9JaPXXQmAhfXjorGR97s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kyle Zeng , Steven Rostedt Subject: [PATCH 7.3 682/742] tracing: Validate user addresses in faultable buffer copies Date: Fri, 4 Dec 2026 19:09:06 +0900 Message-ID: <20261204100653.174048385@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kyle Zeng commit c62206dfe9c80490de8cc2d211fb28eea4958240 upstream. trace_user_fault_read() uses __copy_from_user() when no custom copy function is supplied. That primitive assumes the source address has already been validated, but the helper only checks the destination buffer size. A caller that passes an unchecked kernel address can therefore cause mapped kernel memory to be copied into the tracing buffer. The original syscall-array tracing implementation exposed this path to syscall arguments before the syscall validated them. Use copy_from_user() for the default copy as documented. Non-user addresses then fail the copy and follow the existing NULL-return path. Successful user copies, buffer bounds, and preemption and migration retry rules are unchanged. Cc: stable@vger.kernel.org Fixes: 64cf7d058a005 ("tracing: Have trace_marker use per-cpu data to read user space") Link: https://patch.msgid.link/20261110054411.75788-1-kylebot@openai.com Signed-off-by: Kyle Zeng Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -6299,7 +6299,7 @@ char *trace_user_fault_read(struct trace if (copy_func) { ret = copy_func(buffer, ptr, size, data); } else { - ret = __copy_from_user(buffer, ptr, size); + ret = copy_from_user(buffer, ptr, size); } preempt_disable_notrace();