Skip to contentSkip to conversation

ARM:kernel: memcpy, checking the length before copy.

Suggestion Chen Gang 1 participant 1 message Jan 28, 2013

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

Hello Russell King:

in arch/arm/kernel/fiq.c:

since the function set_fiq_handler is an EXPORT_SYMBOL function. do we need checking memory length, before copy ?
(have to understand the madly using by outside users)

if really it is, maybe also need provide the return value for failure.

Regards

gchen.

80 void set_fiq_handler(void *start, unsigned int length) 81 {
82 #if defined(CONFIG_CPU_USE_DOMAINS)
83 memcpy((void *)0xffff001c, start, length);
84 #else
85 memcpy(vectors_page + 0x1c, start, length);
86 #endif
87 flush_icache_range(0xffff001c, 0xffff001c + length);
88 if (!vectors_high())
89 flush_icache_range(0x1c, 0x1c + length);
90 }
91
...

137 EXPORT_SYMBOL(set_fiq_handler);