[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Z5vxn699b0YtTAc-@grain>
Date: Fri, 31 Jan 2025 00:39:43 +0300
From: Cyrill Gorcunov <gorcunov@...il.com>
To: LKML <linux-kernel@...r.kernel.org>, linux-afs@...ts.infradead.org
Cc: David Howells <dhowells@...hat.com>,
Marc Dionne <marc.dionne@...istor.com>
Subject: [PATCH] afs: Add missing init for srx_service member
Both afs_merge_fs_addr4 and afs_merge_fs_addr6 helpers allocate
sockaddr_rxrpc structure on kernel stack and never init srx_service
member before passing it down for peer lookup/creation. Looks
insignificant in current context but better be on a safe side for
future use. Thus initialize them explicitly.
Signed-off-by: Cyrill Gorcunov <gorcunov@...il.com>
Cc: David Howells <dhowells@...hat.com>
Cc: Marc Dionne <marc.dionne@...istor.com>
---
fs/afs/addr_list.c | 2 ++
1 file changed, 2 insertions(+)
Index: linux-tip.git/fs/afs/addr_list.c
===================================================================
--- linux-tip.git.orig/fs/afs/addr_list.c
+++ linux-tip.git/fs/afs/addr_list.c
@@ -291,6 +291,7 @@ int afs_merge_fs_addr4(struct afs_net *n
return 0;
srx.srx_family = AF_RXRPC;
+ srx.srx_service = 0;
srx.transport_type = SOCK_DGRAM;
srx.transport_len = sizeof(srx.transport.sin);
srx.transport.sin.sin_family = AF_INET;
@@ -335,6 +336,7 @@ int afs_merge_fs_addr6(struct afs_net *n
return 0;
srx.srx_family = AF_RXRPC;
+ srx.srx_service = 0;
srx.transport_type = SOCK_DGRAM;
srx.transport_len = sizeof(srx.transport.sin6);
srx.transport.sin6.sin6_family = AF_INET6;
Powered by blists - more mailing lists