Page MenuHomeFreeBSD

fusefs: fix a buffer overflow in the tests
ClosedPublic

Authored by asomers on Feb 22 2023, 12:34 AM.
Tags
None
Referenced Files
F102808671: D38718.diff
Sun, Nov 17, 11:22 AM
Unknown Object (File)
Wed, Nov 13, 1:06 AM
Unknown Object (File)
Mon, Nov 11, 4:46 PM
Unknown Object (File)
Mon, Oct 21, 1:17 PM
Unknown Object (File)
Mon, Oct 21, 1:17 PM
Unknown Object (File)
Mon, Oct 21, 1:17 PM
Unknown Object (File)
Mon, Oct 21, 1:17 PM
Unknown Object (File)
Mon, Oct 21, 1:04 PM
Subscribers

Details

Summary

The actual overflow occured in the ReadAhead.readahead test.
Surprisingly it has never segfaulted or resulted in any bad behavior.

MFC after: 1 week
Sponsored by: Axcient

Test Plan

Added assertions to existing tests

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 49964
Build 46856: arc lint + arc unit

Event Timeline

tests/sys/fs/fusefs/io.cc
144

should this be sizeof(in.body-bytes) - sizeof(struct fuse_write_in) or so?
and another similar case or two

tests/sys/fs/fusefs/io.cc
144

Yes.

  • Fix size comparisons during FUSE_WRITE
  • Add another size check in bmap.cc
This revision is now accepted and ready to land.Feb 22 2023, 4:19 PM
This revision was automatically updated to reflect the committed changes.