Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • linux-rt linux-rt
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Arch LinuxArch Linux
  • Packaging
  • Upstream
  • linux-rtlinux-rt
  • Repository
Switch branch/tag
  • linux-rt
  • drivers
  • hid
  • usbhid
  • hid-core.c
Find file BlameHistoryPermalink
  • Michal Kubecek's avatar
    HID: usbhid: Fix flood of "control queue full" messages · dbf698e1
    Michal Kubecek authored Sep 01, 2021
    commit 5049307d upstream.
    
    [patch description by Alan Stern]
    
    Commit 7652dd2c
    
     ("USB: core: Check buffer length matches wLength
    for control transfers") causes control URB submissions to fail if the
    transfer_buffer_length value disagrees with the setup packet's wLength
    valuel.  Unfortunately, it turns out that the usbhid can trigger this
    failure mode when it submits a control request for an input report: It
    pads the transfer buffer size to a multiple of the maxpacket value but
    does not increase wLength correspondingly.
    
    These failures have caused problems for people using an APS UPC, in
    the form of a flood of log messages resembling:
    
    	hid-generic 0003:051D:0002.0002: control queue full
    
    This patch fixes the problem by setting the wLength value equal to the
    padded transfer_buffer_length value in hid_submit_ctrl().  As a nice
    bonus, the code which stores the transfer_buffer_length value is now
    shared between the two branches of an "if" statement, so it can be
    de-duplicated.
    
    Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Fixes: 7652dd2c
    
     ("USB: core: Check buffer length matches wLength for control transfers")
    Tested-by: default avatarOleksandr Natalenko <oleksandr@natalenko.name>
    Tested-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
    Acked-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    dbf698e1