Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8525221B192 for ; Mon, 15 Sep 2025 14:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757945171; cv=none; b=fQXIts3Sh432TD62SBSmAVWa1WQT4Hewfd7Wg9z6ueay8ftusMV0XrwzQDFH3Xo268n+mmBbu9LhXoPLl3PUZwesUZIwPWHp/EQz0iJPLfHQaqwAat0mtP7iicWriHRZ6TIdKXJV2XSJ+ZEd5roaFXpAw+vQSI8ZMSAGHAGvpsI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757945171; c=relaxed/simple; bh=PCi+N+Jz9lGOn43CTAtnyBuvR5v5T7S9YkPg1Zr+p6I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KnQwxacYM1nUNzO7defeBUfod/KOqbH/IB9I7ucuOedgvhjOW3P+G3Vza/3CM1F7feHRYacyOX0AG7+uBS9OkSd+jYQ13R2N+4kNzzMalUKWCZoVf7AFtJwHtQuf54sBE+nlmwfNBd71eVYKB7vcMsKoC/jOItJCBPPxa8QE2X8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HQc9/236; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="HQc9/236" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90CE0C4CEF1; Mon, 15 Sep 2025 14:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757945171; bh=PCi+N+Jz9lGOn43CTAtnyBuvR5v5T7S9YkPg1Zr+p6I=; h=From:To:Cc:Subject:Date:Reply-to:From; b=HQc9/236eNEL+6Xnv0Hu/fLNNm4j4FO3t8stTa7TAQwuCTtCk807DMoe8G5Iq96/7 Adq8HtPYxjzKv8uQ8oigiA6Necz36rUOxoYQFPDleSNGC4VM9B+N1LukH3NGOLMPqw I3P8Yct+jepb6WNTlKC+Xyg++qQEjjWteBbvNTB0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50255: tracing: Fix reading strings from synthetic events Date: Mon, 15 Sep 2025 16:02:03 +0200 Message-ID: <2025091550-CVE-2022-50255-c5ec@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3402; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=SgLqOlbtXDK2jA5r70Ngl8L/DUB0hId4Vg+Km7xJ5SU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBknZPyuBKp8sefViv/aFx4z8Wllx07tCJOER4XJV9ztv 66ZrcLcEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPZ955hvh9vaqDh3ZwQ284o Huf/cmxK27ieM8yPbGMvWHVituMq1dkxJzWaxN44x2kBAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: tracing: Fix reading strings from synthetic events The follow commands caused a crash: # cd /sys/kernel/tracing # echo 's:open char file[]' > dynamic_events # echo 'hist:keys=common_pid:file=filename:onchange($file).trace(open,$file)' > events/syscalls/sys_enter_openat/trigger' # echo 1 > events/synthetic/open/enable BOOM! The problem is that the synthetic event field "char file[]" will read the value given to it as a string without any memory checks to make sure the address is valid. The above example will pass in the user space address and the sythetic event code will happily call strlen() on it and then strscpy() where either one will cause an oops when accessing user space addresses. Use the helper functions from trace_kprobe and trace_eprobe that can read strings safely (and actually succeed when the address is from user space and the memory is mapped in). Now the above can show: packagekitd-1721 [000] ...2. 104.597170: open: file=/usr/lib/rpm/fileattrs/cmake.attr in:imjournal-978 [006] ...2. 104.599642: open: file=/var/lib/rsyslog/imjournal.state.tmp packagekitd-1721 [000] ...2. 104.626308: open: file=/usr/lib/rpm/fileattrs/debuginfo.attr The Linux kernel CVE team has assigned CVE-2022-50255 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit bd82631d7ccdc894af2738e47abcba2cb6e7dea9 and fixed in 5.15.75 with commit d9c79fbcbdb6cb10c07c85040eaf615180b26c48 Issue introduced in 5.10 with commit bd82631d7ccdc894af2738e47abcba2cb6e7dea9 and fixed in 5.19.17 with commit 149198d0b884e4606ed1d29b330c70016d878276 Issue introduced in 5.10 with commit bd82631d7ccdc894af2738e47abcba2cb6e7dea9 and fixed in 6.0.3 with commit f8bae1853196b52ede50950387f5b48cf83b9815 Issue introduced in 5.10 with commit bd82631d7ccdc894af2738e47abcba2cb6e7dea9 and fixed in 6.1 with commit 0934ae9977c27133449b6dd8c6213970e7eece38 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50255 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: kernel/trace/trace_events_synth.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/d9c79fbcbdb6cb10c07c85040eaf615180b26c48 https://git.kernel.org/stable/c/149198d0b884e4606ed1d29b330c70016d878276 https://git.kernel.org/stable/c/f8bae1853196b52ede50950387f5b48cf83b9815 https://git.kernel.org/stable/c/0934ae9977c27133449b6dd8c6213970e7eece38