From: Dominique Martinet <asmadeus@codewreck.org>
To: rtm@csail.mit.edu
Cc: Eric Van Hensbergen <ericvh@kernel.org>,
Latchesar Ionkov <lucho@ionkov.net>,
v9fs@lists.linux.dev
Subject: Re: p9_client_write doesn't check for negative "written" from server
Date: Wed, 18 Dec 2024 09:35:10 +0900 [thread overview]
Message-ID: <Z2IYvnHYTgMxA_Xi@codewreck.org> (raw)
In-Reply-To: <16271.1734448631@26-5-164.dynamic.csail.mit.edu>
Hi,
rtm@csail.mit.edu wrote on Tue, Dec 17, 2024 at 10:17:11AM -0500:
> If the kernel's 9p client sends a write request, and the server returns
> a successful Rwrite reply, but with a negative "written" value, then
> this line towards the end of p9_client_write():
>
> iov_iter_revert(from, count - written - iov_iter_count(from));
>
> can pass an unroll argument to iov_iter_revert() that's larger than
> the number of bytes in the iov
Thanks for the report, I'm surprised this didn't come up sooner through
syzbot...
That is correct, written (and simlarily received in p9_client_read_once)
should be made unsigned.
They're actually compared with 'rsize' which is an int but is set from
fid->iounit which is a u32, so just making these three variables u32
will sort the issue.
The patch is trivial so would you like to send it?
If you don't want to (or there is no reply in a while) then I'll send a
patch this weekend crediting you as reported-by.
--
Dominique
prev parent reply other threads:[~2024-12-18 0:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 15:17 p9_client_write doesn't check for negative "written" from server rtm
2024-12-18 0:35 ` Dominique Martinet [this message]
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=Z2IYvnHYTgMxA_Xi@codewreck.org \
--to=asmadeus@codewreck.org \
--cc=ericvh@kernel.org \
--cc=lucho@ionkov.net \
--cc=rtm@csail.mit.edu \
--cc=v9fs@lists.linux.dev \
/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