From nobody Fri Jul 24 15:08:01 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h6BFF5wxFz6mH2H for ; Fri, 24 Jul 2026 15:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h6BFF323Mz3TPH for ; Fri, 24 Jul 2026 15:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784905681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DdAekDzk02hTPu38DRfTFlAEeXLp9FQ0QjLm5AasdzY=; b=BdZuFNla7hAc+4fK8nNEzpYf49+tgQHNOc21/pEsep8An52+3efuaR6R+20u7aeX92Tveo Y0Sss673S8LUMclkA/Pgjl1XzK4QLPpsT8984weyCefuitoa/PUalZzDENdAEAEIDbksGQ VaUHaRjZhjzGHCKP+E29OEAiXamzCDSOQi0gCd4mj6cwCY7QTe2GhUXGz6LFN4UV52m/zu f54+AhARJRaRZ0a++DBia+v9720CLPbSh+MeQHhkXRkLbYmRWLa/Gsz67nu/BlaUygnBS9 Ep9muwk9ud9dmTqYzH8dR29T6AbxMgPYKtJYPx+syckQ/FFPqCdajxpBazJC3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784905681; a=rsa-sha256; cv=none; b=CuqbbUNFYAPLmO7p8zn/zs/z3pWFfkFdAdpM8kMNyRRg7LiAaeoH72YsbwDNpSXWeRU4P0 dgqCCaRDLXXC5CvlsYfYrh51b3D6XKmrbCzZ8bR2SXwonDYmEvt1ePcMU9e38EQUd6yDBT 142geo+WVtghD1moeuvYYDPlyjlPGTgBe8EjWhRSM4NPZA/gz32dOaw4gjyeYmYsJpmqYm 3x2iLdVmYFVv5s/4LQipz0g3IS6aY/UzkLOp7m3knEh2zQm5a+d3Vfg2hKDCBcQbbgr4Cj PDOYw+pkMBPihz3MDDwrDg3yFttvXELoxziY3Wzx1uetyHN8ZUMPB7onFy0FQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784905681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DdAekDzk02hTPu38DRfTFlAEeXLp9FQ0QjLm5AasdzY=; b=SztZHHIY8ZMemw0HlKHXmxr9YArg1QTtk6aCAjOcAcfJdZo0+EezyQyafqVvrYJh6f3bED QXxCLlkZ9MTe3gDCU65QjQujs2kwuKm8uIpBwsjbGgq14X/bYWrxq5XCEPCewuJwZvtxoA DnFOiQ1QHPnncaBfPu7DyGMkA1j1LnTX4LD+4yEUbAxai+Sw1kS5q37bQPgvg1mBME3J7J yaYbh7nck6jnf63BqJDZ9VtuWmg3fhrwk/jbITSSeAwbI2Wz22Y4QSgUtT5HBBkDoiSSTJ hkdNuSeQardWBPIbNFNX+bRhVrFv2jvsBSR/CFbFB/l+akUrvNnTAfY1PzQRfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h6BFF1zWRzwSl for ; Fri, 24 Jul 2026 15:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36047 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 24 Jul 2026 15:08:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 8468152509a0 - main - uvideo: fix step=0 infinite loop and int overflow in fbuf_size List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8468152509a0dfd73e69618af2b1d7f9cbd366f7 Auto-Submitted: auto-generated Date: Fri, 24 Jul 2026 15:08:01 +0000 Message-Id: <6a637fd1.36047.5626ca1a@gitrepo.freebsd.org> The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=8468152509a0dfd73e69618af2b1d7f9cbd366f7 commit 8468152509a0dfd73e69618af2b1d7f9cbd366f7 Author: Baptiste Daroussin AuthorDate: 2026-07-24 14:30:07 +0000 Commit: Baptiste Daroussin CommitDate: 2026-07-24 15:07:50 +0000 uvideo: fix step=0 infinite loop and int overflow in fbuf_size Prevent infinite loop in uvideo_vs_negotiation() when a USB camera reports step=0 in its continuous frame interval descriptor. Cast fbuf_size calculation to uint64_t to avoid int overflow for large width/height/bpp combinations. Reported by: emaste --- sys/dev/usb/video/uvideo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/video/uvideo.c b/sys/dev/usb/video/uvideo.c index 7c7268454ae2..bb52232e153e 100644 --- a/sys/dev/usb/video/uvideo.c +++ b/sys/dev/usb/video/uvideo.c @@ -1744,7 +1744,7 @@ uvideo_vs_parse_desc_frame_buffer_size(struct uvideo_softc *sc, * width * height * bpp since dwMaxVideoFrameBufferSize may be wrong. */ if (desc->bDescriptorSubtype == UDESCSUB_VS_FRAME_UNCOMPRESSED) { - fbuf_size = UGETW(fd->u.uc.wWidth) * + fbuf_size = (uint64_t)UGETW(fd->u.uc.wWidth) * UGETW(fd->u.uc.wHeight) * sc->sc_fmtgrp[fmtidx].format->u.uc.bBitsPerPixel / NBBY; } else @@ -2037,6 +2037,8 @@ uvideo_vs_negotiation(struct uvideo_softc *sc, int commit) else if (frame_ival >= max) frame_ival = max; else { + if (step == 0) + step = 1; for (i = min; i + step / 2 < frame_ival; i += step)