freebsd-dev/sys/cam/scsi
John Baldwin 5326289d93 Don't try to copyout() to a kernel buffer.
The handle_string callback for the ENCIOC_GET_ENCNAME and
ENCIOC_GETENCID ioctls tries to copy the size of the generated string
out to userland.  However, the callback only has access to the kernel
copy of the structure populated by copyin().  The copyout() call
simply overwrites the value in the kernel's copy preventing the
subsequent overflow prevention logic from working.

Fix this by instead doing a copyout() of the updated length in the
caller after the callback returns.

Reviewed by:	kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24456
2020-04-17 18:19:13 +00:00
..
scsi_all.c sys/cam: remove doubled ;s 2020-03-20 16:15:45 +00:00
scsi_all.h Remove redundantly repetitive static __inline forward function 2020-03-11 15:12:31 +00:00
scsi_cd.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
scsi_cd.h scsi_cd: make the media check asynchronous 2019-08-29 07:51:11 +00:00
scsi_ch.c cam_periph_acquire() now returns an errno. 2018-03-19 20:19:00 +00:00
scsi_ch.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_da.c sys/cam: remove doubled ;s 2020-03-20 16:15:45 +00:00
scsi_da.h Improve support for informational exceptions. 2016-12-19 10:25:47 +00:00
scsi_enc_internal.h Make CAM use root_mount_hold_token() to delay boot. 2019-11-22 18:39:51 +00:00
scsi_enc_safte.c Improve AHCI Enclosure Management and SES interoperation. 2019-06-23 19:05:01 +00:00
scsi_enc_ses.c Don't try to copyout() to a kernel buffer. 2020-04-17 18:19:13 +00:00
scsi_enc.c Don't try to copyout() to a kernel buffer. 2020-04-17 18:19:13 +00:00
scsi_enc.h Improve AHCI Enclosure Management and SES interoperation. 2019-06-23 19:05:01 +00:00
scsi_iu.h
scsi_message.h Add partial support for QUERY TMF to CAM and isp(4). 2015-10-23 18:34:18 +00:00
scsi_pass.c Checks here against useracc are not useful and are racy. 2020-04-13 21:04:33 +00:00
scsi_pass.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_pt.c Return a C errno for cam_periph_acquire(). 2018-02-06 06:42:25 +00:00
scsi_pt.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_sa.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
scsi_sa.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_ses.h Improve AHCI Enclosure Management and SES interoperation. 2019-06-23 19:05:01 +00:00
scsi_sg.c Remove NEEDGIANT from the scsi_sg /dev node. It likely has not been 2019-11-22 18:18:36 +00:00
scsi_sg.h
scsi_targ_bh.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_target.c Define xpt_path_inq. 2017-12-06 23:05:22 +00:00
scsi_targetio.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_xpt.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
smp_all.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
smp_all.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00