From nobody Fri Aug 21 14:56:49 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 4hRNgP5789z6qVtr for ; Fri, 21 Aug 2026 14:56:49 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hRNgP3pHBz3nmD for ; Fri, 21 Aug 2026 14:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787324209; 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=4zpj2t+uUQCN0jqg4UjlffRCTDsUgfgd5qVMVV5xoFk=; b=Uortgsj9njE3CDxx7b2PNl24pQezVL1fhtoDbY4F/a3AQB8XbZbvi0UQ6nD83fu5R7bZeZ ya6yqraepR6K5/3C7XVp1473lPWo55AGbRqVQOQYkkQ5WAirbb0X9XtWZy/AC6PSuxnCFY LGj8qM9/3si6UKOGCY7xpsdBf1JYb6Ramdw+zAUE8q+whl3Rxvk3BM3WypLOcYWLHRLdFR EmTGJ08on9nUP4IQJxcq/uSfjyD8mcMYz0aJ4dwoTJtX88HCCQL9O1UquNB9prqm14/W0g tykj3u620+3bkpjqnI//NNOP3zQcC3oQCMStuV2kYRMYjZsjXIO09tWs6YwrfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787324209; a=rsa-sha256; cv=none; b=gyB7tkoV/zsCcIUb8tWr8BIwViP41Vrsgn33Cx31m3OQrDHE6O+G6BxOvLW2G6LDODyP8i /sztiSHQTvIf3gugX74+DKHFNTNzQWyL1N3t+wwBiNsOSJS8R2IBF0ZjkpI61W8Brgs7xF H3npdG6onDLu8eAUW0EISEfBun/xdPb1asugmXQRDsHHPSpYmc1XKATLe9Pi+EaSYkD6w8 0RQ92mZXn+10bQHyWjgy3YTfC6MJeFhTAMejRrf6+/yKvWH8aCk/sTJsAzS0beTUPpiMuy mMonFK3hYxhfZFHedzjhfmXP210Wkl/Y8yrbftDk8TK0XUFBiUd4TKsfHsq5VQ== 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=1787324209; 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=4zpj2t+uUQCN0jqg4UjlffRCTDsUgfgd5qVMVV5xoFk=; b=PwaPoz8OLwnnpzbl0JKbspZ6757jz4dRq8/UPkYNYrgUCEydlk5b0wCbiaG3VsrfKiwgNG rrekLJnq/h0Lf02K2HbqQKaWYwEvT5fdImp9e+Ur38Hq2GIzcJ1yC+RTUJjwH5BL1BFhWo V/CjCoU6jgtqgv60Zy8afXd+i3Xn4O0/KculW3wcXpkIJAX9h7AqBxjKn3/wWdwYPmRbP3 YearTJLeQN9L77093bS1ct68Lq+Geqj3hlG3cots+hBG8flNjxmQpM43oBL/V0pPkrCOJH /qgRALpwITbwTQydVte1faG9/VHCvUltA2DuERcwAzqooq8fTpsRSKO8jM+TPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hRNgP2fKdz17Dc for ; Fri, 21 Aug 2026 14:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37518 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 21 Aug 2026 14:56:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 250db717b24d - main - libusb: Add an XXX comment for possible duplicate callback IDs 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 250db717b24d084c0a3193226a79b73a69fbfe0f Auto-Submitted: auto-generated Date: Fri, 21 Aug 2026 14:56:49 +0000 Message-Id: <6a886731.37518.3145da61@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=250db717b24d084c0a3193226a79b73a69fbfe0f commit 250db717b24d084c0a3193226a79b73a69fbfe0f Author: Ed Maste AuthorDate: 2026-08-21 14:31:25 +0000 Commit: Ed Maste CommitDate: 2026-08-21 14:53:45 +0000 libusb: Add an XXX comment for possible duplicate callback IDs If next_callback_id wraps we could end up with two callbacks with the same ID. I recommitted the original change despite this issue in order to fix the libusb API as soon as possible after SHLIB_MAJOR was bumped in commit 527a82474cb3 (libusb: versioning symbols). It's very unlikely in practice that software will register and deregister a sufficient number of callbacks to trigger this, but it is a real issue to be fixed in a subsequent commit. Sponsored by: The FreeBSD Foundation --- lib/libusb/libusb10_hotplug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libusb/libusb10_hotplug.c b/lib/libusb/libusb10_hotplug.c index ee0fea82a8fe..ae7e8d168948 100644 --- a/lib/libusb/libusb10_hotplug.c +++ b/lib/libusb/libusb10_hotplug.c @@ -375,6 +375,7 @@ int libusb_hotplug_register_callback(libusb_context *ctx, handle->fn = cb_fn; handle->user_data = user_data; CTX_LOCK(ctx); + /* XXX This could result in duplicate callback IDs, and is UB. */ if ((handle->id = ctx->next_callback_id++) < 0) handle->id = ctx->next_callback_id = 1; CTX_UNLOCK(ctx);