From nobody Fri Jul 24 15:08:01 2026 X-Original-To: dev-commits-src-all@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 4h6BFL5PVrz6mHBf for ; Fri, 24 Jul 2026 15:08:06 +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 4h6BFL3j6Mz3TRL for ; Fri, 24 Jul 2026 15:08:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784905686; 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=RX92jyvDvHPJuZvj/7axFbnRbSjpZ5CZ3Y9LWwekoD/i4xmYDh5izhcvR/FcV7rQfAfz+p 1QL3tAf7jVDQ+x0/AmRZEqskovP1/JhZQkTxNfco/ZTgfXwlql1tcM66Vhqjkcq6d74u3F 9dB4v1XGNWChlSQcF8NBKgS8/wQbvPI9nczA3EZk/D15ThkK/ktmY9LuklXVoUPckejcwn O7zuCDVVrbmgAX6sQ/jsUQqJXPacoI4AnzKDzutKabUSlye5TvLZHcRO/DDDvRRpNVmzRx Vw26+M+KEP/ZHoAcoguwbOGTNJoo8dRe9pq2lvFMjYTvLaAS3hgXbGktGsMJQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784905686; a=rsa-sha256; cv=none; b=nC0jeu5Pas45IWbD7pvoz+IXfDAnVnUcbmEHKxUZjo6+IcFDWzLXTmuq51ns5ZVkNa4wYs E5Di295jmvcShG6wQl9Xg6J+CnqxFeTkQjFRM9fwLgAchvttTHGPGJT9IzTkD5MqBr36Ly OaOo9s56PaV0TPl0rzrRYS4Dxn8r2Qiph/4l35GjcjdPYByhyqmfy9X9PJvnc0NcNKbA26 YzeS7/ZlafArvqNuLsosldaOCtQACZIY0nDDwtgwDCoQOgmga8zduABUXeckLUgy/c8nHt n2aWO7AyJgqNocjy9dcIvhb/Qk0u5F3Nvw8Y/ZqgJXuedRyDvHT2tqGTEovSwA== 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=1784905686; 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=NMdRmXlKo7LnaZAm/gvQIXR64sri9K/6KTWRoCyytHBdy8oICWWlUs7zlkAbnFCcwBlMcf qmGWSe6nLAjsPfZrOmI453OnWb2g+QlaaXk+1L38qCt2DlRXZAJCUXAwgkolX7yPKWwHSw fg3rvFAiUxVPiavWBU1EeZ9oec2IC9YK24oEAMAnllYBtYFBmSs4PErWOS42KR+sxnK0+t tq5dOIZ0CETLz80xC+zTTx9XAB1MiYaqFg1P154ZVvKXRVyjvYvXF0/D3AYOmdfasowAVq zNJrMFqhvnt4TGl95DB+k5KVVg9gCDKubLCg28zNsZ8WTbjnl2e2GZFHkgThIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h6BFL2hzHzwSm for ; Fri, 24 Jul 2026 15:08:06 +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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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)