From: Matt Jan <zoo868e@gmail.com>
To: syzbot+14c04e62ca58315571d1@syzkaller.appspotmail.com
Cc: davem@davemloft.net, dhowells@redhat.com, edumazet@google.com,
kuba@kernel.org, linux-afs@lists.infradead.org,
linux-kernel@vger.kernel.org, marc.dionne@auristor.com,
netdev@vger.kernel.org, pabeni@redhat.com,
syzkaller-bugs@googlegroups.com, skhan@linuxfoundation.org,
Matt Jan <zoo868e@gmail.com>
Subject: [PATCH] rxrpc: Initialize sockaddr_rxrpc directly
Date: Wed, 6 Nov 2024 03:19:59 +0800 [thread overview]
Message-ID: <20241105191959.2871-1-zoo868e@gmail.com> (raw)
In-Reply-To: <671acd8e.050a0220.381c35.0004.GAE@google.com>
In rxrpc_lookup_peer_local_rcu(), removed the redundant memset call
that zeros out the sockaddr_rxrpc structure before setting its fields.
Instead, initialize the sockaddr_rxrpc structure directly in
rxrpc_input_error().
This change simplifies the code and ensures that the sockaddr_rxrpc
structure is properly zero-initialized.
Reported-by: syzbot+14c04e62ca58315571d1@syzkaller.appspotmail.com
Signed-off-by: Matt Jan <zoo868e@gmail.com>
---
net/rxrpc/peer_event.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/rxrpc/peer_event.c b/net/rxrpc/peer_event.c
index 552ba84a255c..c86b432201fd 100644
--- a/net/rxrpc/peer_event.c
+++ b/net/rxrpc/peer_event.c
@@ -33,7 +33,6 @@ static struct rxrpc_peer *rxrpc_lookup_peer_local_rcu(struct rxrpc_local *local,
_enter("");
- memset(srx, 0, sizeof(*srx));
srx->transport_type = local->srx.transport_type;
srx->transport_len = local->srx.transport_len;
srx->transport.family = local->srx.transport.family;
@@ -134,7 +133,7 @@ static void rxrpc_adjust_mtu(struct rxrpc_peer *peer, unsigned int mtu)
void rxrpc_input_error(struct rxrpc_local *local, struct sk_buff *skb)
{
struct sock_exterr_skb *serr = SKB_EXT_ERR(skb);
- struct sockaddr_rxrpc srx;
+ struct sockaddr_rxrpc srx = {};
struct rxrpc_peer *peer = NULL;
_enter("L=%x", local->debug_id);
--
2.25.1
next prev parent reply other threads:[~2024-11-05 19:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 22:43 [syzbot] [afs?] [net?] KMSAN: uninit-value in rxrpc_lookup_peer_rcu syzbot
2024-11-05 19:19 ` Matt Jan [this message]
2024-11-18 15:00 ` [PATCH] rxrpc: Initialize sockaddr_rxrpc directly David Howells
[not found] <20241105191156.99327-1-zoo868e@gmail.com>
2024-11-05 19:12 ` syzbot
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=20241105191959.2871-1-zoo868e@gmail.com \
--to=zoo868e@gmail.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.dionne@auristor.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=skhan@linuxfoundation.org \
--cc=syzbot+14c04e62ca58315571d1@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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
all inboxes | Powered by JetHome®