From nobody Fri Oct 04 03:26:19 2024 X-Original-To: usb@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 4XKYqJ4Jkmz5XmT9 for ; Fri, 04 Oct 2024 03:26:20 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XKYqJ0xbJz4j3C for ; Fri, 4 Oct 2024 03:26:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728012380; 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=jHyq6ELppsLeF/9+C/MyYq49y4P2GgonfCHtaH4psYk=; b=GdjnL1Oa6WtxivQ5VqjdsKNbRgOotJxyn78Gf3Bae14w+DWnyoHWatHq8IXU3H3O9sZU76 I1F/QzeWTinzaDHGoDCdFaqKEKJogvPs9ub09wtAtwvVpSOLbc8M3w40TLwt5zXVT21D9O +XXKFbsbO8d/KnZr+NbFlmvdag6ssgz1BxLwTmWbbolyRlzB+fw2rhydwDGpxxNVd/BO9f Qjb+P2Vn2GPNGKrUihYYu8ZBEwhufAdGc3iPd1rO6fpSkWxT1E2J9nkS3zl38aCS2QVLp7 MbS6iQz6bXKm+JjhUJXElbeBeuqkWEKLSFFwPT6SOzMQhtSNsoO8ujcbOH1WKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728012380; a=rsa-sha256; cv=none; b=im/iwkRU8wvexuejBZTZbbkCdjUizgK0QDWW52NEXvtyOpD6WaWlYKiUGNtJGQHxq9TTot I/phpCH9OeY+pVpmUv+gHzISA92QO3IhjHd2IJ7Xgswo2mlSElX872XMac3sct/DCXv2wN bBxMa3Jtysppjy21MFL7dooIxMKUyu9rfO2ar0wuhtGnr2peKoEBqhi9z0Cm1R5INuAVB6 PaQ3YwspOhVtzM9kD8fgARBTTAG/G7rFG/gcjtWh/3MuOeZajOAt0CY7y2aLRBXvneS4f4 jiEmalVJjRHa6j5QQd7VugI7SXWpWOgfRbF22Z+5ZL9ZkAmFv5G+8DRFJ9E23w== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XKYqH5p3fzJ5F for ; Fri, 4 Oct 2024 03:26:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 4943QJYK091738 for ; Fri, 4 Oct 2024 03:26:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4943QJ4U091737 for usb@FreeBSD.org; Fri, 4 Oct 2024 03:26:19 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 281843] "check for in-use endpoints" code in usb_config_parse() is missing an increment Date: Fri, 04 Oct 2024 03:26:19 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 13.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: mhjacobson@me.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-usb List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-usb@freebsd.org Sender: owner-freebsd-usb@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281843 Bug ID: 281843 Summary: "check for in-use endpoints" code in usb_config_parse() is missing an increment Product: Base System Version: 13.3-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: usb Assignee: usb@FreeBSD.org Reporter: mhjacobson@me.com sys/dev/usb/usb_device.c:846 (in usb_config_parse()): ``` /* check for in-use endpoints */ if (cmd =3D=3D USB_CFG_INIT) { ep =3D udev->endpoints; ep_max =3D udev->endpoints_max; while (ep_max--) { /* look for matching endpoints */ if (iface_index =3D=3D USB_IFACE_INDEX_ANY = || iface_index =3D=3D ep->iface_index) { if (ep->refcount_alloc !=3D 0) return (USB_ERR_IN_USE); } } } ``` This code is missing an `ep++`. See the similar loop below, which does have the increment. I'm hitting a panic that seems to be caused by changing alternate interface index while transfers are outstanding, which this code is supposed to preve= nt.=20 I suspect (but don't know for sure) that this is at least part of the probl= em. --=20 You are receiving this mail because: You are the assignee for the bug.=