From nobody Sun Dec 22 03:50:52 2024 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 4YG6d91TdCz5hyP9; Sun, 22 Dec 2024 03:50:53 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6d90xHDz4GgV; Sun, 22 Dec 2024 03:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734839453; 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=3+ftvBT4SPTMlwPXA0vHYcIL1yPBO9+7s0KZFJGXpvc=; b=adOMC3A0IcdgzwGWTWXwUDD8xw6yb2NIbrRagSyecyGMvz8ante3/AMzqEGJMM++7WUxFB bMp3dGeVTTXosFgbkc9rwGWZ+PN5Y/7mPksLfg5VIk4OmQ6vgPET41yZkJc68BG1UIV3Lj JVp3XNEzVf+xtbtX1/kMNhxqDso8n5pAgfCdzGpWwIEKRJ7Ap8Bv189iBNSNOhhPUbvZyN uesVvIIgwvr7W+GV5OCA2dQHxQ9UpUybdXKOEz6tCxb5L+vyHoQqp4qRFM/TN4s3Jt5AJ4 rbVmoghJytIQ14uzE5QE+AAnVHyem9P+Vb6iPY90I7I2Donh+PvN/fK2WzVsCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734839453; 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=3+ftvBT4SPTMlwPXA0vHYcIL1yPBO9+7s0KZFJGXpvc=; b=HBYIHBK/tV7mGayyEYjrvbVNMFs1MP23FiRm+nQI4qzJ5OAMlBQf6d7nO4e8dao9iyghO0 O7iiWAG/rCjB9zP1Mwjg52+8LgI3h7ufn1TXD5lzhHoaEWDrssinx9s/cjdVWAO27L9lwU 9yQpH7gfbhSsLIB5iTEabq11fq/yILl+Jth2eKE1byMHzeiuUxpSuUiSpvUx6n0eTfLnlX vI2hYsQs1jQ+30MyB6l9ZybvPpL+glzPfkuDdXQbISC/OOumFQdV8NBCaP4rMEF8yoyDWW VoXafs3dKJust2sFwF3MsMU4Gj427Q0ntYKGDwhgfIh2t9BaCRRXPy5ArbQRXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734839453; a=rsa-sha256; cv=none; b=Pq/BF8SX5IuolQqJPJyztJMxV/c+5zn3wTNJt40laeSiAyZFAgS79qOpy7ncyG2wZRVTmp nZ2s6MzUTFY3BwQQi11vH/eyWccbcWlVexF2IOkPwMD1d/o3ACsYEJrdQFYoU+ly7LH7sa h7Ssoqbmx9Ga2aPjpu6alsRgHGHEd2HjTHl2GzGXIxH9x4dNC/TPj6c1KKD5wJsqcnkxT/ 4nddDiQu3Cz3PDU/91CqzzmXyXypum1uiayOjwac+/w4Wus5jBtW1mzGQExtMKdLNurIab qI2Iu655wMgOc+4WoB85EgjEaUsj3YtR1T12sV2YZC8evZabWnxmpJV8pY3OOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4YG6d90XPfzs3n; Sun, 22 Dec 2024 03:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3oqbH081848; Sun, 22 Dec 2024 03:50:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3oqV6081845; Sun, 22 Dec 2024 03:50:52 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:50:52 GMT Message-Id: <202412220350.4BM3oqV6081845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 05abe2c9076e - stable/13 - uhid(4): update ugd_actlen in USB_GET_REPORT ioctl 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05abe2c9076e35c353c755702e6cf4a6ea59eab7 Auto-Submitted: auto-generated The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=05abe2c9076e35c353c755702e6cf4a6ea59eab7 commit 05abe2c9076e35c353c755702e6cf4a6ea59eab7 Author: Matthew Nygard Dodd AuthorDate: 2024-11-18 04:15:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:49:07 +0000 uhid(4): update ugd_actlen in USB_GET_REPORT ioctl USB_GET_REPORT ioctl is documented to update ugd_actlen on return with the number of bytes copied. It does not do this. Reviewed by: wulf PR: 282790 MFC after: 1 week (cherry picked from commit 0b5d86b38ae9aec92ef96b9227a404a2df3c9234) --- sys/dev/usb/input/uhid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c index f6447dd0d3c6..03279669b000 100644 --- a/sys/dev/usb/input/uhid.c +++ b/sys/dev/usb/input/uhid.c @@ -633,11 +633,13 @@ uhid_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, default: return (EINVAL); } + size = imin(ugd->ugd_maxlen, size); if (id != 0) error = copyin(ugd->ugd_data, &id, 1); if (error == 0) error = uhid_get_report(sc, ugd->ugd_report_type, id, - NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size)); + NULL, ugd->ugd_data, size); + ugd->ugd_actlen = size; break; case USB_SET_REPORT: