From: Cyrill Gorcunov <gorcunov@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>, linux-afs@lists.infradead.org
Cc: David Howells <dhowells@redhat.com>,
Marc Dionne <marc.dionne@auristor.com>
Subject: [PATCH] afs: Add missing init for srx_service member
Date: Fri, 31 Jan 2025 00:39:43 +0300 [thread overview]
Message-ID: <Z5vxn699b0YtTAc-@grain> (raw)
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@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Marc Dionne <marc.dionne@auristor.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;
reply other threads:[~2025-01-30 21:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z5vxn699b0YtTAc-@grain \
--to=gorcunov@gmail.com \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.dionne@auristor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox