Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149177004
D18536.1789631991.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
859 B
Referenced Files
None
Subscribers
None
D18536.1789631991.diff
View Options
Index: sys/dev/tws/tws_user.c
===================================================================
--- sys/dev/tws/tws_user.c
+++ 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
Thu, Sep 17, 7:59 AM (1 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29724069
Default Alt Text
D18536.1789631991.diff (859 B)
Attached To
Mode
D18536: Add bounds checking to the tws(4) passthrough ioctl handler.
Attached
Detach File
Event Timeline
Log In to Comment