Security fix for CVE-2024-35195
This is cherry-picked from c8s and it didn't cause any conflicts (except patch/release number and changelog), patches apply cleanly, it builds fine (without tests) and the reproducer confirms the fix.
Scratch build: https://kojihub.stream.rdu2.redhat.com/koji/taskinfo?taskID=5128014
Resolves: RHEL-37609