From nobody Thu Mar 03 09:25:48 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 4275A19FAFDD; Thu, 3 Mar 2022 09:25: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K8QZh6PPdz4b7L; Thu, 3 Mar 2022 09:25:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646299548; 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=XvTZ8JOSGR6//zvK2A/5Hp8FgXby4czVeg9BU076MUQ=; b=NSD4NGZA1uuhTPS1ZNIWu9L4Aju0ej0j/MMRZ6L19/hhjRxFv7BGYvMIwinxrMTEruhIeS NtxbnAlRrpUBzedwk9sddQs38+uGrhcM5MJ4KBISFDVQRxuFUHnCWC6RyPwI8qtariO4nw jdGgEMKXjAXNudKjhMrRJMSSRXK618NcguMxA2rBDjnRa3lHYLsZtvb8AbdW10lMrIJjbx EAzHeOZkoL2ivgtOb8/+WLaORhs7fG1gPEjUO8KImTm/KByH4XQN5UZljuq5UNpyxtnp+I aCP2aTUOshEwen4SGbK+dTTJ+Bx7ATbQT6k4SEDGW+Aj7JYZtbEb0gRiOTwh2w== 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 992A6151D5; Thu, 3 Mar 2022 09:25:48 +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 2239Pmtk092943; Thu, 3 Mar 2022 09:25:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2239PmKD092942; Thu, 3 Mar 2022 09:25:48 GMT (envelope-from git) Date: Thu, 3 Mar 2022 09:25:48 GMT Message-Id: <202203030925.2239PmKD092942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: fcca9fd98ce4 - main - 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: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fcca9fd98ce40d586e3b0147ba880b9104589269 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646299548; 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=XvTZ8JOSGR6//zvK2A/5Hp8FgXby4czVeg9BU076MUQ=; b=sNi5BtThUCCdGNF5j5nVCXeE2/EbULjaa6FF7P1VCU50VnT5Aq8+Wlv9V+ot3sPOhVH2uh EyhXKkuOw9sx//TzIRw/A3NWdS24q5nMYRwQ+RLrVGeaoJWKdLKXnLQWdHpHrLWCQc4owB kyB2YiXBvG2bVZcdt1/bXyjzO6+yVg3o3MQPpHtO0+8JKwUY+QUuLckjqh4qPaQ1RZfzUm Bp8s+cBl8K+1TrEguvQbtlJ9Yrc8SQ7nEgm1m2S6hoYX4TMZy0l653Fa/pQj6OqRdvBQIY Qg0btsJyagh+furh7eljHPzoZZlyG/QoHbs7dLB32bzpWwKCQvWa6nk2Kd9vmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646299548; a=rsa-sha256; cv=none; b=pQlU1ZeVEE3aeMneubGbW8si2bXJ3OQ5e4YuMFfomGOAw5HuXxpLV2ryauWC8j2UGWAVsB KMEC2alBAgiTV6kWViYz6KYnfB69EJaEJpl9MCMUfO/M6dhhUiGMojTJuxXDOFrpNMZjGB TgmAFpXm2+DEPxNB0tcdwUe0I9Z7U3YbDArmReUmM0Gdndc+L90mHwY/0minwdzJTuC+QS tKgb5WoatYvI5mf4sqX7kI+iZpRdamiXbTv4r3QLYilA0t2CtLPsF/bDK6tU4wf4U1usRs XvVYlXmKsDMvrYLsEpNjkheO8GRtCy2/gdMa/l7RT6uSMYIUSDB/lErXQLRb5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=fcca9fd98ce40d586e3b0147ba880b9104589269 commit fcca9fd98ce40d586e3b0147ba880b9104589269 Author: Hans Petter Selasky AuthorDate: 2022-03-03 09:24:02 +0000 Commit: Hans Petter Selasky CommitDate: 2022-03-03 09:24:43 +0000 usbhid(4): Be more restrictive about what requests are allowed from user-space. MFC after: 1 month Sponsored by: NVIDIA Networking --- 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)