The POSIX specification of shutdown says: how Specifies the type of shutdown. The values are as fol‐ lows: SHUT_RD Disables further receive operations. SHUT_WR Disables further send operations. SHUT_RDWR Disables further send and receive operations. ... ERRORS The shutdown() function shall fail if: EINVAL The how argument is invalid. However, Linux inconsistently handles this error scenario, via protocol-specific checks. In particular, the various INET domains correctly give EINVAL for invalid 'how', but UNIX domain sockets simply ignore invalid values. There should be a check in the top-level syscall code to handle this case. The attached patch adds that check. Note: this patch brings POSIX conformance, and brings consistency to the API, but changes the ABI for oddball applications that happen to specify strange values in 'how' for previously unchecked domain (e.g., UNIX domain).
So, Eric Dumazet points out to me that there are patches in net-next to fix this for AD_UNIX and AF_DECNet. Perhaps this bug is soon closeable.
Fixed in 3.7-rc1