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=1796460395; b=vtErlqq764loCsRAW1Lnh3eCB3G1XA0uF1to45APsbUOqMF+3g97Mz4b3JZWjdDPGdXi B2plG8+3S6DLFvizqksJCNzFtTwLsQIZulklHERFfquGTe3cocL2nOm7xjssJosJ0U4em hXf8x8SWfuCShlfgWiEvP9QFKAtl5GPRjQ9MA03IsqA0+BIbhq8CvMbFvZXw90FizpS1Z cYT7/+y+OMH0XharmlCLGjrTRgKyJBf2YXcnF02rQFUo36jZjaqQFnsCIn/w/ZMToWAA+ Yxo+qYy/FM3J/mnuR9Ggk8MpzMFK34HY2fafXClsGsWJCb01nXW7YobBLqNAajLxDOw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796460395; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ddhPqs4ukRViXldhW88ccee61xQpVGdU/m+OeMRpN5c=; b=Vr7nQAcg4mqhYtGc/zVlOVXm3ukxDfDO8TvO8p/t9AblAnYplPKh0M8St/UC2Ad460F2 Itsf8SL+qzfPyv7ZBSBgpvUpQfWWjuX5HuPSySSz9QfILgv/5tiGeUExyjsolrgrY3Fl0 2rXYWCULp3HUSJmlqOiGlBbmZmubvZ8oWM4bTYRRQCquzXLlKVkbJa69tqdVqZN1VwNrU DuQokIrmR/cU6/kU+477JTnuLdcK+Mnd8iC+pZEoAT3HrYZQm/3UzAszRA42PQMTia09U M2vVSk6FVL9O2HucZ/CVKtBfamfJJ3MEo9aUMo9UaVN7ivcsHQTGUzhTtqbFwe1DSVQ== 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=Y1fR5fMP; 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 65679606A696 for ; Sat, 5 Dec 2026 08:46:35 +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=Y1fR5fMP Received: by smtp.kernel.org (Postfix) with ESMTPSA id E51D51F0092B; Sat, 5 Dec 2026 08:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796460395; bh=ddhPqs4ukRViXldhW88ccee61xQpVGdU/m+OeMRpN5c=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Y1fR5fMPsfDgQWwxn2ydu3BIZ2BRzblcXs1OtCYaTxQlkDdygqnQT3ls5R8YFFNuT cQl57jQ9gE836swFACkJJ8S6kbZw7VUKUgOpbGZERETzWK85vY3zhvAzKIAb0S69fC zftTwEgeEYY9dY+UHKcsrQXPNY8rmAUVpf9e14+C/ZmJ45jOJvK6MIr7wKHNESSZiP qI1hRlDzDMKBCFL0XKqzUPcEJS0SlOUzKkDLKXp0XzATcX0uBzEqyYjHLcjZDW7lzC Ho/w08MzMmeEjcjWH8uCWy9+VcX7q7x9BtL+EHyvNJxsFKdDRspffbL+TMdga3+gUY EbWo8oOA1Jt7w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] powerpc/pseries/hvconsole: Do not read past count in hvc_put_chars() Reply-To: sashiko-reviews@lists.linux.dev To: "Praneeth Balasubramanian" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261205083025.2602522-1-praneethb2002@gmail.com> References: <20261205083025.2602522-1-praneethb2002@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 08:46:34 +0000 X-Mailing-List: linux-serial@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] tty: hvc: obsolete bounce_buffer and stale comment in udbg_hvc_putc() -- commit 290462d6849c20919495b48c771bea34f3357693 Author: Praneeth Balasubramanian powerpc/pseries/hvconsole: Do not read past count in hvc_put_chars() This commit copies count bytes into a zeroed local buffer in hvc_put_chars() before issuing the H_PUT_TERM_CHAR hcall, and drops the 16-byte buffer size requirement from the comments on hvc_put_chars() and hvterm_raw_put_chars(). > diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c > index 14c6a55646176..f385978baa9ec 100644 > --- a/drivers/tty/hvc/hvc_vio.c > +++ b/drivers/tty/hvc/hvc_vio.c > @@ -110,9 +110,7 @@ static ssize_t hvterm_raw_get_chars(uint32_t vtermno,= u8 *buf, size_t count) > /** > * hvterm_raw_put_chars: send characters to firmware for given vterm ada= pter > * @vtermno: The virtual terminal number. > - * @buf: The characters to send. Because of the underlying hypercall in > - * hvc_put_chars(), this buffer must be at least 16 bytes long, ev= en if > - * you are sending fewer chars. > + * @buf: The characters to send. > * @count: number of chars to send. > */ > static ssize_t hvterm_raw_put_chars(uint32_t vtermno, const u8 *buf, [Severity: Low] Can bounce_buffer in udbg_hvc_putc() in this same file also be dropped? Now that hvc_put_chars() handles short buffers and the 16-byte requirement is removed here, the workaround added by commit 934bda59f286 ("powerpc/pseries/hvconsole: Fix stack overread via udbg") leaves an unnecessary 16-byte stack buffer and a stale comment in udbg_hvc_putc(): drivers/tty/hvc/hvc_vio.c:udbg_hvc_putc() { ... case HV_PROTOCOL_RAW: /* * hvterm_raw_put_chars requires at least a 16-byte * buffer, so go via the bounce buffer */ bounce_buffer[0] =3D c; count =3D hvterm_raw_put_chars(0, bounce_buffer, 1); break; ... } Replacing that with hvterm_raw_put_chars(0, &c, 1), matching the HV_PROTOCOL_HVSI case below it, removes the contradictory comment and redundant stack buffer. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205083025.2602= 522-1-praneethb2002@gmail.com?part=3D1