The tcp(7) discussion on SO_SNDBUF and SO_RCVBUF contains the statement that: "The maximum sizes for socket buffers declared via the SO_SNDBUF and SO_RCVBUF mechanisms are limited by the values in the /proc/sys/net/core/rmem_max and /proc/sys/net/core/wmem_max files." However, other sources seem to suggest that the files /proc/sys/net/ipv4/tcp_wmem and /proc/sys/net/ipv4/tcp_rmem (mentioned in the previous paragraph) actually contain the relevant limits (the third value in each file), while the core/ files are only relevant to other protocols. This is actually explained in tcp(7), down in the "tcp_rmem" section of the "/proc interfaces".
Hmm, reading the text again, the tcp_rmem section actually states that: "This value does not override the global net.core.rmem_max.". It's not clear what this actually means: Does it mean tcp_rmem maximum is just ignored? That it cannot *increase* core.rmem_max? Or what? This whole topic is really unclear in tcp(7) :-(