Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177880702
D40519.1795502896.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D40519.1795502896.diff
View Options
diff --git a/sys/dev/oce/oce_if.c b/sys/dev/oce/oce_if.c
--- a/sys/dev/oce/oce_if.c
+++ b/sys/dev/oce/oce_if.c
@@ -2246,7 +2246,6 @@
uint32_t req_size;
struct mbx_hdr req;
OCE_DMA_MEM dma_mem;
- struct mbx_common_get_cntl_attr *fw_cmd;
if (copyin(priv_data, cookie, strlen(IOCTL_COOKIE)))
return EFAULT;
@@ -2280,15 +2279,22 @@
if (copyout(OCE_DMAPTR(&dma_mem,char), ioctl_ptr, req_size))
rc = EFAULT;
+ goto dma_free;
/*
firmware is filling all the attributes for this ioctl except
the driver version..so fill it
*/
if(req.u0.rsp.opcode == OPCODE_COMMON_GET_CNTL_ATTRIBUTES) {
- fw_cmd = (struct mbx_common_get_cntl_attr *) ioctl_ptr;
- strncpy(fw_cmd->params.rsp.cntl_attr_info.hba_attr.drv_ver_str,
- COMPONENT_REVISION, strlen(COMPONENT_REVISION));
+ struct mbx_common_get_cntl_attr *fw_cmd =
+ (struct mbx_common_get_cntl_attr *)ioctl_ptr;
+ _Static_assert(sizeof(COMPONENT_REVISION) <=
+ sizeof(fw_cmd->params.rsp.cntl_attr_info.hba_attr.drv_ver_str),
+ "driver version string too long");
+
+ rc = copyout(COMPONENT_REVISION,
+ fw_cmd->params.rsp.cntl_attr_info.hba_attr.drv_ver_str,
+ sizeof(COMPONENT_REVISION));
}
dma_free:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 24, 6:48 AM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41949383
Default Alt Text
D40519.1795502896.diff (1 KB)
Attached To
Mode
D40519: oce(4): Don't directly access usespace
Attached
Detach File
Event Timeline