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 12ABF2E3B08 for ; Tue, 7 Oct 2025 15:22:04 +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=1759850524; cv=none; b=QZs7d2JGn8YWCOmPLOn1O9MSOgyt8GqFPZ8Zyzm+kJqb089J8G96ocYdy7fchIOUci7LTq0NlkaqXpE+5BHseOcgloceaED6On0wM0Uffy03UsR7IWaI1GzDQi2orDHnAipNTn3Y7zN8Bl4dC974b200NIToGK6z/XwxzSK/3Jg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850524; c=relaxed/simple; bh=6fgb9p87EbO4x4rZv0+mRWPNEnT7DSLFg4iHMo27LzM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VPyKt91+9ij55bhpz/h+nu1v+aFM+rzmHCRxhhEAXYqaPkGB2HD6FXtuu9LpW3caMxd+HYkTGx3cXcrF7xZdiLfijFVXwcBJZz/HcN9iqo5km2afdM5AmKaXXMPNn1Pxxm2uUWM0MfC7CB5SGllsOQ3+1C+3RL+J+JTHwasWht8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0Oj5O1E1; 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="0Oj5O1E1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9403FC4CEF1; Tue, 7 Oct 2025 15:22:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759850523; bh=6fgb9p87EbO4x4rZv0+mRWPNEnT7DSLFg4iHMo27LzM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=0Oj5O1E13YKUTxa3SOOfUmjVdJGABuvu1a5I/vt8nRCgH43qTifTVBv4zCH6kmX1F a4zdol0OvwHVtzDPPWOc/DUxv4UTuwXqbBfITmjQA4i2B9WCI/jOy7iHtkBnqaO4WG jl0WVlHLKXHETt3oi/Qsqic0TfyWkcUd13qtpyX4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53649: perf trace: Really free the evsel->priv area Date: Tue, 7 Oct 2025 17:19:54 +0200 Message-ID: <2025100718-CVE-2023-53649-0a4a@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=5809; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=W/KqZKp2o01S8JubaB0UZI0Z5nuhexQhfSgZgd8CaVU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlP9ctyCyWusc9bbtnJc/7tK+415yfo8r4Ik814Wjyj+ OHM3Cl7OmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiVnMZZjFNr23Q35lkYrN4 Y8u9xeH1WyUuTmGYXzRxtm3cNu6NolLRUTH39d5HhmRaAgA= 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: perf trace: Really free the evsel->priv area In 3cb4d5e00e037c70 ("perf trace: Free syscall tp fields in evsel->priv") it only was freeing if strcmp(evsel->tp_format->system, "syscalls") returned zero, while the corresponding initialization of evsel->priv was being performed if it was _not_ zero, i.e. if the tp system wasn't 'syscalls'. Just stop looking for that and free it if evsel->priv was set, which should be equivalent. Also use the pre-existing evsel_trace__delete() function. This resolves these leaks, detected with: $ make EXTRA_CFLAGS="-fsanitize=address" BUILD_BPF_SKEL=1 CORESIGHT=1 O=/tmp/build/perf-tools-next -C tools/perf install-bin ================================================================= ==481565==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7f7343cba097 in calloc (/lib64/libasan.so.8+0xba097) #1 0x987966 in zalloc (/home/acme/bin/perf+0x987966) #2 0x52f9b9 in evsel_trace__new /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:307 #3 0x52f9b9 in evsel__syscall_tp /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:333 #4 0x52f9b9 in evsel__init_raw_syscall_tp /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:458 #5 0x52f9b9 in perf_evsel__raw_syscall_newtp /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:480 #6 0x540e8b in trace__add_syscall_newtp /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:3212 #7 0x540e8b in trace__run /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:3891 #8 0x540e8b in cmd_trace /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:5156 #9 0x5ef262 in run_builtin /home/acme/git/perf-tools-next/tools/perf/perf.c:323 #10 0x4196da in handle_internal_command /home/acme/git/perf-tools-next/tools/perf/perf.c:377 #11 0x4196da in run_argv /home/acme/git/perf-tools-next/tools/perf/perf.c:421 #12 0x4196da in main /home/acme/git/perf-tools-next/tools/perf/perf.c:537 #13 0x7f7342c4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7f7343cba097 in calloc (/lib64/libasan.so.8+0xba097) #1 0x987966 in zalloc (/home/acme/bin/perf+0x987966) #2 0x52f9b9 in evsel_trace__new /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:307 #3 0x52f9b9 in evsel__syscall_tp /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:333 #4 0x52f9b9 in evsel__init_raw_syscall_tp /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:458 #5 0x52f9b9 in perf_evsel__raw_syscall_newtp /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:480 #6 0x540dd1 in trace__add_syscall_newtp /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:3205 #7 0x540dd1 in trace__run /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:3891 #8 0x540dd1 in cmd_trace /home/acme/git/perf-tools-next/tools/perf/builtin-trace.c:5156 #9 0x5ef262 in run_builtin /home/acme/git/perf-tools-next/tools/perf/perf.c:323 #10 0x4196da in handle_internal_command /home/acme/git/perf-tools-next/tools/perf/perf.c:377 #11 0x4196da in run_argv /home/acme/git/perf-tools-next/tools/perf/perf.c:421 #12 0x4196da in main /home/acme/git/perf-tools-next/tools/perf/perf.c:537 #13 0x7f7342c4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) SUMMARY: AddressSanitizer: 80 byte(s) leaked in 2 allocation(s). [root@quaco ~]# With this we plug all leaks with "perf trace sleep 1". The Linux kernel CVE team has assigned CVE-2023-53649 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit 3cb4d5e00e037c70f239173bdd399a7e6040830f and fixed in 5.15.132 with commit c3bc668581e71e7c3bc7eb1d647f25f8db222163 Issue introduced in 5.14 with commit 3cb4d5e00e037c70f239173bdd399a7e6040830f and fixed in 6.1.54 with commit 62dd514c34be63d3d5cae1f52a7e8b96c6dd6630 Issue introduced in 5.14 with commit 3cb4d5e00e037c70f239173bdd399a7e6040830f and fixed in 6.5.4 with commit 27f396f64537b1ae48d0644d7cbf0d250b3c0b33 Issue introduced in 5.14 with commit 3cb4d5e00e037c70f239173bdd399a7e6040830f and fixed in 6.6 with commit 7962ef13651a9163f07b530607392ea123482e8a 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-2023-53649 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: tools/perf/builtin-trace.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/c3bc668581e71e7c3bc7eb1d647f25f8db222163 https://git.kernel.org/stable/c/62dd514c34be63d3d5cae1f52a7e8b96c6dd6630 https://git.kernel.org/stable/c/27f396f64537b1ae48d0644d7cbf0d250b3c0b33 https://git.kernel.org/stable/c/7962ef13651a9163f07b530607392ea123482e8a