From nobody Mon Nov 18 04:32:45 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 4XsF992F09z5dqF8; Mon, 18 Nov 2024 04:32:45 +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 4XsF991fpKz4lB0; Mon, 18 Nov 2024 04:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731904365; 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=/bWYCPM3sAoLD1bFFrU1eRhjFfWApOegXJHMXVFJ+po=; b=gbFH+KhuRHvIFr6eZoT9fYU8AsgSeAPnVAxS8ZrJFtyK/UY6Lk4TY8IZ3w8YUegbLVVFU3 hLy3LNCJMGzhSFmfg2FkKEYVO8m553PGv5gsehGIDbDws74Dr+97hKZa+tklDdHyi04Pb6 /YRoLbazE9bCUZDzUdPImPto64x2MojFzChzgOrVsAt0L7iRhXnH8mERX0PZD8StfmY98q HveAtBxelK2WABHvyuT39UHIZCQ4LfOxPpy11JP76hUQ+PNTZnRER1Qqn4Q8jcwXRn921Q yOtIYWieZSVEpzEAN9wAUrGbyNkCS1QYS7oKbRQZktSw25AyRhBNnSG/kJJL+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731904365; 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=/bWYCPM3sAoLD1bFFrU1eRhjFfWApOegXJHMXVFJ+po=; b=OVm0Fd4rXeYbRwJ3cWxfgNpzq0o+JnXqheMCULp34Rz+83B5/miQM8BJ2DUt/q0QNM5BNP Ps/OHW6WeaogWdwUjEZObQLgqEXT4oQPWYRX1NaZVKQBlPDwRUipNK+CWQqUwXv26X7+GP 5Z+BtB+46PS9fdEZz6kwfxXzJ7LCBYNXrE+cH1Z32Wba9egQw2pGhUWDfBY6q5Mw/IDVxO IGzn0rZ2qmI+rnZA6iVIoG8xZa5O/VXzN/nmoDbLjNmaqYyA/qbQQfAek6Ob0TFqEE+wpF k+eT8i6aTu9b5MfyCJ3R6eM5r3/23yp3PhCIAM8aMW+BZ80KjZg+aX7XCWObVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731904365; a=rsa-sha256; cv=none; b=DoPBUqy9uQ5dQJBlSe68w0LjHEJ5Y4boMfXY2XvaIUaBSC33kmuU6DQ2ZIMk7O8YfoOKoP HT/fmXhCHcsjap0/UAeSLHgLPbXi03QGVQMzfHKfXTWruk0i5KJ2eYc14gqd4wiG5MUFVT XqHo+f2a/jRqW9EoVGG4WLJsRJ8vqIp2Jt/3AYwCMXcvOSC3Q9dQhdZxpK4np8mRD4+/WP 6o5EVDzZGJ481mpzcguoapzoGbB1OVnsWB+F0EAKj8WFP80R5RRNpCUkLo1CsIwY/Bjs6h TL5P1VyJqMWH4huOIZi/fPYIfbTL7FU4TUuxPDUCcpdAKLXPxHGbfQq69NAURg== 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 4XsF991F6nzMNt; Mon, 18 Nov 2024 04:32:45 +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 4AI4WjZw051088; Mon, 18 Nov 2024 04:32:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AI4Wj3i051085; Mon, 18 Nov 2024 04:32:45 GMT (envelope-from git) Date: Mon, 18 Nov 2024 04:32:45 GMT Message-Id: <202411180432.4AI4Wj3i051085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 0b5d86b38ae9 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 0b5d86b38ae9aec92ef96b9227a404a2df3c9234 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=0b5d86b38ae9aec92ef96b9227a404a2df3c9234 commit 0b5d86b38ae9aec92ef96b9227a404a2df3c9234 Author: Matthew Nygard Dodd AuthorDate: 2024-11-18 04:15:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-18 04:31:24 +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 --- 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 863e04f4e52b..098ec4364df7 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: