diff options
Diffstat (limited to 'kernel/net/9p/client.c')
-rw-r--r-- | kernel/net/9p/client.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/net/9p/client.c b/kernel/net/9p/client.c index fcf6fe063..ea79ee9a7 100644 --- a/kernel/net/9p/client.c +++ b/kernel/net/9p/client.c @@ -1584,6 +1584,10 @@ p9_client_read(struct p9_fid *fid, u64 offset, struct iov_iter *to, int *err) p9_free_req(clnt, req); break; } + if (rsize < count) { + pr_err("bogus RREAD count (%d > %d)\n", count, rsize); + count = rsize; + } p9_debug(P9_DEBUG_9P, "<<< RREAD count %d\n", count); if (!count) { @@ -1652,6 +1656,10 @@ p9_client_write(struct p9_fid *fid, u64 offset, struct iov_iter *from, int *err) p9_free_req(clnt, req); break; } + if (rsize < count) { + pr_err("bogus RWRITE count (%d > %d)\n", count, rsize); + count = rsize; + } p9_debug(P9_DEBUG_9P, "<<< RWRITE count %d\n", count); |