{"id":2197229,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2197229/?format=json","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.0/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260217132936.2736916-3-kavin.gunasekara@arm.com>","date":"2026-02-17T13:29:36","name":"[2/2] virtio: rng: Handle oversized return buffers","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"34cb67ad159083cae2dc7fa24a7357682d089989","submitter":{"id":92658,"url":"http://patchwork.ozlabs.org/api/1.0/people/92658/?format=json","name":"Kavin Gunasekara","email":"kavin.gunasekara@arm.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/1.0/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260217132936.2736916-3-kavin.gunasekara@arm.com/mbox/","series":[{"id":492428,"url":"http://patchwork.ozlabs.org/api/1.0/series/492428/?format=json","date":"2026-02-17T13:29:34","name":"virtio: rng: Handle oversized return buffers","version":1,"mbox":"http://patchwork.ozlabs.org/series/492428/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2197229/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=fail (p=none dis=none) header.from=arm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n dmarc=fail (p=none dis=none) header.from=arm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=kavin.gunasekara@arm.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fFglT1s6dz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 18 Feb 2026 00:41:09 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id B73CE83E0E;\n\tTue, 17 Feb 2026 14:40:41 +0100 (CET)","by phobos.denx.de (Postfix, from userid 109)\n id 9227883C32; Tue, 17 Feb 2026 14:31:08 +0100 (CET)","from foss.arm.com (foss.arm.com [217.140.110.172])\n by phobos.denx.de (Postfix) with ESMTP id 9F14080325\n for <u-boot@lists.denx.de>; Tue, 17 Feb 2026 14:31:06 +0100 (CET)","from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A3B371477;\n Tue, 17 Feb 2026 05:30:59 -0800 (PST)","from e142508.manchester.arm.com (e142508.arm.com [10.33.11.66])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B14EB3F632;\n Tue, 17 Feb 2026 05:31:04 -0800 (PST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,\n RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,\n RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","From":"Kavin Gunasekara <kavin.gunasekara@arm.com>","To":"u-boot@lists.denx.de","Cc":"sughosh.ganu@linaro.org, xypron.glpk@gmx.de, bmeng.cn@gmail.com,\n trini@konsulko.com, sjg@chromium.org, kavin.gunasekara@arm.com,\n andre.przywara@arm.com","Subject":"[PATCH 2/2] virtio: rng: Handle oversized return buffers","Date":"Tue, 17 Feb 2026 13:29:36 +0000","Message-Id":"<20260217132936.2736916-3-kavin.gunasekara@arm.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20260217132936.2736916-1-kavin.gunasekara@arm.com>","References":"<20260217132936.2736916-1-kavin.gunasekara@arm.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Mailman-Approved-At":"Tue, 17 Feb 2026 14:40:39 +0100","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"If extra random bytes are returned, truncate and use the requested number\ninstead of returning an error.\n\nSigned-off-by: Kavin Gunasekara <kavin.gunasekara@arm.com>\n---\n drivers/virtio/virtio_rng.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/drivers/virtio/virtio_rng.c b/drivers/virtio/virtio_rng.c\nindex 90a371a59cc..c6de62142bb 100644\n--- a/drivers/virtio/virtio_rng.c\n+++ b/drivers/virtio/virtio_rng.c\n@@ -46,7 +46,7 @@ static int virtio_rng_read(struct udevice *dev, void *data, size_t len)\n \t\t\t;\n \n \t\tif (rsize > sg.length)\n-\t\t\treturn -EIO;\n+\t\t\trsize = sg.length;\n \n \t\tmemcpy(ptr, buf, rsize);\n \t\tlen -= rsize;\n","prefixes":["2/2"]}