mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+bdb4bd87b5e22058e2a4@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] [virt?] BUG: stack guard page was hit in vsock_bpf_recvmsg
Date: Sun, 11 Aug 2024 08:13:41 +0800	[thread overview]
Message-ID: <20240811001341.2890-1-hdanton@sina.com> (raw)
In-Reply-To: <0000000000005f5a6d061f43aabe@google.com>

On Fri, 09 Aug 2024 10:42:21 -0700
> syzbot found the following issue on:
> 
> HEAD commit:    eb3ab13d997a net: ti: icssg_prueth: populate netdev of_node
> git tree:       net-next
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17522ec5980000

#syz test net-next  eb3ab13d997a

--- x/net/vmw_vsock/vsock_bpf.c
+++ y/net/vmw_vsock/vsock_bpf.c
@@ -77,37 +77,29 @@ static int vsock_bpf_recvmsg(struct sock
 			     size_t len, int flags, int *addr_len)
 {
 	struct sk_psock *psock;
-	int copied;
+	int copied = -EAGAIN;
 
 	psock = sk_psock_get(sk);
 	if (unlikely(!psock))
-		return __vsock_recvmsg(sk, msg, len, flags);
+		return -EAGAIN;
 
 	lock_sock(sk);
-	if (vsock_has_data(sk, psock) && sk_psock_queue_empty(psock)) {
-		release_sock(sk);
-		sk_psock_put(sk, psock);
-		return __vsock_recvmsg(sk, msg, len, flags);
-	}
+	if (vsock_has_data(sk, psock) && sk_psock_queue_empty(psock))
+		goto out;
 
 	copied = sk_msg_recvmsg(sk, psock, msg, len, flags);
 	while (copied == 0) {
 		long timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
 
-		if (!vsock_msg_wait_data(sk, psock, timeo)) {
-			copied = -EAGAIN;
+		copied = -EAGAIN;
+		if (!vsock_msg_wait_data(sk, psock, timeo))
+			break;
+		if (sk_psock_queue_empty(psock))
 			break;
-		}
-
-		if (sk_psock_queue_empty(psock)) {
-			release_sock(sk);
-			sk_psock_put(sk, psock);
-			return __vsock_recvmsg(sk, msg, len, flags);
-		}
-
 		copied = sk_msg_recvmsg(sk, psock, msg, len, flags);
 	}
 
+out:
 	release_sock(sk);
 	sk_psock_put(sk, psock);
 
--

  parent reply	other threads:[~2024-08-11  0:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 17:42 syzbot
2024-08-10 12:07 ` syzbot
2024-08-11  0:13 ` Hillf Danton [this message]
2024-08-11  0:46   ` syzbot
2024-08-12  1:19 ` [syzbot] " syzbot
2024-08-12  1:46 ` [syzbot] Re: [syzbot] [net?] [virt?] " syzbot
     [not found] <CAM_iQpV6aNoiXkYejbgfeQQpwL5LsE9rtJdOdjeRrnQyRuR19Q@mail.gmail.com>
2024-08-12  1:37 ` syzbot
     [not found] <CAM_iQpUTMQvq9Z7tM1upFGpKMWoc8FcftwREsy1SyTfHNv2cTw@mail.gmail.com>
2024-08-12  2:18 ` 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=20240811001341.2890-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+bdb4bd87b5e22058e2a4@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®