[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] df7b97: nbd: Don't mishandle unaligned client
From: |
GitHub |
Subject: |
[Qemu-commits] [qemu/qemu] df7b97: nbd: Don't mishandle unaligned client requests |
Date: |
Fri, 22 Apr 2016 04:30:05 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: df7b97ff89319ccf392a16748081482a3d22b35a
https://github.com/qemu/qemu/commit/df7b97ff89319ccf392a16748081482a3d22b35a
Author: Eric Blake <address@hidden>
Date: 2016-04-22 (Fri, 22 Apr 2016)
Changed paths:
M nbd/server.c
Log Message:
-----------
nbd: Don't mishandle unaligned client requests
The NBD protocol does not (yet) force any alignment constraints
on clients. Even though qemu NBD clients always send requests
that are aligned to 512 bytes, we must be prepared for non-qemu
clients that don't care about alignment (even if it means they
are less efficient). Our use of blk_read() and blk_write() was
silently operating on the wrong file offsets when the client
made an unaligned request, corrupting the client's data (but
as the client already has control over the file we are serving,
I don't think it is a security hole, per se, just a data
corruption bug).
Note that in the case of NBD_CMD_READ, an unaligned length could
cause us to return up to 511 bytes of uninitialized trailing
garbage from blk_try_blockalign() - hopefully nothing sensitive
from the heap's prior usage is ever leaked in that manner.
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Tested-by: Kevin Wolf <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [qemu/qemu] df7b97: nbd: Don't mishandle unaligned client requests,
GitHub <=