Commit 99d2841c authored by Krishna Kurapati's avatar Krishna Kurapati Committed by Uttkarsh Aggarwal
Browse files

UPSTREAM: usb: gadget: ncm: Handle decoding of multiple NTB's in unwrap call



When NCM is used with hosts like Windows PC, it is observed that there are
multiple NTB's contained in one usb request giveback. Since the driver
unwraps the obtained request data assuming only one NTB is present, we
loose the subsequent NTB's present resulting in data loss.

Fix this by checking the parsed block length with the obtained data
length in usb request and continue parsing after the last byte of current
NTB.

Cc: stable@vger.kernel.org
Fixes: 9f6ce424 ("usb: gadget: f_ncm.c added")
Signed-off-by: default avatarKrishna Kurapati <quic_kriskura@quicinc.com>
Reviewed-by: default avatarMaciej Żenczykowski <maze@google.com>
Link: https://lore.kernel.org/r/20230927105858.12950-1-quic_kriskura@quicinc.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 303180260
(cherry picked from commit 427694cf)
Change-Id: I86deb62ba12ab683ec8f311e15d90700e0b9902e
Signed-off-by: default avatarUttkarsh Aggarwal <quic_uaggarwa@quicinc.com>
parent 3cf93656
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment