In the Linux kernel, the following vulnerability has been resolved: usb: musb: Fix musbgadget.c rxstate overflow bug The usb function device call musbgadgetqueue() adds the passed request to musbep::reqlist,If the (request->length > musbep->packetsz) and (isbuffermapped(req) return false),the rxstate() will copy all data in fifo to request->buf which may cause request->buf out of bounds. Fix it by add the length check : fifocnt = mint(unsigned, request->length - request->actual, fifocnt);