From nobody Sat Dec 24 08:37:03 2022 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 4NfHTq5qNrz1HSmV; Sat, 24 Dec 2022 08:37:03 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NfHTq4bvfz3PGk; Sat, 24 Dec 2022 08:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671871023; 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=AERSqMRcRCKEyvOKF1Xj3Bvd6Nj/I/m/61pdsVN2Z9Q=; b=Ab0ZfetWjtSUN73f75VQhu9jH5dcxn+k3OostFMZ4oeo9zZ53fYsf47J8QG7vdpX/YciJL QBPYvZfNR99ZQMpO8eA9SjqFGqTqE5YH47hSyLAC9sdzH4jpMKapqKFlt6SE/TZdREnpfl Ny0n0GPqX1ZRJvoOcwlBBF1j0WLdUgGGO75z5HGEDvSE8NBPY76py9pyp2QAFbsiNt+PDf jtV5FIRnsORr1NfdkyKZQo5Ecd8Z8ntWow/LOdvyZfrYeWxHYh82z+ZhWfW0WOctBEOEXR 5DGKt3iylDSX5vgKI1DiRj1ZM5OS2Zs1Z5YM4XtDEaa1ohaPommc23FBQax7aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671871023; 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=AERSqMRcRCKEyvOKF1Xj3Bvd6Nj/I/m/61pdsVN2Z9Q=; b=no5XqRmcF+ALB6wVRmiJuficUyDTfRAV0PRy9Asj3+2TNYFFEpKztjT0ppQmFq4pf/7psv rlF1qt8+f0iSN0G6mI9VKdPKW6+3H5ZoQwbqEewRlEDLiqLb07wNu56r7HiIk5QuxTYG93 2WYXh2Tz1QNS4tYcJZIsKx0FHbqInwUs0dBUM35+glZuNoIFwzWy8w/n/DQOcpifvHzsY2 9xij0o9KB2RO+soMbC3wPxL+AtzZ2dbnZYAdvv4NeJAd0WDy/LpsZeC0C8kMbFeGaBfgaV fkh4CIzUUqsk7Rj3yDs19UqVmyEch4hv+RpAktBp8nT/wjqyBm71a150P3iVQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671871023; a=rsa-sha256; cv=none; b=HA2FluzrWrv76ntlpfm3+alML/CCKloZFvqIHZibZM4h5drSjA8DXam1RqlgpTJ53ARV+P SGgCBh2Xv0ylOV73s3MLgmsREI8nyIKmw8jcPebKrCMRnLCVoY6H0Hariz2hLIXO/JPhLO 56dK5Sw8XFzhzxuk4KKZqQ+bpShymBTP5H+p9ivquywCNngikxJQnP9j4E7XDGF3wxyk/i aJZxXVxn+VA1srrwVyd1Wui22bxn4QZppXS6n2qzfpsPZ+C6DrWa9G3a8IBRzQyDYQpAtC Im7G0o+eJrnNzVAgn+tfONtAQygnDoFXkKtYd02J7CnQhHk4yo46m80t953yNw== 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 4NfHTq3Ddyz16Wh; Sat, 24 Dec 2022 08:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BO8b38W083504; Sat, 24 Dec 2022 08:37:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BO8b39X083503; Sat, 24 Dec 2022 08:37:03 GMT (envelope-from git) Date: Sat, 24 Dec 2022 08:37:03 GMT Message-Id: <202212240837.2BO8b39X083503@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: 0b62641d0d61 - stable/13 - usbhid(4): Be more restrictive about what requests are allowed from user-space. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0b62641d0d617eb783c4d7f7457d0f6bc48a6bd0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=0b62641d0d617eb783c4d7f7457d0f6bc48a6bd0 commit 0b62641d0d617eb783c4d7f7457d0f6bc48a6bd0 Author: Hans Petter Selasky AuthorDate: 2022-03-03 09:24:02 +0000 Commit: Vladimir Kondratyev CommitDate: 2022-12-24 08:33:27 +0000 usbhid(4): Be more restrictive about what requests are allowed from user-space. (cherry picked from commit fcca9fd98ce40d586e3b0147ba880b9104589269) --- sys/dev/usb/input/usbhid.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c index ed76f6291a11..3b7886f0fada 100644 --- a/sys/dev/usb/input/usbhid.c +++ b/sys/dev/usb/input/usbhid.c @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR usbhid_debug #include @@ -694,7 +695,9 @@ usbhid_ioctl(device_t dev, unsigned long cmd, uintptr_t data) sc, USBHID_CTRL_DT, UGETW(req.ctrl.wLength)); if (error) break; - + error = usb_check_request(sc->sc_udev, &req.ctrl); + if (error) + break; error = usbhid_sync_xfer( sc, USBHID_CTRL_DT, &req, ucr->ucr_data); if (error == 0)