Page MenuHomeFreeBSD

DIOCGSECTORSIZE expects to write to a u_int, but the struct zfs_probe_args member secsz is uint16_t
ClosedPublic

Authored by allanjude on Jan 7 2016, 1:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 27, 12:34 AM
Unknown Object (File)
Wed, Jun 26, 10:38 PM
Unknown Object (File)
Wed, Jun 26, 10:38 PM
Unknown Object (File)
Mon, Jun 24, 11:23 PM
Unknown Object (File)
Mon, Jun 24, 8:09 PM
Unknown Object (File)
Sat, Jun 22, 4:54 AM
Unknown Object (File)
Sat, Jun 22, 3:49 AM
Unknown Object (File)
Thu, Jun 20, 12:41 PM
Subscribers

Details

Summary

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204358
Submitted by Toomas Soome

sys/boot/zfs/zfs.c has probe args structure including uint16_t secsz variable for media sector size; its used as an argument for ioctl() at line 484

however, this ioctl is expecting 32bit data (u_int *) and therefore this ioctl will overwrite and corrupt 16bits of memory.
other use cases seem to use correct u_int type for secsz.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

allanjude retitled this revision from to DIOCGSECTORSIZE expects to write to a u_int, but the struct zfs_probe_args member secsz is uint16_t.
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
allanjude added reviewers: smh, delphij, asomers, avg, gibbs, will.
asomers edited edge metadata.

LGTM from inspection. If you'd like, I can test it on Monday.

This revision is now accepted and ready to land.Jan 9 2016, 12:09 AM
delphij added a subscriber: tsoome.
delphij edited edge metadata.

This change is reasonable.

smh edited edge metadata.
This revision was automatically updated to reflect the committed changes.