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: <CAGXu5jKi2NPxtjj9ABXoofCh-aRa64x=NZctpWcK9umwH4ByjQ@mail.gmail.com>
Date:   Thu, 8 Sep 2016 13:37:12 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Anton Vorontsov <anton@...msg.org>,
        Colin Cross <ccross@...roid.com>,
        Tony Luck <tony.luck@...el.com>
Subject: Re: [PATCH v3.1 2/2] pstore/ram: Set pstore flags dynamically

On Fri, Jul 22, 2016 at 6:45 AM, Namhyung Kim <namhyung@...nel.org> wrote:
> The ramoops can be configured to enable each pstore type by setting
> their size.  In that case, it'd be better not to register disabled types
> in the first place.
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  fs/pstore/ram.c        | 8 +++++++-
>  include/linux/pstore.h | 2 --
>  2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index d08bfd611b11..c5316c0ac756 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -539,7 +539,13 @@ static int ramoops_probe(struct platform_device *pdev)
>                 goto fail_clear;
>         }
>
> -       cxt->pstore.flags = PSTORE_FLAGS_ALL;
> +       cxt->pstore.flags = PSTORE_FLAGS_DMESG;
> +       if (cxt->console_size)
> +               cxt->pstore.flags |= PSTORE_FLAGS_CONSOLE;
> +       if (cxt->ftrace_size)
> +               cxt->pstore.flags |= PSTORE_FLAGS_FTRACE;
> +       if (cxt->pmsg_size)
> +               cxt->pstore.flags |= PSTORE_FLAGS_PMSG;
>
>         err = pstore_register(&cxt->pstore);
>         if (err) {
> diff --git a/include/linux/pstore.h b/include/linux/pstore.h
> index 3ba0c1af40e5..a6d80bd960cb 100644
> --- a/include/linux/pstore.h
> +++ b/include/linux/pstore.h
> @@ -78,8 +78,6 @@ struct pstore_info {
>  #define PSTORE_FLAGS_FTRACE    (1 << 2)
>  #define PSTORE_FLAGS_PMSG      (1 << 3)
>
> -#define PSTORE_FLAGS_ALL       ((1 << 4) - 1)
> -
>  extern int pstore_register(struct pstore_info *);
>  extern void pstore_unregister(struct pstore_info *);
>  extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason);
> --
> 2.8.0
>

Hi!

I've pulled this and the 1/2 patch for -next now. I made one small
change, which was to leave FLAGS_FRAGILE defined as FLAGS_DMESG just
to make merging the virtio driver easier.

-Kees

-- 
Kees Cook
Nexus Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ