OSDN Git Service

USB: dwc3: debugfs: Add boundary check in dwc3_store_ep_num()
authorVijayavardhan Vennapusa <vvreddy@codeaurora.org>
Thu, 5 May 2016 09:07:08 +0000 (14:37 +0530)
committerKyle Yan <kyan@codeaurora.org>
Wed, 25 May 2016 00:57:04 +0000 (17:57 -0700)
commit4a09bafb4c62aa505152edc7e777f6f5cc965510
tree6c417d43ce8e76c0f7a4a5d8ab699956162d91c9
parent3cc4528523e000c7ac541acc76818d6396dfca48
USB: dwc3: debugfs: Add boundary check in dwc3_store_ep_num()

User can pass arguments as part of write to requests and endpoint number
will be calculated based on the arguments. There is a chance that driver
can access ep structue that is not allocated due to invalid arguments
passed by user. Hence fix the issue by having check and return error in
case of invalid arguments.

Change-Id: I060ea878b55ce0f9983b91c50e58718c8a2c2fa1
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
drivers/usb/dwc3/debugfs.c