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=1796552570; b=0WSyGpsxxhjbPYmVla0oCSxUuYYS5Z62ff554QdZzSKg4fOy8ewubxhcqcAKw1c3BweM 84rC6hMdSAOqr5yWsDAY1cLzqi/m8M1tq7svySO1x0osfWVKqWMUNuaDAaAGlyM1I1OhQ 3AHmmbzsxapdlmlqo1yO1ykMCW92rNxtV/sicQDqgyqa8MFkM7hBKNOXsttn9afXGcpT5 2repi53NOCHge3ayJ73YeWT6fWoDkDIeZgh4boUM5oGCQ5/aozglhCjR8bFZUs/xC6wjy B12YhF0zNJAcEDemp7r5FDkjxtWxdGQdytpVUAWe55tRs7gqzEBIvoDEFjP2KmzL1sQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796552570; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=x1/I9arc1PWNQverJIQoWjp61bctX6zq4eF3vRBdzjU=; b=TmdjWdQyCn7+FQD9Vt/5v0eovejutP2PUxom87K5PrwsH2323WYVqTC9AXZcKnbTBeZN k5vTFBSEeDEMJ48cMqpLiL0KUaKt9csDGnFwYNI/d1Xal/0ibMlwtiAia7OUi/UvH2VtX x715Cj7eymuObySPrQ+IW5n7WRpOfjv2Ncy1d9Lx2v0nF2OEK3x3dggO1AQYmXsCPOk39 7TqtN+ACcCEu1D3r15xaQqOnizgTmchRKWbI/cqVh7l7YiH05XFSWl60SSA2avo2ynzyr k5emFITD1jLz/kdSNvDeP8NwiF6/1/99dACUIj1oEdiQr21YbbPcQJuYcNQPlHtXI6g== 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=kbFdbyfH; 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 04CBB606A31F for ; Sun, 6 Dec 2026 10:22:49 +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=kbFdbyfH Received: by smtp.kernel.org (Postfix) with ESMTPSA id 773B61F0092B; Sun, 6 Dec 2026 10:22:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796552569; bh=x1/I9arc1PWNQverJIQoWjp61bctX6zq4eF3vRBdzjU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=kbFdbyfHXxeA9NmHFkvgf9cQPK/azypCn+LKIA8dOSR/TKoX6yFlRZfZOKU2RT+Rw aIG/nt32HhIfy0Uwji91/rmmXCIH0Tj0A2eGLhRtYaKjmaVNFrFk2FkmIjbXWc8Hfq SmNuerJIQ52pHXTYJK3fADQhFpr6c1gS50WqFsgOF370DzqbbgiwfcQNQhmVBrnopZ CAAbVM4GxaarGcmPO8YQe23Rpl62W48PKnsEoe9JUA+s9RpLV+pcQbOrGHWhIcZLee kgP1KDOfThnPRvYelfcTiDF7ipkaUsqPQCS5M1CnYVqi9KZXD7ww1bCzg1K6o5lqjC SKKxT8ZKRmfLg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] usb: typec: ucsi: clamp returned message length to buffer size Reply-To: sashiko-reviews@lists.linux.dev To: "Matti Paksula" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261206100349.15-1-matti.paksula@gmail.com> References: <20261206100349.15-1-matti.paksula@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Dec 2026 10:22:49 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] usb: typec: ucsi: changelog overstates EPR guard in ucsi_psy_get_voltage_now() -- commit d79e541be7b6f8eb79ed53d7ac0f79ab1feb4722 Author: Matti Paksula usb: typec: ucsi: clamp returned message length to buffer size This commit clamps the length returned by ucsi_run_command() to the caller's buffer size when a destination buffer is provided, and adds an upper bound check against con->num_pdos in ucsi_psy_get_voltage_now(). > Clamp the length returned by ucsi_run_command() to `size` whenever a > destination buffer `data` was supplied, so callers never observe more > bytes than were actually copied into `data`. Also guard `index <=3D > con->num_pdos` in ucsi_psy_get_voltage_now() so an RDO object position > beyond the stored PDOs (both during port registration before > ucsi_get_src_pdos() has populated con->src_pdos, and for EPR object > positions > 7) cannot index past valid entries in `con->src_pdos`. [Severity: Low] Is the commit message accurate about guarding EPR object positions > 7? In include/linux/usb/pd.h, rdo_index() masks with RDO_OBJ_POS_MASK (0x7), so it only returns 0..7. For USB PD 3.1+ EPR contracts, 4-bit positions 9..13 have bit 31 truncated and wrap to 1..5, still passing index <=3D con->num_p= dos and reporting the wrong SPR PDO voltage instead of 0. Consider rewording the changelog so it does not claim that EPR object positions > 7 are currently caught by this check. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261206100349.15-1= -matti.paksula@gmail.com?part=3D1