Unless you changed the USB authorization policy to default deny [0] with some userspace filter for whitelisting specific devices, e.g. USBGuard [1], any USB device can pretend to be any other USB device.
There's no need to exploit the mass storage device driver when you can just pretend to be a keyboard and open a terminal. It's likely also possible to detect when the system is idle and do this when nobody is watching.
[0] https://www.kernel.org/doc/Documentation/usb/authorization.t...
i believe this works on a locked machine, a keyboard shouldn't be able to get you past the lock screen.