net: fix possible NULL dereference in sock_sendpage()

This is the equivalent of 2.6 commit e694958388c50148389b0e9b9e9e8945cf0f1b98.

It adds a test in sock_sendpage() to avoid calling sock->ops->sock_sendpage()
on protocols which do not support it, as it would be NULL. In such a case,
we now call sock_no_sendpage() instead, as does kernel_sendpage() in 2.6.

This patch has been tested and confirmed to be enough to fix the security
issues discovered and reported by Julien Tinnes and Tavis Ormandy.

Signed-off-by: Willy Tarreau <w@1wt.eu>
1 file changed