← Back to events
ActiveAIRelease

viable/strict/1788240474: Fix stack buffer overflow in libshm Unix socket path handling (#195183)

Photo: PyTorch Releases

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

Why it's spreading

Sources