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=1796025892; b=RXVjXj95PUmJoos9oZdmhKjCqKHhce6tsJgrbUGciVJNEBOfdQvn+JepTjo+wOhrT4Yq KCX1dYGFJ/r0Y7Arc6b8vtdfUhM0F/7F8mJqjJHWGgSxPbQFYWEE131SKsaMacv0xxkLh 7zhFT0OYREh+opaGhbnp6NYhgb+RWoBPoGOoJDuey267ede1s3W5X7Ya1QDOFg4rg+tlf X+95nLQb07IYzKlRxr7To369Apv5rPkGme2OmDm87g476XdE5revtafSjWALwafowDs7Z RvKmFxAyUAHKLZf7FWPE0fBVhhg3YGGMqsdFoTIqfHXsmQ3pLqumft4eZFpfr+mWHgA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796025892; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Vo/aFqMTubQdKyEvrGRhqoN/GblIjo49QPQhIVQ2s5g=; b=hnkNjmeJ+te6l5RrQTgZ+cUdHPZC3CWGXlbcjgik1j1bB05ZQ6vE+uJKLl+L+Bcml9bB YdKrm8iY3D4eG7KE/WQSKCv1LVBQh42gmejCrqiZDJLCBgk6JwoUjRdenvqN2KLYPBJCl lAs9Kz1Pu0iVd1QUIy8iRQxtGiHkIFiaIHmSZvYawT6CaZGEd+N506Sryc66DGMxXsRSv uYLgUKZeg8h4cmCgZC5mc5jXbRbxYhqzNLLsxmhABxgMNgCJC7yVStTuthVUlWXgvyAbf pZHw3wZpDWnvD1Ev5r3ZiieP44qF3sGgnr9zSRxnLpzi67TwKs03qtliZGhSIyUyOnQ== 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=cpaSyJEU; 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 EB8C9606A68A for ; Mon, 30 Nov 2026 08:04:51 +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=cpaSyJEU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CC981F00899; Mon, 30 Nov 2026 08:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796025891; bh=Vo/aFqMTubQdKyEvrGRhqoN/GblIjo49QPQhIVQ2s5g=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=cpaSyJEUfHMqIRwFuZv16Q1z4SFcSwmvwrI1R7BDz0pkcp32/fxNGmeQOg5wGycC+ JJI/fMYMCkjTn+T1RhU0imouctyaRpLRa6eA00tCGv56LBzL1VQM8fNnafzMLQVN8u 1WDeq26AyZU69DlywVSd44jAFlzEKEw3npD17nbqey9kx4z/labdFyX3qjBlp11e+x ShDt1JKNIEqIHWsYEStEyW4bdydFGiS8RituAEZGwL6VE6G7x8/224/HyoMSrwIz8D Hb72f4VQZVgMFhkeLxTLYhDglQNT+1jjCkPItC3xux5+gh3ZMSDFd/lOR6XSm8XV2j 5sgYOBRlwlhSw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] leds: ledtrig-tty: Fix memory leak in ttyname_store() on timeout Reply-To: sashiko-reviews@lists.linux.dev To: "Priyanka Mani" Cc: linux-leds@vger.kernel.org, lee@kernel.org In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 08:04:50 +0000 X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > ttyname_store() duplicates the user supplied name with kmemdup_nul() > before waiting for the trigger work to complete. If the wait times out, > the function returns -ETIMEDOUT without freeing the duplicated name, so > every timed out write to the ttyname attribute leaks that buffer. >=20 > Free the buffer before returning on the error path. >=20 > Fixes: 76675f69bed5 ("leds: ledtrig-tty: Replace mutex with completion") > Cc: stable@vger.kernel.org > Signed-off-by: Priyanka Mani Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/ee85f4614c5e030d763= 6ad60502249478d3c6469.1796024108.git.priyankamani2100@gmail.com?part=3D1