diff options
author | Vivek Goyal <vgoyal@in.ibm.com> | 2006-09-29 05:01:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-29 12:18:25 -0400 |
commit | 632dd2053a1146c826ceb6f26ab689389c05e751 (patch) | |
tree | 439c457364f5b58e2de09950e5e0854968e3cde2 /fs | |
parent | 327dcaadc0bc08ad081aa8e36b6ec7ad7aa45e30 (diff) |
[PATCH] Kcore elf note namesz field fix
o As per ELF specifications, it looks like that elf note "namesz" field
contains the length of "name" including the size of null character. And
currently we are filling "namesz" without taking into the consideration
the null character size.
o Kexec-tools performs this check deligently hence I ran into the issue
while trying to open /proc/kcore in kexec-tools for some info.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/kcore.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 3ceff385727..1294eda4aca 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c | |||
@@ -100,7 +100,7 @@ static int notesize(struct memelfnote *en) | |||
100 | int sz; | 100 | int sz; |
101 | 101 | ||
102 | sz = sizeof(struct elf_note); | 102 | sz = sizeof(struct elf_note); |
103 | sz += roundup(strlen(en->name), 4); | 103 | sz += roundup((strlen(en->name) + 1), 4); |
104 | sz += roundup(en->datasz, 4); | 104 | sz += roundup(en->datasz, 4); |
105 | 105 | ||
106 | return sz; | 106 | return sz; |
@@ -116,7 +116,7 @@ static char *storenote(struct memelfnote *men, char *bufp) | |||
116 | 116 | ||
117 | #define DUMP_WRITE(addr,nr) do { memcpy(bufp,addr,nr); bufp += nr; } while(0) | 117 | #define DUMP_WRITE(addr,nr) do { memcpy(bufp,addr,nr); bufp += nr; } while(0) |
118 | 118 | ||
119 | en.n_namesz = strlen(men->name); | 119 | en.n_namesz = strlen(men->name) + 1; |
120 | en.n_descsz = men->datasz; | 120 | en.n_descsz = men->datasz; |
121 | en.n_type = men->type; | 121 | en.n_type = men->type; |
122 | 122 | ||