[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
i386 mmap beyond 4GB (PROT_WRITE)
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: i386 mmap beyond 4GB (PROT_WRITE)
- From: chefren <chefren_(_at_)_pi_(_dot_)_net>
- Date: Mon, 02 May 2005 14:53:28 +0200
On OpenBSD 3.6 i386, a mmap() call with offset near/above 4GB on a
regular file succeeds but, at least for writes, silently wraps around at
the 4GB border. Correctness of reads not tested.
We have taken a look at the kernel sources, but all functions/structures
we've found use 64-bit offset variables (off_t, voff_t).
- Setup path: sys_mmap, uvm_mmap, uvm_map
- Fault path: presumed uvn_get, uvm_pagelookup, uvn_io
(of course the vaddr_t-based "offset-within-the-mapping" calculations
are 32-bit, but the results get implicitly cast up to voff_t in all the
places we've seen).
Which suspects may we have missed?
Is this a "known can of worms", or probably a fixable issue?
Thanks for any help with this,
Visit your host, monkey.org