d91d2b513e
These routines are used internally by GEOM to dispatch I/O requests to a provider, typically for tasting or for updating GEOM class metadata blocks. These routines assumed that partial I/O did not occur without setting BIO_ERROR, but this is possible in at least two cases: - Some or all of the I/O range is beyond the provider's mediasize. In this scenario g_io_check() truncates the bounds of the request before it is handed to the target provider. - A read from vnode-backed md(4) device returns EOF (the backing vnode is allowed to be smaller than the device itself) or partial vnode I/O occurs. In these scenarios g_read_data() could return a partially uninitialized buffer. Many consumers are not affected by the first case, since the offsets used for provider metadata or tasting are relative to the provider's mediasize, but in some cases metadata is read at fixed offsets, such as when searching for a UFS superblock using the offsets defined by SBLOCKSEARCH. Thus, modify the routines to explicitly check for a non-zero residual and return EIO in that case. Remove a related check from the DIOCGDELETE ioctl handler, it is handled within g_delete_data() now. Reviewed by: mav, imp, kib Reported by: KMSAN MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31293 |
||
---|---|---|
.. | ||
bde | ||
cache | ||
concat | ||
eli | ||
gate | ||
journal | ||
label | ||
linux_lvm | ||
mirror | ||
mountver | ||
multipath | ||
nop | ||
part | ||
raid | ||
raid3 | ||
shsec | ||
stripe | ||
uzip | ||
vinum | ||
virstor | ||
zero | ||
geom_bsd_enc.c | ||
geom_ccd.c | ||
geom_ctl.c | ||
geom_ctl.h | ||
geom_dbg.h | ||
geom_dev.c | ||
geom_disk.c | ||
geom_disk.h | ||
geom_dump.c | ||
geom_event.c | ||
geom_flashmap.c | ||
geom_flashmap.h | ||
geom_int.h | ||
geom_io.c | ||
geom_kern.c | ||
geom_map.c | ||
geom_redboot.c | ||
geom_slice.c | ||
geom_slice.h | ||
geom_subr.c | ||
geom_vfs.c | ||
geom_vfs.h | ||
geom.h | ||
notes |