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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120516222823.GA22797@lizard>
Date:	Wed, 16 May 2012 15:28:23 -0700
From:	Anton Vorontsov <cbouatmailru@...il.com>
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/6] pstore/ram: Add console messages handling

On Wed, May 16, 2012 at 09:45:35AM -0700, Kees Cook wrote:
> On Wed, May 16, 2012 at 5:56 AM, Anton Vorontsov
> <anton.vorontsov@...aro.org> wrote:
> > This is all straightforward: we just use the last region for
> > console logging. If there's just one region, we fall-back to
> > the old behaviour: just a oops/dumps logging.
> >
> > Signed-off-by: Anton Vorontsov <anton.vorontsov@...aro.org>
> > ---
> >  fs/pstore/ram.c |   39 ++++++++++++++++++++++++++++++---------
> >  1 file changed, 30 insertions(+), 9 deletions(-)
> >
> > diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> > index 9123cce..54213eb 100644
> > --- a/fs/pstore/ram.c
> > +++ b/fs/pstore/ram.c
> > [...]
> > @@ -142,7 +148,12 @@ static int ramoops_pstore_write(enum pstore_type_id type,
> >        struct persistent_ram_zone *prz = cxt->przs[cxt->count];
> >        size_t hlen;
> >
> > -       /* Currently ramoops is designed to only store dmesg dumps. */
> > +       if (type == PSTORE_TYPE_CONSOLE) {
> > +               if (!cxt->cprz)
> > +                       return -ENOMEM;
> > +               persistent_ram_write(cxt->cprz, cxt->pstore.buf, size);
> > +       }
> > +
> >        if (type != PSTORE_TYPE_DMESG)
> >                return -EINVAL;
> 
> Doesn't this mean that type == PSTORE_TYPE_CONSOLE will write to the
> ram, but then fail with -EINVAL?

Right you are, there should be 'return 0' for TYPE_CONSOLE. It is
harmless tho (and unnoticeable, since we can't check return value of
the ->write() calback and print error, since this would recurse),
but I'll surely amend that.

Thanks!

-- 
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