From: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
To: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Cc: V Srivatsa <vsrivatsa@in.ibm.com>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
kexec@lists.infradead.org,
Tachibana-san <tachibana@mxm.nes.nec.co.jp>,
Dave Anderson <anderson@redhat.com>,
Reinhard <BUENDGEN@de.ibm.com>
Subject: Re: [UPDATED PATCH v2 8/8] makedumpfile: Add erase information in ELF formatted dumpfile
Date: Tue, 16 Aug 2011 16:51:16 +0530 [thread overview]
Message-ID: <4E4A52AC.2060407@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110815145451.44f9d605.oomichi@mxs.nes.nec.co.jp>
On 08/15/2011 11:24 AM, Ken'ichi Ohmichi wrote:
>
> Hi Mahesh,
>
> On Fri, 15 Jul 2011 14:46:02 +0530
> Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:
>> @@ -4647,6 +4650,15 @@ write_cache_bufsz(struct cache_data *cd)
>> }
>>
>> int
>> +write_cache_zero(struct cache_data *cd, size_t size)
>> +{
>> + memset(cd->buf + cd->buf_size, 0, size);
>> + cd->buf_size += size;
>> +
>> + return write_cache_bufsz(cd);
>> +}
>
> if cd->buf_size is a little smaller than cd->cache_size and
> the argument "size" is bigger than info->page_size, the above
> a SIGSEGV happens at the above memset().
>
> Previous write_cache_bufsze() call will avoid that :
> ---
> int
> write_cache_zero(struct cache_data *cd, size_t size)
> {
> + if (!write_cache_bufsz(cd))
> + return FALSE;
>
> memset(cd->buf + cd->buf_size, 0, size);
> cd->buf_size += size;
>
> return write_cache_bufsz(cd);
> }
> ---
Nice catch. Agree.
>
>> /*
>> + * ELF note section for erase information
>> + *
>> + * According to elf.h the unused values are 0x15(21) through 0xff. The value
>> + * range 0x1XX, 0x2XX and 0x3XX is been used for PPC, i386 and s390
>> + * respectively.
>> + *
>> + * Using 0xff to be on safer side so that any new Elf Note addition in elf.h
>> + * after 0x15 value would not clash.
>> + */
>> +#ifndef NT_ERASE_INFO
>> +#define NT_ERASE_INFO (0xff) /* Contains erased information. */
>> +#endif
>> +#define ERASEINFO_NOTE_NAME "ERASEINFO"
>> +#define ERASEINFO_NOTE_NAME_BYTES (sizeof(ERASEINFO_NOTE_NAME))
>
> I feel NT_ERASE_INFO(0xff) is not safe and we can use ERASEINFO_NOTE_NAME
> instead.
Do you mean having n_type set to '0' and just using
'ERASEINFO_NOTE_NAME' to identify the eraseinfo note? if Yes, then I
think I am ok with that.
Thanks,
-Mahesh.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2011-08-16 11:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 20:07 [PATCH v2 8/8] makedumpfile: Add erase information in ELF formatted dumpfile Mahesh J Salgaonkar
2011-07-15 9:16 ` [UPDATED PATCH " Mahesh J Salgaonkar
2011-08-15 5:54 ` Ken'ichi Ohmichi
2011-08-16 11:21 ` Mahesh Jagannath Salgaonkar [this message]
2011-08-17 3:49 ` Ken'ichi Ohmichi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E4A52AC.2060407@linux.vnet.ibm.com \
--to=mahesh@linux.vnet.ibm.com \
--cc=BUENDGEN@de.ibm.com \
--cc=ananth@in.ibm.com \
--cc=anderson@redhat.com \
--cc=kexec@lists.infradead.org \
--cc=oomichi@mxs.nes.nec.co.jp \
--cc=tachibana@mxm.nes.nec.co.jp \
--cc=vsrivatsa@in.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox