nvme_drv: reject requests with unaligned offset

Since the driver relies on all requests being Nvme::MPS_LOG2 aligned
as advertised in its Block::Info the added check will reject any
misaligned requests (using 'gpt_write' led to an IOMMU write fault).

Issue #4486.
This commit is contained in:
Josef Söntgen
2022-04-26 14:58:09 +02:00
committed by Christian Helmuth
parent 8d00af1d7b
commit b8e2b780e3

View File

@@ -1649,6 +1649,9 @@ class Nvme::Driver : Genode::Noncopyable
return Response::RETRY;
}
if (!Genode::aligned(request.offset, Nvme::MPS_LOG2))
return Response::REJECTED;
switch (request.operation.type) {
case Block::Operation::Type::INVALID:
return Response::REJECTED;