All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org, wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v3 5/5] Mini-OS: fix 9pfs response receiving
Date: Tue, 21 Nov 2023 10:49:53 +0100	[thread overview]
Message-ID: <20231121094953.22430-6-jgross@suse.com> (raw)
In-Reply-To: <20231121094953.22430-1-jgross@suse.com>

When copying a 9pfs response chunk from the ring buffer across the
ring end, the local ring pointer and length field are not updated
correctly. Fix that.

Fixes: 0924fec1de58 ("Mini-OS: add 9pfs transport layer")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 9pfront.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/9pfront.c b/9pfront.c
index 43c7409f..35c5552b 100644
--- a/9pfront.c
+++ b/9pfront.c
@@ -386,7 +386,9 @@ static void copy_bufs(unsigned char **buf1, unsigned char **buf2,
             printk("9pfs: short copy (dropping %u bytes)\n", len - *len1);
             len = *len1;
         }
-        memcpy(target, *buf1, *len1);
+        memcpy(target, *buf1, len);
+        *buf1 += len;
+        *len1 -= len;
     }
 }
 
-- 
2.35.3



  parent reply	other threads:[~2023-11-21  9:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21  9:49 [PATCH v3 0/5] Mini-OS: preparations for 9pfs in xenstore-stubdom Juergen Gross
2023-11-21  9:49 ` [PATCH v3 1/5] Mini-OS: make xenstore_buf externally visible Juergen Gross
2023-11-21  9:49 ` [PATCH v3 2/5] Mini-OS: get own domid Juergen Gross
2023-11-21 19:27   ` Samuel Thibault
2023-11-21  9:49 ` [PATCH v3 3/5] Mini-OS: don't crash if no shutdown node is available Juergen Gross
2023-11-21  9:49 ` [PATCH v3 4/5] Mini-OS: fix 9pfs stat receive format Juergen Gross
2023-11-21  9:49 ` Juergen Gross [this message]
2023-11-21 19:30   ` [PATCH v3 5/5] Mini-OS: fix 9pfs response receiving Samuel Thibault
2023-11-21 21:07 ` [PATCH v3 0/5] Mini-OS: preparations for 9pfs in xenstore-stubdom Andrew Cooper

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=20231121094953.22430-6-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=minios-devel@lists.xenproject.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.