[PATCH 5.10] Backport the fix for CVE-2024-23851 to v5.10