lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120518214939.GA5412@lizard>
Date:	Fri, 18 May 2012 14:49:39 -0700
From:	Anton Vorontsov <anton.vorontsov@...aro.org>
To:	Kees Cook <keescook@...omium.org>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Colin Cross <ccross@...roid.com>,
	Tony Luck <tony.luck@...el.com>, Arnd Bergmann <arnd@...db.de>,
	John Stultz <john.stultz@...aro.org>,
	Shuah Khan <shuahkhan@...il.com>, arve@...roid.com,
	Rebecca Schultz Zavin <rebecca@...roid.com>,
	Jesper Juhl <jj@...osbits.net>,
	Randy Dunlap <rdunlap@...otime.net>,
	Stephen Boyd <sboyd@...eaurora.org>,
	Thomas Meyer <thomas@...3r.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Marco Stornelli <marco.stornelli@...il.com>,
	WANG Cong <xiyou.wangcong@...il.com>,
	linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
	linaro-kernel@...ts.linaro.org, patches@...aro.org,
	kernel-team@...roid.com
Subject: Re: [PATCH 2/3] pstore/ram: Switch to persistent_ram routines

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@...il.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ