From: Anton Vorontsov <anton.vorontsov@linaro.org>
To: Kees Cook <keescook@chromium.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
Arnd Bergmann <arnd@arndb.de>,
John Stultz <john.stultz@linaro.org>,
Shuah Khan <shuahkhan@gmail.com>,
arve@android.com, Rebecca Schultz Zavin <rebecca@android.com>,
Jesper Juhl <jj@chaosbits.net>,
Randy Dunlap <rdunlap@xenotime.net>,
Stephen Boyd <sboyd@codeaurora.org>,
Thomas Meyer <thomas@m3y3r.de>,
Andrew Morton <akpm@linux-foundation.org>,
Marco Stornelli <marco.stornelli@gmail.com>,
WANG Cong <xiyou.wangcong@gmail.com>,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
linaro-kernel@lists.linaro.org, patches@linaro.org,
kernel-team@android.com
Subject: Re: [PATCH 2/3] pstore/ram: Switch to persistent_ram routines
Date: Fri, 18 May 2012 14:49:39 -0700 [thread overview]
Message-ID: <20120518214939.GA5412@lizard> (raw)
In-Reply-To: <CAGXu5jJY478UM0fnqB5SML0gCc1HxoJyA-d6+rZH6mTWQkGegw@mail.gmail.com>
On Thu, May 17, 2012 at 09:34:19AM -0700, Kees Cook wrote:
[...]
> > - memcpy(buf, cxt->pstore.buf, size);
> > - memset(buf + size, '\0', available - size);
> > + hlen = ramoops_write_kmsg_hdr(prz);
> > + if (size + hlen > prz->buffer_size)
> > + size = prz->buffer_size - hlen;
> > + persistent_ram_write(prz, cxt->pstore.buf, size);
>
> This still needs to wipe out the remaining bytes in the buffer (the
> second memset above).
[...]
> > - buf = cxt->virt_addr + (id * cxt->record_size);
> > - memset(buf, '\0', cxt->record_size);
> > + persistent_ram_free_old(cxt->przs[id]);
>
> Same here -- erasing the buffer means wiping it with NULL bytes.
Well, with persistent_ram we don't need to actually erase buffers
(with persistent_ram we might even hold binary data). But yes,
we'd better reset size pointer, otherwise the unlinked buffer
will show up on the next reboot. Thanks for noticing!
--
Anton Vorontsov
Email: cbouatmailru@gmail.com
next prev parent reply other threads:[~2012-05-18 21:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-17 7:11 [PATCH v3 0/3] Merge ramoops and persistent_ram, generic pstore RAM backend Anton Vorontsov
2012-05-17 7:15 ` [PATCH 1/3] persistent_ram: Move to fs/pstore/ram_core.c Anton Vorontsov
2012-05-17 7:15 ` [PATCH 2/3] pstore/ram: Switch to persistent_ram routines Anton Vorontsov
2012-05-17 16:34 ` Kees Cook
2012-05-18 21:49 ` Anton Vorontsov [this message]
2012-05-17 7:15 ` [PATCH 3/3] pstore/ram: Add ECC support Anton Vorontsov
2012-05-17 15:52 ` [PATCH v3 0/3] Merge ramoops and persistent_ram, generic pstore RAM backend Greg Kroah-Hartman
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=20120518214939.GA5412@lizard \
--to=anton.vorontsov@linaro.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=arve@android.com \
--cc=ccross@android.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jj@chaosbits.net \
--cc=john.stultz@linaro.org \
--cc=keescook@chromium.org \
--cc=kernel-team@android.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marco.stornelli@gmail.com \
--cc=patches@linaro.org \
--cc=rdunlap@xenotime.net \
--cc=rebecca@android.com \
--cc=sboyd@codeaurora.org \
--cc=shuahkhan@gmail.com \
--cc=thomas@m3y3r.de \
--cc=tony.luck@intel.com \
--cc=xiyou.wangcong@gmail.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