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: <20230719084415.1378696-1-leitao@debian.org>
Date: Wed, 19 Jul 2023 01:44:12 -0700
From: Breno Leitao <leitao@...ian.org>
To: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>
Cc: leit@...a.com,
	Kuniyuki Iwashima <kuniyu@...zon.com>,
	Alexei Starovoitov <ast@...nel.org>,
	Martin KaFai Lau <martin.lau@...nel.org>,
	Alexander Mikhalitsyn <alexander@...alicyn.com>,
	David Howells <dhowells@...hat.com>,
	Jason Xing <kernelxing@...cent.com>,
	Xin Long <lucien.xin@...il.com>,
	netdev@...r.kernel.org (open list:NETWORKING [GENERAL]),
	linux-kernel@...r.kernel.org (open list)
Subject: [PATCH net-next] net: Use _K_SS_MAXSIZE instead of absolute value

Looking at sk_getsockopt function, it is unclear why 128 is a magical
number.

Use the proper macro, so it becomes clear to understand what the value
mean, and get a reference where it is coming from (user-exported API).

Signed-off-by: Breno Leitao <leitao@...ian.org>
---
 net/core/sock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index 9370fd50aa2c..58b6f00197d6 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1815,7 +1815,7 @@ int sk_getsockopt(struct sock *sk, int level, int optname,
 
 	case SO_PEERNAME:
 	{
-		char address[128];
+		char address[_K_SS_MAXSIZE];
 
 		lv = sock->ops->getname(sock, (struct sockaddr *)address, 2);
 		if (lv < 0)
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ