| Anonymous | Login | Signup for a new account | 11-10-2008 11:13 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0001303 | [uClibc] Architecture Specific | major | always | 04-05-07 01:47 | 09-26-08 01:26 | ||||
| Reporter | anlo | View Status | public | ||||||
| Assigned To | uClibc | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | |||||||
| Summary | 0001303: mmap: unsigned shift operation => overflow error | ||||||||
| Description |
Product version: 0.9.29 (2007-04-02) When trying to map /dev/mem with offset 0xFFFFF000 on the ARM platform, mmap returns -EOVERFLOW. After some investigation, I have found the cause in uClibc/libc/sysdeps/linux/arm/mmap.c: Since off_t is defined as a long int and the sign bit is set in the address, the shift operation at line 45 (see below) shifts in ones instead of zeroes from the left. This results the offset sent to the kernel function becomes 0xFFFFFFFF instead of 0x000FFFFF with MMAP2_PAGE_SHIFT set to 12. (off_t) (offset >> MMAP2_PAGE_SHIFT) Proposed change, since the kernel function (do_mmap) expects offset as unsigned long: ((unsigned long) offset >> MMAP2_PAGE_SHIFT) |
||||||||
| Additional Information | |||||||||
| Attached Files | |||||||||
|
|
|||||||||
Notes |
|
|
(0002350) khem 05-09-07 13:25 |
Yes this should fix the problem. I verified it. However the same fix needs to be applied to ./libc/sysdeps/linux/common/mmap64.c as well |
|
(0002358) khem 05-14-07 17:40 |
A patch which fixes this problem has been installed on trunk. Please verify with the latest trunk. here is the patch as applied. http://uclibc.org/lists/uclibc-cvs/2007-May/011360.html [^] |
| Copyright © 2000 - 2006 Mantis Group |