Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151174446
D24893.id73836.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
962 B
Referenced Files
None
Subscribers
None
D24893.id73836.diff
View Options
Index: head/usr.sbin/bhyve/pci_nvme.c
===================================================================
--- head/usr.sbin/bhyve/pci_nvme.c
+++ head/usr.sbin/bhyve/pci_nvme.c
@@ -1877,6 +1877,11 @@
nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, cmd->prp1, cmd->prp2,
(uint8_t *)range, NVME_MAX_DSM_TRIM, NVME_COPY_FROM_PRP);
+ if ((range[0].starting_lba * sectsz) > nvstore->size) {
+ pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE);
+ goto out;
+ }
+
/*
* If the request is for more than a single range, store
* the ranges in the br_iov. Optimize for the common case
@@ -1896,6 +1901,10 @@
struct iovec *iov = req->io_req.br_iov;
for (r = 0; r <= nr; r++) {
+ if ((range[r].starting_lba * sectsz) > nvstore->size) {
+ pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE);
+ goto out;
+ }
iov[r].iov_base = (void *)(range[r].starting_lba * sectsz);
iov[r].iov_len = range[r].length * sectsz;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 2:36 PM (10 m, 3 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30986277
Default Alt Text
D24893.id73836.diff (962 B)
Attached To
Mode
D24893: bhyve: validate NVMe deallocate range values
Attached
Detach File
Event Timeline
Log In to Comment