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]
Message-ID: <20250901071156.1169519-1-alok.a.tiwari@oracle.com>
Date: Mon,  1 Sep 2025 00:11:53 -0700
From: Alok Tiwari <alok.a.tiwari@...cle.com>
To: jk@...econstruct.com.au, matt@...econstruct.com.au, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        horms@...nel.org, netdev@...r.kernel.org
Cc: alok.a.tiwari@...cle.com
Subject: [QUERY] mctp: getsockopt unknown option return code -EINVAL

net/mctp/af_mctp.c
In mctp_getsockopt(), unknown options currently return -EINVAL.
In contrast, mctp_setsockopt() returns -ENOPROTOOPT for unknown
options.

Would it be ideal to return -ENOPROTOOPT instead of -EINVAL in
mctp_getsockopt() when an option is unrecognized?
This would match the behavior of mctp_setsockopt() and follow the
standard kernel socket API convention for unknown options.

---
 net/mctp/af_mctp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index df4e8cf33899b..e8938ca35a066 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -425,7 +425,7 @@ static int mctp_getsockopt(struct socket *sock, int level, int optname,
 		return 0;
 	}
 
-	return -EINVAL;
+	return -EINVAL; // > ENOPROTOOPT
 }
 
 /* helpers for reading/writing the tag ioc, handling compatibility across the
-- 
2.50.1


Thanks,
Alok

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ