|
|
Subscribe / Log in / New account

A security fix briefly breaks DMA

A security fix briefly breaks DMA

Posted Apr 1, 2022 18:30 UTC (Fri) by mb (subscriber, #50428)
In reply to: A security fix briefly breaks DMA by mario-campos
Parent article: A security fix briefly breaks DMA

In most cases it's probably unknown how much the device actually wrote, unless the driver actually looks at the data written.


to post comments

A security fix briefly breaks DMA

Posted Apr 2, 2022 3:20 UTC (Sat) by developer122 (guest, #152928) [Link] (2 responses)

This sounds a lot like terrible hardware design.

A security fix briefly breaks DMA

Posted Apr 4, 2022 8:17 UTC (Mon) by taladar (subscriber, #68407) [Link]

That doesn't really matter, if you are the kernel and essentially want a design that works with all hardware you have to expect some terribly designed hardware too.

A security fix briefly breaks DMA

Posted Apr 7, 2022 15:16 UTC (Thu) by kpfleming (subscriber, #23250) [Link]

I'm not sure that's fair.

You tell a NIC it can receive a packet directly into a buffer. It does so. You don't know how large the packet was until you look into the buffer to find out.

The NIC could conceivably communicate the 'bytes written' amount in some other location outside the buffer, but that significantly complicates the data handling.

A security fix briefly breaks DMA

Posted Apr 2, 2022 6:24 UTC (Sat) by NYKevin (subscriber, #129325) [Link]

I would tend to expect that the vast majority of hardware falls into one of two cases:

* It's something like a NIC, and the data is eventually going to end up in some sort of userspace buffer (e.g. via read() or recv()). This implies that some part of the kernel is going to have to figure out the size at some point, because you can't leak extraneous data to userspace, so you might as well do it in the driver.
* It's something like a keyboard or capture card, and the data has a fixed or configurable size and/or format, which the driver should already know because it presumably configured the size/format in the first place.

Is there really a lot of variable-sized input hardware where the input *doesn't* eventually end up in userspace?


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds