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: <CAGXu5jJcJ8cqunCUaq9qadF7748O=8RSM3Hre+qo23txLqUMRg@mail.gmail.com>
Date:   Wed, 28 Sep 2016 12:45:13 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Geliang Tang <geliangtang@...il.com>
Cc:     Anton Vorontsov <anton@...msg.org>,
        Colin Cross <ccross@...roid.com>,
        Tony Luck <tony.luck@...el.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ramoops: add pdata NULL check to ramoops_probe

On Wed, Sep 28, 2016 at 3:32 AM, Geliang Tang <geliangtang@...il.com> wrote:
> When the pdata is NULL, ramoops_probe() segfaults. So this patch adds
> a NULL check to it.

While I don't mind the check, is this even possible? A device
triggering a ramoops probe should already have a platform_data
(excepting the DT case which is already covered). Is there a situation
you can create to trigger this Oops?

-Kees

>
> Signed-off-by: Geliang Tang <geliangtang@...il.com>
> ---
>  fs/pstore/ram.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index 6ad831b..dd9832d 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -576,6 +576,9 @@ static int ramoops_probe(struct platform_device *pdev)
>         if (cxt->max_dump_cnt)
>                 goto fail_out;
>
> +       if (!pdata)
> +               goto fail_out;
> +
>         if (!pdata->mem_size || (!pdata->record_size && !pdata->console_size &&
>                         !pdata->ftrace_size && !pdata->pmsg_size)) {
>                 pr_err("The memory size and the record/console size must be "
> --
> 2.7.4
>



-- 
Kees Cook
Nexus Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ