]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vmcore, sysfs: export ELF note segment size instead of vmcoreinfo data size
authorHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Wed, 20 Mar 2013 04:08:34 +0000 (15:08 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Mar 2013 04:23:27 +0000 (15:23 +1100)
commitc081f5f795a5815a26343646a1de016786dd5922
treed154463a021c32cc6adc9cc9f9b421acaf1daed1
parentcc2d145a9e8ebe4d78d43747e3acaa9cd768c844
vmcore, sysfs: export ELF note segment size instead of vmcoreinfo data size

Currently, vmcoreinfo exports data part only, but kexec-tool sets it in
p_memsz member as a whole ELF note segment size.  Due to this, it would be
no problem on the current ELF note segment size, but if it grows in the
future, then read possibly doesn't reach ELF note header in larger p_memsz
position, failing to read a whole ELF segment.

Note: kexec-tools assigns PAGE_SIZE to p_memsz for other ELF note types.
Due to the above reason, the same issue occurs if actual ELF note data
exceeds (PAGE_SIZE - 2 * KEXEC_NOTE_HEAD_BYTES).

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/ksysfs.c