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)
Wed, Dec 4, 5:05 PM
Unknown Object (File)
Nov 24 2024, 10:13 AM
Unknown Object (File)
Nov 13 2024, 10:29 AM
Unknown Object (File)
Nov 3 2024, 5:36 PM
Unknown Object (File)
Oct 23 2024, 1:41 AM
Unknown Object (File)
Oct 23 2024, 1:41 AM
Unknown Object (File)
Oct 23 2024, 1:41 AM
Unknown Object (File)
Oct 23 2024, 1:21 AM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 1977
Build 1985: arc lint + arc unit

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.