firewire: nosy: ensure user_length is taken into account when fetching packet contents
authorThanassis Avgerinos <thanassis.avgerinos@gmail.com>
Wed, 17 Apr 2024 15:30:02 +0000 (11:30 -0400)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 29 Apr 2024 09:35:55 +0000 (18:35 +0900)
commit38762a0763c10c24a4915feee722d7aa6e73eb98
tree7fcd0217f11c6268ea846d96a61cb9fff7a92dde
parente67572cd2204894179d89bd7b984072f19313b03
firewire: nosy: ensure user_length is taken into account when fetching packet contents

Ensure that packet_buffer_get respects the user_length provided. If
the length of the head packet exceeds the user_length, packet_buffer_get
will now return 0 to signify to the user that no data were read
and a larger buffer size is required. Helps prevent user space overflows.

Signed-off-by: Thanassis Avgerinos <thanassis.avgerinos@gmail.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
drivers/firewire/nosy.c