netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Mike Christie <michael.christie@oracle.com>
Cc: syzbot <syzbot+6b27b2d2aba1c80cc13b@syzkaller.appspotmail.com>,
	brauner@kernel.org, jasowang@redhat.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	syzkaller-bugs@googlegroups.com,
	virtualization@lists.linux-foundation.org
Subject: Re: [syzbot] [kernel?] general protection fault in vhost_task_start
Date: Tue, 21 Mar 2023 17:36:22 -0400	[thread overview]
Message-ID: <20230321173602-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20230321135427-mutt-send-email-mst@kernel.org>

On Tue, Mar 21, 2023 at 01:55:00PM -0400, Michael S. Tsirkin wrote:
> On Tue, Mar 21, 2023 at 12:46:04PM -0500, Mike Christie wrote:
> > On 3/21/23 12:03 PM, syzbot wrote:
> > > RIP: 0010:vhost_task_start+0x22/0x40 kernel/vhost_task.c:115
> > > Code: 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 53 48 89 fb e8 c3 67 2c 00 48 8d 7b 70 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75 0a 48 8b 7b 70 5b e9 fe bd 02 00 e8 79 ec 7e 00 eb
> > > RSP: 0018:ffffc90003a9fc38 EFLAGS: 00010207
> > > RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: 0000000000000000
> > > RDX: 000000000000000c RSI: ffffffff81564c8d RDI: 0000000000000064
> > > RBP: ffff88802b21dd40 R08: 0000000000000100 R09: ffffffff8c917cf3
> > > R10: 00000000fffffff4 R11: 0000000000000000 R12: fffffffffffffff4
> > > R13: ffff888075d000b0 R14: ffff888075d00000 R15: ffff888075d00008
> > > FS:  0000555556247300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
> > > CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > CR2: 00007ffe3d8e5ff8 CR3: 00000000215d4000 CR4: 00000000003506f0
> > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> > > Call Trace:
> > >  <TASK>
> > >  vhost_worker_create drivers/vhost/vhost.c:580 [inline]
> > 
> > The return value from vhost_task_create is incorrect if the kzalloc fails.
> > 
> > Christian, here is a fix for what's in your tree. Do you want me to submit
> > a follow up patch like this or a replacement patch for:
> > 
> > commit 77feab3c4156 ("vhost_task: Allow vhost layer to use copy_process")
> > 
> > with the fix rolled into it?
> > 
> 
> 
> 
> > 
> > >From 0677ad6d77722f301ca35e8e0f8fd0cbd5ed8484 Mon Sep 17 00:00:00 2001
> > From: Mike Christie <michael.christie@oracle.com>
> > Date: Tue, 21 Mar 2023 12:39:39 -0500
> > Subject: [PATCH] vhost_task: Fix vhost_task_create return value
> > 
> > vhost_task_create is supposed to return the vhost_task or NULL on
> > failure. This fixes it to return the correct value when the allocation
> > of the struct fails.
> > ---
> >  kernel/vhost_task.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kernel/vhost_task.c b/kernel/vhost_task.c
> > index 4b8aff160640..b7cbd66f889e 100644
> > --- a/kernel/vhost_task.c
> > +++ b/kernel/vhost_task.c
> > @@ -88,7 +88,7 @@ struct vhost_task *vhost_task_create(int (*fn)(void *), void *arg,
> >  
> >  	vtsk = kzalloc(sizeof(*vtsk), GFP_KERNEL);
> >  	if (!vtsk)
> > -		return ERR_PTR(-ENOMEM);
> > +		return NULL;
> >  	init_completion(&vtsk->exited);
> >  	vtsk->data = arg;
> >  	vtsk->fn = fn;
> > 

Sorry I had nothing to add here. Sent by mistake.


  reply	other threads:[~2023-03-21 21:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 17:03 [syzbot] [kernel?] general protection fault in vhost_task_start syzbot
2023-03-21 17:46 ` Mike Christie
2023-03-21 17:54   ` Michael S. Tsirkin
2023-03-21 21:36     ` Michael S. Tsirkin [this message]
2023-03-21 19:57   ` Christian Brauner

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=20230321173602-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=brauner@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.christie@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+6b27b2d2aba1c80cc13b@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).