trunk/ae08e11d38586adc006247ff6457e1b1e101c580: Fix stack buffer overflow in libshm Unix socket path handling (#195183)
- PyTorch: 339 events in the last 90 days
- PyTorch: 336th Release in the last 90 days
- Previous: earlier the same day · trunk/1c18e345be116271b20aec52297a7f42f4607c35
What happened
Summary Fixes #195182 Replace unbounded strcpy() in Socket::prepare_address() with a length check and bounded copy into sockaddr_un.sun_path . Changes Zero-initialize sockaddr_un with {} Reject paths >= sizeof(sun_path) via TORCH_CHECK Use strncpy with explicit null termination Test plan Default torch_shm_manager startup still works (typical /tmp/torch-shm-dir-*/manager.sock paths) Oversized path triggers clean TORC…
Summary assembled by rule from the sources below