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=1796227547; b=0lz9y/+e2bdCxm0YtxLEYe9NvnTzlvOLpxzi/rN6ZslzZeuFfdwDU7canQhglOlPdifa JcoqIEwjr1sSBbADo+G1jzg0rrps5fplqxy41fN7I8A0V10jyniZp/oXQ3UiKI7YCilJX etge+FWqIhPBtQIvURjW8YedvSdv2U3hJKT6zBdX/CAPDYzpgWN+nmta87dEdejgtdyy/ TJgU2CtUq8mAqSka3lC2IwxzB20LjGTfLiZsadfEAC2OSx+ZiBp+8fpvh2t3ADMbDQqlo kMZmQA+nP+fiLb9gItoIrVigSygrkCOZaIVa3FpynvDgVUzXAmNn8UjrZEL8wwu2Hig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796227547; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=uhdalkK1/UaDKwqzw3WzBeH/712Go+JomNF+NihBl2o=; b=wXqsXi0eAF3SZ40h0/gtxcD+681DcJ0lo7HXY3pndawQ3bP13vtPiDVICWogH211MICo xJLaYNY+g0OilWvvqHTc/SMYwz+QwGzmqC2Q3auvUkkKksH/+hXLPbsiss5Sh1UtnjM+H LO0tmIiUVyFWQKV5kJOfKtScWxozY/eVU8BAGi+xOVKS0UjTX7flxTj/x5i39GiBm0Uop mBBPqXwqNeEyeyBDgngNEd3pu4kIY9sYbMCljsMKbFZhftgscm2TYWh4P9OEmgP9Jt/yX 0CCFGnCDhWbNrnrL5OTzH1B9a9VwtrCZbTc/5qez0RGarsyskv6MF/lGRLXm4k+wJeA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QlqIMqtb; 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 76B71606A322 for ; Wed, 2 Dec 2026 16:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QlqIMqtb Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCD231F00893; Wed, 2 Dec 2026 16:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796227546; bh=uhdalkK1/UaDKwqzw3WzBeH/712Go+JomNF+NihBl2o=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=QlqIMqtbipHcFs92uTuzlaSmEPzPLHP3hYGtuGNY0D6Y0z6tuVqecgEciKubCrxcM SSm4d0c6N8ic2+9z3Z8UmSdfYzE3D7CDDlXPqSB5o99RHONM2PjvQEapKnXTqMMAaE kHrbHu6XYY7Uo3XlhOyFaDWvStBSwd+FsvI6IMDjDkAdftSLSu28MdZ0RbcrgoRHFw YtneCG00g4KPXC+gJqsSK+GvWCbb+nGZzhPcG+g3Fp9B0Bq++WZqziwpkUUBct2vsB 9vPI2RfikJriMK1CWneFdNY2P1F3bm38ASA9MyeIdsmrxOtnmdlX8uOmACoh5bpFTs REiMa3F+jhFEg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] perf trace: Fix heap overflow when -e expands a syscall alias Reply-To: sashiko-reviews@lists.linux.dev To: "Anh Nguyen Hoang" Cc: linux-perf-users@vger.kernel.org In-Reply-To: <20261202-kbug-l947-v1-1-9c324b56cea5@gmail.com> References: <20261202-kbug-l947-v1-1-9c324b56cea5@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 16:05:46 +0000 X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > From: Anh Nguyen Hoang >=20 > trace__parse_events_option() splits the -e argument into a list of > syscalls and a list of other events. Both lists are allocated with > strlen(str) + 1 bytes, which is enough only as long as every name copied > into them is a piece of the argument. >=20 > That stopped being true when the syscall alias lookup was added: a name > that is not in the syscall table but matches an alias in syscall_fmts[] > is replaced with the canonical name, which can be longer than what the > user typed: "pread" becomes "preadv", "umount" becomes "umount2" and > "fstatat" becomes "newfstatat". The strcpy() and sprintf() calls then > write past the end of the allocation. >=20 > Short overruns land in the allocator's padding and go unnoticed, so the > [ ... ] >=20 > Found by an automated code-checking tool. >=20 > Fixes: f932184e282f ("perf trace: Consider syscall aliases too") > Signed-off-by: Anh Nguyen Hoang Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-kbug-l947-= v1-1-9c324b56cea5@gmail.com?part=3D1