FROMGIT: USB: gadget: bRequestType is a bitfield, not a enum

Szymon rightly pointed out that the previous check for the endpoint
direction in bRequestType was not looking at only the bit involved, but
rather the whole value.  Normally this is ok, but for some request
types, bits other than bit 8 could be set and the check for the endpoint
length could not stall correctly.

Fix that up by only checking the single bit.

Fixes: 153a2d7e3350 ("USB: gadget: detect too-big endpoint 0 requests")
Cc: Felipe Balbi <balbi@kernel.org>
Reported-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Link: https://lore.kernel.org/r/20211214184621.385828-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f08adf5add9a071160c68bb2a61d697f39ab0758
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus)
Bug: 210292376
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I7e708b2b94433009c87f697346e0515d93454f48
3 files changed
tree: 525599739ecca5362f02ac33ba92a484144cacde
  1. arch/
  2. block/
  3. certs/
  4. crypto/
  5. Documentation/
  6. drivers/
  7. firmware/
  8. fs/
  9. include/
  10. init/
  11. ipc/
  12. kernel/
  13. lib/
  14. mm/
  15. net/
  16. samples/
  17. scripts/
  18. security/
  19. sound/
  20. techpack/
  21. test/
  22. tools/
  23. usr/
  24. virt/
  25. .clang-format
  26. .cocciconfig
  27. .get_maintainer.ignore
  28. .gitattributes
  29. .gitignore
  30. .mailmap
  31. Androidbp
  32. AndroidKernel.mk
  33. build.config
  34. build.config.aarch64
  35. build.config.boundsan
  36. build.config.common
  37. build.config.common.clang
  38. build.config.cuttlefish.aarch64
  39. build.config.cuttlefish.x86_64
  40. build.config.debug_api
  41. build.config.debug_hang
  42. build.config.debug_locking
  43. build.config.debug_memory
  44. build.config.floral
  45. build.config.floral.common
  46. build.config.floral.common.clang
  47. build.config.floral_debug_api
  48. build.config.floral_debug_hang
  49. build.config.floral_debug_locking
  50. build.config.floral_debug_memory
  51. build.config.floral_debug_memory_accounting
  52. build.config.floral_kasan
  53. build.config.floral_khwasan
  54. build.config.floral_no-cfi
  55. build.config.floral_performance
  56. build.config.gcc
  57. build.config.kasan
  58. build.config.khwasan
  59. build.config.no-cfi
  60. build.config.performance
  61. build.config.sunfish
  62. build.config.sunfish.common
  63. build.config.sunfish.common.clang
  64. build.config.sunfish_debug_api
  65. build.config.sunfish_debug_hang
  66. build.config.sunfish_debug_locking
  67. build.config.sunfish_debug_memory
  68. build.config.sunfish_debug_memory_accounting
  69. build.config.sunfish_kasan
  70. build.config.sunfish_khwasan
  71. build.config.sunfish_no-cfi
  72. build.config.sunfish_performance
  73. build_floral.sh
  74. build_sunfish.sh
  75. COPYING
  76. CREDITS
  77. disable_dbgfs.sh
  78. gen_headers_arm.bp
  79. gen_headers_arm64.bp
  80. Kbuild
  81. Kconfig
  82. kernel_headers.py
  83. MAINTAINERS
  84. Makefile
  85. PREUPLOAD.cfg
  86. README
  87. verity_dev_keys.x509