Skip to contentSkip to conversation

XSA-155: _apparently_ missing blktap1 fix (up to 4.5)

DISCUSSION Jan Beulich 2 participants 4 messages Mar 4, 2016 – Mar 29, 2016

lore
Share & tools
lore
#0 lore raw

In the course of backporting other XSA fixes to very old trees I had noticed that the XSA-155 had shrunk to just the change to xen/include/public/io/ring.h at some point, which didn't seem right. Clearly up to 4.5 the situation of blktap1 is the same as that of blktap2, i.e. one would think it also needs to be fixed. However, in the course of doing so I stumbled across the code blindly using req->id as an array index (which similarly is the case for blktap2). That alone would be another security issue, if only the first change really addressed one. But it didn't: The rings we're talking about here are those interfacing with the kernel module, and it's only the kernel module which interfaces with the guest ring.

Bottom line: No fix is needed to blktap1, and the change to blktap2 didn't really fix anything either. It merely made things slightly slower due to the extra copy operation. (I haven't fully understood the purpose of block-log.c yet, but I can't see how it would manage to bypass the kernel module and interface directly with the frontend in the guest, the more that tdlog_open() sets up its ring using shm_open(), implying host local operation. Hence that part of the change, which has no blktap1 equivalent, should not be needed either.)

Therefore, Ian, I'd like to request that the blktap2 change not be backported to any of the stable trees - only the libvchan one should make it there (and the prereq to the blktap2 one, adding RING_COPY_REQUEST(), then isn't needed either). Since that blktap2 change isn't entirely benign, I think we should even consider reverting it from master.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw
Quoted 8 lines · Jan Beulich

In the course of backporting other XSA fixes to very old trees I had noticed that the XSA-155 had shrunk to just the change to xen/include/public/io/ring.h at some point, which didn't seem right. Clearly up to 4.5 the situation of blktap1 is the same as that of blktap2, i.e. one would think it also needs to be fixed. However, in the course of doing so I stumbled across the code blindly using req->id as an array index (which similarly is the case for blktap2). That alone would be another security issue, if only the first change

Yes. We fixed that in blkback some time ago, but yes that code base has some quite errant bugs in it.

Would love to say I can fix them, but the TODO list is getting a bit long.

Quoted 14 lines

really addressed one. But it didn't: The rings we're talking about here are those interfacing with the kernel module, and it's only the kernel module which interfaces with the guest ring.

Bottom line: No fix is needed to blktap1, and the change to blktap2 didn't really fix anything either. It merely made things slightly slower due to the extra copy operation. (I haven't fully understood the purpose of block-log.c yet, but I can't see how it would manage to bypass the kernel module and interface directly with the frontend in the guest, the more that tdlog_open() sets up its ring using shm_open(), implying host local operation. Hence that part of the change, which has no blktap1 equivalent, should not be needed either.)

Quoted 9 lines

Therefore, Ian, I'd like to request that the blktap2 change not be backported to any of the stable trees - only the libvchan one should make it there (and the prereq to the blktap2 one, adding RING_COPY_REQUEST(), then isn't needed either). Since that blktap2 change isn't entirely benign, I think we should even consider reverting it from master.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 04.03.16 at 15:09, <[email protected]> wrote:
Quoted 8 lines · Jan Beulich

In the course of backporting other XSA fixes to very old trees I had noticed that the XSA-155 had shrunk to just the change to xen/include/public/io/ring.h at some point, which didn't seem right. Clearly up to 4.5 the situation of blktap1 is the same as that of blktap2, i.e. one would think it also needs to be fixed. However, in the course of doing so I stumbled across the code blindly using req->id as an array index (which similarly is the case for blktap2). That alone would be another security issue, if only the first change

Quoted 5 lines

Yes. We fixed that in blkback some time ago, but yes that code base has some quite errant bugs in it.

Would love to say I can fix them, but the TODO list is getting a bit long.

But my point was - there is (and was) nothing to fix there.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
In reply to Jan Beulich
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 04.03.16 at 09:21, <[email protected]> wrote:

In the course of backporting other XSA fixes to very old trees I had noticed that the XSA-155 had shrunk to just the change to xen/include/public/io/ring.h at some point, which didn't seem right. Clearly up to 4.5 the situation of blktap1 is the same as that of blktap2, i.e. one would think it also needs to be fixed. However, in the course of doing so I stumbled across the code blindly using req->id as an array index (which similarly is the case for blktap2). That alone would be another security issue, if only the first change really addressed one. But it didn't: The rings we're talking about here are those interfacing with the kernel module, and it's only the kernel module which interfaces with the guest ring.

Bottom line: No fix is needed to blktap1, and the change to blktap2 didn't really fix anything either. It merely made things slightly slower due to the extra copy operation. (I haven't fully understood the purpose of block-log.c yet, but I can't see how it would manage to bypass the kernel module and interface directly with the frontend in the guest, the more that tdlog_open() sets up its ring using shm_open(), implying host local operation. Hence that part of the change, which has no blktap1 equivalent, should not be needed either.)

Quoted 6 lines

Therefore, Ian, I'd like to request that the blktap2 change not be backported to any of the stable trees - only the libvchan one should make it there (and the prereq to the blktap2 one, adding RING_COPY_REQUEST(), then isn't needed either). Since that blktap2 change isn't entirely benign, I think we should even consider reverting it from master.

Since, in the course of verifying 4.5.3, you must have agreed to the analysis above - what about the revert proposal on master then?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel