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] [day] [month] [year] [list]
Date:   Wed, 24 May 2017 10:12:21 -0700
From:   Kees Cook <keescook@...gle.com>
To:     Ankit Kumar <ankit@...ux.vnet.ibm.com>
Cc:     Anton Vorontsov <anton@...msg.org>,
        Colin Cross <ccross@...roid.com>,
        Tony Luck <tony.luck@...el.com>,
        LKML <linux-kernel@...r.kernel.org>, anton@....ibm.com,
        "mahesh@...ux.vnet.ibm.com" <mahesh@...ux.vnet.ibm.com>,
        Hari Bathini <hbathini@...ux.vnet.ibm.com>,
        hegdevasant@...ux.vnet.ibm.com
Subject: Re: [PATCH]pstore: Don't warn if data is uncompressed and type is not PSTORE_TYPE_DMESG

On Mon, May 22, 2017 at 10:46 PM, Ankit Kumar <ankit@...ux.vnet.ibm.com> wrote:
> commit 9abdcccc3d5f ("pstore: Extract common arguments into structure") moved
> record decompression to function. decompress_record() gets called without
> checking type and compressed flag. Warning will be reported if data is
> uncompressed. Pstore type PSTORE_TYPE_PPC_OPAL, PSTORE_TYPE_PPC_COMMON doesn't
> contain compressed data and warning get printed part of dmesg.
>
> Partial dmesg log:
> [   35.848914] pstore: ignored compressed record type 6
> [   35.848927] pstore: ignored compressed record type 8
>
> Above warning should not get printed as it is known that data won't be
> compressed for above type and it is valid condition.
>
> This patch returns if data is not compressed and print warning only if data is
> compressed and type is not PSTORE_TYPE_DMESG.

Ah, thanks for catching that! Applied for -next.

-Kees

>
> Reported-by: Anton Blanchard <anton@....ibm.com>
> Signed-off-by: Ankit Kumar <ankit@...ux.vnet.ibm.com>
> Reviewed-by: Mahesh Salgaonkar <mahesh@...ux.vnet.ibm.com>
> ---
>  fs/pstore/platform.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
> index d468eec..b304553 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -770,8 +770,11 @@ static void decompress_record(struct pstore_record *record)
>         int unzipped_len;
>         char *decompressed;
>
> +       if (!record->compressed)
> +               return;
> +
>         /* Only PSTORE_TYPE_DMESG support compression. */
> -       if (!record->compressed || record->type != PSTORE_TYPE_DMESG) {
> +       if (record->type != PSTORE_TYPE_DMESG) {
>                 pr_warn("ignored compressed record type %d\n", record->type);
>                 return;
>         }
> --
> 2.7.4
>



-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ