Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133616850
D24456.id70667.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D24456.id70667.diff
View Options
Index: sys/cam/scsi/scsi_enc.c
===================================================================
--- sys/cam/scsi/scsi_enc.c
+++ sys/cam/scsi/scsi_enc.c
@@ -489,6 +489,10 @@
cam_periph_lock(periph);
error = enc->enc_vec.handle_string(enc, &sstr, cmd);
cam_periph_unlock(periph);
+ if (error == 0 || error == ENOMEM)
+ (void)copyout(&sstr.bufsiz,
+ &((encioc_string_t *)addr)->bufsiz,
+ sizeof(sstr.bufsiz));
break;
case ENCIOC_GETELMSTAT:
Index: sys/cam/scsi/scsi_enc_ses.c
===================================================================
--- sys/cam/scsi/scsi_enc_ses.c
+++ sys/cam/scsi/scsi_enc_ses.c
@@ -2926,11 +2926,11 @@
vendor, product, rev) + 1;
if (rsize > sizeof(str))
rsize = sizeof(str);
- copyout(&rsize, &sstr->bufsiz, sizeof(rsize));
size = rsize;
if (size > sstr->bufsiz)
size = sstr->bufsiz;
copyout(str, sstr->buf, size);
+ sstr->bufsiz = rsize;
return (size == rsize ? 0 : ENOMEM);
case ENCIOC_GETENCID:
if (ses_cache->ses_nsubencs < 1)
@@ -2940,11 +2940,11 @@
scsi_8btou64(enc_desc->logical_id)) + 1;
if (rsize > sizeof(str))
rsize = sizeof(str);
- copyout(&rsize, &sstr->bufsiz, sizeof(rsize));
size = rsize;
if (size > sstr->bufsiz)
size = sstr->bufsiz;
copyout(str, sstr->buf, size);
+ sstr->bufsiz = rsize;
return (size == rsize ? 0 : ENOMEM);
default:
return (EINVAL);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 28, 1:27 AM (16 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24328699
Default Alt Text
D24456.id70667.diff (1 KB)
Attached To
Mode
D24456: Don't try to copyout() to a kernel buffer.
Attached
Detach File
Event Timeline
Log In to Comment