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=1796228130; b=tPkCPJz0FHWbzo3Ctoz+GWs9dbyABMZRSoCK4IgXSVf/c55hqgrQjQmDBrB1J2yC7twE WQIfQ3l16ImwXV7NkQwvehEa+r+AUXSXSvjxBT3kdXtiG69+eHig3JdFaa4KmpBqL32kT JmxKjevodEDYWdqczSUbjIZvGnWSE+vuNqBZqI0f01xZVYiCf4iqz9iaOZmHGu9NZS20O KXemHzubvrIsnqlkry6mQo26BzfD4bvWUXh7+zy9ijN4j64xFuiwvEGfOpnzTikC50k9g GX8uqUQeMo4TBO19IINXzzUTcHOAKwAvXVxofZbiAaBY43UQg+zLmDyLwjvMlH10sSQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796228130; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=qtrpnrbN8hat9mnxKSGz+pkagXaKMFGcvDJrZl4dX9o=; b=1gF3DOfqeAgkRe5MNdbL6CSUHoSWEY2UTE6bOW9goOF8lw6HSskvzVf3vfAog81D/bOG s+Ev46LuXauVViaurNIuq7Ju3fZRww87fPJ6KoTfLKxXvQ1rkv8PCl3RjMiotdJ0a7Pkh 9/Ynw5CZhclC8iyk3stOdNxnSe9X7UVn667iM9dJawnQkUWlCxK6TZHo9ONgB/w+VupNI fwmjN9H+XdyM38YNxf2xSI/WSncAVoasvaFIJRicnXYnocJYDUYoePhFEEhMs1b48uN2q J/+6Zrk6fN0NtCMZ+tQIVvJ5Wi8WJce5WNyu/2Ga35UM3eDcYX0XGRe0w6y/jiVVEPQ== 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=pN2O1hIJ; 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 40407606A31A for ; Wed, 2 Dec 2026 16:15:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=pN2O1hIJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BED81F00925; Wed, 2 Dec 2026 16:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796228129; bh=qtrpnrbN8hat9mnxKSGz+pkagXaKMFGcvDJrZl4dX9o=; h=Subject:To:Cc:From:Date; b=pN2O1hIJrXWhXrB7AcJ4K1fYgs7v4cv+x47l6VCVJ7f7oI7Sjmmnavj/erbSV5o3f ayp3INDiUDC5A2qKwvoxHDEHsJ3sLLSuwsAUJQ+qTgC2LMShq1ZFlIqqKNnji80zRg bngYEj0h9vDdUwhH5Jn1pxfMPSvX3GCkXCFxJ2a4= Subject: FAILED: patch "[PATCH] tracing: Validate user addresses in faultable buffer copies" failed to apply to 6.18-stable tree To: kylebot@openai.com,rostedt@goodmis.org Cc: From: Date: Wed, 02 Dec 2026 15:21:46 +0100 Message-ID: <2026120246-immersion-rebuilt-0b60@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x c62206dfe9c80490de8cc2d211fb28eea4958240 # git commit -s git send-email --to '' --in-reply-to '2026120246-immersion-rebuilt-0b60@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From c62206dfe9c80490de8cc2d211fb28eea4958240 Mon Sep 17 00:00:00 2001 From: Kyle Zeng Date: Mon, 9 Nov 2026 21:44:11 -0800 Subject: [PATCH] tracing: Validate user addresses in faultable buffer copies 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 diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index bffba5e27086..70b3c11ac166 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -6298,7 +6298,7 @@ char *trace_user_fault_read(struct trace_user_buf_info *tinfo, 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();