]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 10:14:58 +0000 (12:14 +0200)
commit539d51ac48bcfcfa1b3d4a85f8df92fa22c1d41c
tree4dcef8fdf7f92a1609049ad4661025147c6d7572
parent9a4f6e138720b6e9adf7b82a71d0292f3f276480
firewire: nosy: ensure user_length is taken into account when fetching packet contents

commit 38762a0763c10c24a4915feee722d7aa6e73eb98 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firewire/nosy.c