virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: regressions@lists.linux.dev,
	"Corentin Noël" <corentin.noel@collabora.com>,
	stable@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	"Eric Dumazet" <edumazet@google.com>
Subject: Re: virtio-net: kernel panic in virtio_net.c
Date: Fri, 8 Oct 2021 06:02:20 -0400	[thread overview]
Message-ID: <20211008055902-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <YV/8Ia1d9zXvMqqc@kroah.com>

On Fri, Oct 08, 2021 at 10:06:57AM +0200, Greg KH wrote:
> On Fri, Oct 08, 2021 at 12:17:26AM +0800, Xuan Zhuo wrote:
> > On Thu, 7 Oct 2021 17:25:02 +0200, Greg KH <gregkh@linuxfoundation.org> wrote:
> > > On Thu, Oct 07, 2021 at 11:06:12PM +0800, Xuan Zhuo wrote:
> > > > On Thu, 07 Oct 2021 14:04:22 +0200, Corentin Noël <corentin.noel@collabora.com> wrote:
> > > > > I've been experiencing crashes with 5.14-rc1 and above that do not
> > > > > occur with 5.13,
> > > >
> > > > I should have fixed this problem before. I don't know why, I just looked at the
> > > > latest net code, and this commit seems to be lost.
> > > >
> > > >      1a8024239dacf53fcf39c0f07fbf2712af22864f virtio-net: fix for skb_over_panic inside big mode
> > > >
> > > > Can you test this patch again?
> > >
> > > That commit showed up in 5.13-rc5, so 5.14-rc1 and 5.13 should have had
> > > it in it, right?
> > >
> > 
> > Yes, it may be lost due to conflicts during a certain merge.
> 
> Really?  I tried to apply that again to 5.14 and it did not work.  So I
> do not understand what to do here, can you try to explain it better?
> 
> thanks,
> 
> greg k-h

Hmm, something like the following perhaps then?
Corentin would you like to try this?
Warning: untested.


diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 096c2ac6b7a6..18dd9f6d107d 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -406,12 +406,13 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi,
 	 * add_recvbuf_mergeable() + get_mergeable_buf_len()
 	 */
 	truesize = headroom ? PAGE_SIZE : truesize;
-	tailroom = truesize - len - headroom;
+	tailroom = truesize - headroom;
 	buf = p - headroom;
 
 	len -= hdr_len;
 	offset += hdr_padded_len;
 	p += hdr_padded_len;
+	tailroom -= hdr_padded_len + len;
 
 	shinfo_size = SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
 

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2021-10-08 10:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5edaa2b7c2fe4abd0347b8454b2ac032b6694e2c.camel@collabora.com>
2021-10-07 13:10 ` virtio-net: kernel panic in virtio_net.c Michael S. Tsirkin
     [not found]   ` <CANn89i+-P_mS-0jOM7SD4f291+Jbc9PORYJx2+gfQbebiX3z_A@mail.gmail.com>
     [not found]     ` <b517d143c6ec0960eedcbf8f6917776bc67c5fd4.camel@collabora.com>
2021-10-07 14:13       ` Greg KH
2021-10-07 15:06 ` Xuan Zhuo
2021-10-07 15:25   ` Greg KH
2021-10-07 16:17     ` Xuan Zhuo
2021-10-08  8:06       ` Greg KH
2021-10-08 10:02         ` Michael S. Tsirkin [this message]
2021-10-08 16:27         ` Xuan Zhuo
2021-10-09  5:19           ` Greg KH
2021-10-09  9:31             ` Xuan Zhuo
     [not found] <9b894cd65f67116b5eb3b57d714f8782619c5434.camel@collabora.com>
2021-06-03  2:44 ` Xuan Zhuo
     [not found]   ` <6a9ec4daa03a68d8d74e90bec358324f95ec1c32.camel@collabora.com>
2021-06-08 12:17     ` Greg KH
2021-06-09  1:48       ` Xuan Zhuo
2021-06-09  4:50         ` Greg KH
2021-06-09  6:08           ` Xuan Zhuo
2021-06-09  6:24             ` Greg KH
2021-06-09  7:51               ` Xuan Zhuo
2021-06-09  8:03                 ` Greg KH
2021-06-09  8:08                   ` Xuan Zhuo
     [not found] <CANn89iKFjZJ=AtgAJmk4ZEtS3eL5XKMr6wiFUhtfTb2tFKbcuA@mail.gmail.com>
2021-06-02  2:01 ` Xuan Zhuo
     [not found] <3724b6d19b0bf4741c44977e083c1a655df57b55.camel@collabora.com>
2021-06-01 17:07 ` Greg KH

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=20211008055902-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=corentin.noel@collabora.com \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --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).