lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 15 Feb 2019 19:52:54 +0300
From:   Alexey Kodanev <alexey.kodanev@...cle.com>
To:     netdev@...r.kernel.org
Cc:     Willem de Bruijn <willemb@...gle.com>, Petr Vorel <pvorel@...e.cz>,
        David Miller <davem@...emloft.net>,
        Alexey Kodanev <alexey.kodanev@...cle.com>
Subject: [PATCH net] sock: return uapi errno in sock_setsockopt() for SO_ZEROCOPY

For unsupported protocols, setsockopt() with SO_ZEROCOPY
option sets errno to ENOTSUPP(524). But this number is
not defined anywhere in the include/uapi/ headers.

To make sure userspace sees the known number, replace
ENOTSUPP(524) with EOPNOTSUPP(95).

Fixes: 76851d1212c1 ("sock: add SOCK_ZEROCOPY sockopt")
Signed-off-by: Alexey Kodanev <alexey.kodanev@...cle.com>
Reported-by: Petr Vorel <pvorel@...e.cz>
---
 net/core/sock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index 6aa2e7e..f6c57de 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1023,9 +1023,9 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
 			       sk->sk_protocol == IPPROTO_TCP) ||
 			      (sk->sk_type == SOCK_DGRAM &&
 			       sk->sk_protocol == IPPROTO_UDP)))
-				ret = -ENOTSUPP;
+				ret = -EOPNOTSUPP;
 		} else if (sk->sk_family != PF_RDS) {
-			ret = -ENOTSUPP;
+			ret = -EOPNOTSUPP;
 		}
 		if (!ret) {
 			if (val < 0 || val > 1)
-- 
1.8.3.1

Powered by blists - more mailing lists