Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149230291
D18536.1789715028.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
874 B
Referenced Files
None
Subscribers
None
D18536.1789715028.diff
View Options
Index: head/sys/dev/tws/tws_user.c
===================================================================
--- head/sys/dev/tws/tws_user.c
+++ head/sys/dev/tws/tws_user.c
@@ -92,9 +92,13 @@
struct tws_request *req;
struct tws_ioctl_no_data_buf *ubuf = (struct tws_ioctl_no_data_buf *)buf;
int error;
+ u_int32_t buffer_length;
u_int16_t lun4;
-
+ buffer_length = roundup2(ubuf->driver_pkt.buffer_length, 512);
+ if ( buffer_length > TWS_MAX_IO_SIZE ) {
+ return(EINVAL);
+ }
if ( tws_get_state(sc) != TWS_ONLINE) {
return(EBUSY);
}
@@ -118,7 +122,7 @@
}
} while(1);
- req->length = (ubuf->driver_pkt.buffer_length + 511) & ~511;
+ req->length = buffer_length;
TWS_TRACE_DEBUG(sc, "datal,rid", req->length, req->request_id);
if ( req->length ) {
req->data = sc->ioctl_data_mem;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 18, 7:03 AM (4 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29736525
Default Alt Text
D18536.1789715028.diff (874 B)
Attached To
Mode
D18536: Add bounds checking to the tws(4) passthrough ioctl handler.
Attached
Detach File
Event Timeline
Log In to Comment