Max Kellermann 99a37ab76a ceph: give up on paths longer than PATH_MAX
commit 550f7ca98ee028a606aa75705a7e77b1bd11720f upstream.

If the full path to be built by ceph_mdsc_build_path() happens to be
longer than PATH_MAX, then this function will enter an endless (retry)
loop, effectively blocking the whole task.  Most of the machine
becomes unusable, making this a very simple and effective DoS
vulnerability.

I cannot imagine why this retry was ever implemented, but it seems
rather useless and harmful to me.  Let's remove it and fail with
ENAMETOOLONG instead.

Cc: stable@vger.kernel.org
Reported-by: Dario Weißer <dario@cure53.de>
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-27 14:02:19 +01:00
..
2024-09-16 13:07:59 +02:00
2024-11-01 07:37:10 -10:00
2024-07-15 11:14:59 -07:00
2024-09-16 09:14:02 +02:00
2024-10-17 00:28:06 -07:00
2024-11-01 07:45:00 -10:00
2024-12-14 20:04:14 +01:00
2024-09-19 10:18:15 +02:00
2024-05-28 11:52:53 +02:00
2024-08-21 22:32:58 +02:00
2024-04-23 13:27:43 +02:00
2024-10-02 12:02:15 -07:00
2024-08-29 06:20:44 +12:00
2024-09-16 08:54:30 +02:00
2024-09-16 08:35:09 +02:00
2024-12-14 20:03:35 +01:00
2024-12-05 14:02:47 +01:00
2024-09-18 08:53:53 +02:00
2024-08-28 13:05:39 +02:00
2024-09-16 08:54:30 +02:00
2024-09-24 15:29:42 -07:00
2024-09-16 11:15:26 +02:00
2024-09-27 08:18:43 -07:00
2024-09-27 18:29:19 +02:00
2024-09-27 08:18:43 -07:00
2024-05-02 16:28:20 +02:00