Page MenuHomeFreeBSD

imgact_aout: Widen the overflow check in exec_aout_imgact()
ClosedPublic

Authored by markj on Fri, Sep 25, 4:28 PM.
Tags
None
Referenced Files
F175044436: D60027.diff
Wed, Oct 7, 8:54 PM
Unknown Object (File)
Tue, Oct 6, 5:50 AM
Unknown Object (File)
Tue, Oct 6, 3:58 AM
Unknown Object (File)
Tue, Oct 6, 3:58 AM
Unknown Object (File)
Tue, Oct 6, 2:04 AM
Unknown Object (File)
Mon, Oct 5, 11:20 PM
Unknown Object (File)
Mon, Oct 5, 10:43 PM
Unknown Object (File)
Mon, Oct 5, 9:53 PM
Subscribers

Details

Summary

I suspect this overflow check isn't needed at all, at least today, since
vm_map_insert() will detect wraparound when it creates segments (and
even a check against UINT_MAX is too loose, since the max user address
is AOUT32_USRSTACK == 0xbfc00000). But if we're going to keep this
check, there doesn't seem to be any downside to applying it on all
platforms, before exec_new_vmspace() tears down the current vmspace.

Reported by: Muhammed Sariyildiz <asiyee994@gmail.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77333
Build 74216: arc lint + arc unit

Event Timeline

markj requested review of this revision.Fri, Sep 25, 4:28 PM
kib added inline comments.
sys/kern/imgact_aout.c
239

Don't we want the same uint64_t cast there as well?

241

Add () != 0 since you are changing the line anyway.

This revision is now accepted and ready to land.Fri, Sep 25, 6:32 PM
markj marked 2 inline comments as done.

Handle feedback

This revision now requires review to proceed.Sat, Sep 26, 7:24 PM
This revision is now accepted and ready to land.Sat, Sep 26, 7:25 PM