Latest working kernel version:
Earliest failing kernel version:
Distribution: Sles 10 SP 1
Hardware Environment: HP Proliant DL140
I wrote a simple test that use mmap64 to map a file (/dev/zero) with an offset value of 0x100000000. When I check /proc/self/maps the offset value reported is 00000000. The issue is in fs/proc/task_mmu.c function 'show_map' where 'seq_printf' use the %lx converter to print a (long * PAGE_SIZE) value.
In my case the offset is 0x100000000 (long long) and the pgoffset is 0x100000 (long).
Steps to reproduce:
I will attach the test I wrote (compile line: $ gcc -O2 -g -Wall mmap64.c -o mmap64) and a patch that seems to correct this issue.
Created attachment 17218 [details]
a program that use mmap64 to mmap with an offset > 2^32 and display the associated line in /proc/self/maps
gcc -g -Wall -O2 src/mmap64.c -o mmap64
Result on a 2.6.26:
offset = 100000000
b7efd000-b7efe000 r--p 00000000 00:0e 2050 /dev/zero
Created attachment 17219 [details]
A way to correct the /proc/self/maps output
Test on 2.6.26, i386 and x86_64.
Please submit patches via email, as per Documentation/SubmittingPatches.
cc this one to email@example.com and to firstname.lastname@example.org
Merged proc-self-maps-doesnt-display-the-real-file-offset.patch into -mm.