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=1796381376; b=zafIHCxHv17oFQ+Tzc6gJc+bg95iE8Zz29sCF9DSt1Y6nueeSia4KvjlB43FrQBgBwU6 /kz8I9b165W8Hg9A+aScbp44w4xTOY/fzjhBFEdC6w8zW/CTyBmIDMgAuNFc1YKpgmOp5 jvKkAfsUKta3fA6jRQ2+IxHeS//1vrvqgKKHWZhagnKVnHeHlP6HtOU6KDkVYick9WMQl SZEXemuRsfEAykVWqDhLVXPCsOBlHsllKBLb0auXPTtV2DOD62TXCImRrHey+l5hs3FM2 z8bv0kGGbj11k14K6dirPoR6pVOq3RSsaADNfptYpuWfDesin2532xKDDyJWiFZvzpQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381376; 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=yA9gpbUGIoz/8MRrCj3/InBBF00hDNpZMmY9roOQG8U=; b=H8SkxUvZAQv73Y3EKI1h53loNeqWG179pmUEYLoy634pu2Isg/G1T68w7QQTfl7V2zSu +J635jB5vNwm0KxY3G5PqNPPSVZREJE7MkzOoK9d1XCWdDN+o5/nv/+1KbcHkPY9JGa/7 8Oir4IKlG82y1oUlEVLoOBp51YBIiPV+7IRoR4gOzIUYO0ceHd/95iJywyoXg/bDToJ/3 njvSxOwZa5ey6ESYjkBvJydhx6Dk+41nOHd2k+uuNbEEGvhUYr/0/sP4OYKgo+A25yLwM vXoaIK0O1TXKRW3mhQHZNOyK6gp7qD5lvXyYe08cik8lUz5kWop23Hbf/Rw66vaLnEQ== 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=zlTkQsr+; 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 BD4E5606A32D; Fri, 4 Dec 2026 10:49:36 +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=zlTkQsr+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32A121F000C2; Fri, 4 Dec 2026 10:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381376; bh=yA9gpbUGIoz/8MRrCj3/InBBF00hDNpZMmY9roOQG8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=zlTkQsr+uO/pzrMfVR4+qSSiT30DRn+2xzRAVAZ05y09AWe6XuXH0llBHxx7WZ64B SGXI+BTvCVFzg7lV+wUW7/7MIfEApUXOzQS/7mXDvmL4Ro+zvzhZHSYAjDn/gnkyZH ZCY0oBNMOphIMp96BY9oQXVF23N1BBnFgFLniHTA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Beau Belgrave , Steven Rostedt Subject: [PATCH 7.3 677/742] tracing: Do not allow user events to add a system name Date: Fri, 4 Dec 2026 19:09:01 +0900 Message-ID: <20261204100653.046204867@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: stable@vger.kernel.org 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: Steven Rostedt commit 761a77e09577bc7e5fdaff1d11bbff3486a87bf9 upstream. User events currently do not support the addition of a system name, but the parsing does not check to see if one is specified. A kprobe can add its own system name with the following command: ~# echo 'p:mysystem/kprobe_event schedule a=%ax' >> dynamic_events ~# ls events/mysystem enable filter kprobe_event But if one tries to do the same with user events: ~# echo 'u:user_events/test u32 a' >> dynamic_events ~# ls events/user_events ls: reading directory 'events/user_events/': Invalid argument enable filter It corrupts the file system as the event added had a '/' in the name. Until user events support specifying system names, just return -EINVAL to prevent the corrupted file system from happening: ~# echo 'u:user_events/test u32 a' >> dynamic_events -bash: echo: write error: Invalid argument Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261118122520.4a689710@gandalf.local.home Acked-by: Beau Belgrave Fixes: 7f5a08c79df35 ("user_events: Add minimal support for trace_event into ftrace") Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_events_user.c | 3 +++ 1 file changed, 3 insertions(+) --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -1040,6 +1040,9 @@ static int user_event_parse_cmd(struct u if (flags) *flags++ = '\0'; + if (strstr(name, "/") != NULL) + return -EINVAL; + return user_event_parse(group, name, args, flags, newuser, reg_flags); }