Skip to contentSkip to conversation

proc_file_read: Apparent buffer overflow

Xenomai-core Stefan Kisdaroczi 2 participants 3 messages Mar 10, 2010 – Mar 18, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

cat /proc/xenomai/heap returns the first 4096 Bytes and fails then with "Bad address". On the console I see: "proc_file_read: Apparent buffer overflow!"

xeno 2.5.1, linux 2.6.32.8, x86 32bit UP, native skin, lot of rt_queues:

# ls -1 /proc/xenomai/registry/native/queues/ | wc -l
233
# ls -1 /proc/xenomai/registry/native/heaps/ | wc -l
26

regards
Stefan

#1 lore raw

Am 10.03.2010 19:56, schrieb Stefan Kisdaroczi:

Quoted 10 lines

Hi,

cat /proc/xenomai/heap returns the first 4096 Bytes and fails then with "Bad address". On the console I see: "proc_file_read: Apparent buffer overflow!"

xeno 2.5.1, linux 2.6.32.8, x86 32bit UP, native skin, lot of rt_queues:

# ls -1 /proc/xenomai/registry/native/queues/ | wc -l
233
# ls -1 /proc/xenomai/registry/native/heaps/ | wc -l
26

With some luck i get a oops doing cat /proc/xenomai/heap. Looking at the while() loop in heap_read_proc() in ksrc/nucleus/heap.c its obvious.

Stefan

#2 lore raw
Quoted 12 lines · Stefan Kisdaroczi

Am 10.03.2010 19:56, schrieb Stefan Kisdaroczi:

Quoted 10 lines

Hi,

cat /proc/xenomai/heap returns the first 4096 Bytes and fails then with "Bad address". On the console I see: "proc_file_read: Apparent buffer overflow!"

xeno 2.5.1, linux 2.6.32.8, x86 32bit UP, native skin, lot of rt_queues:

# ls -1 /proc/xenomai/registry/native/queues/ | wc -l
233
# ls -1 /proc/xenomai/registry/native/heaps/ | wc -l
26
Quoted 3 lines

With some luck i get a oops doing cat /proc/xenomai/heap. Looking at the while() loop in heap_read_proc() in ksrc/nucleus/heap.c its obvious.

You mean because "count" isn't checked while the output page is filled? Well, looks like converting the heap proc interface to the seq API is a good idea. References can be found in ksrc/nucleus/sched.c, patches are welcome. :)

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux