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: <CAGXu5jJZH0fh_q7o2w2_tX3Xxyn2xm-55J62JcucgfWBUYkU5Q@mail.gmail.com>
Date:   Wed, 27 Jun 2018 14:56:20 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Tony Lindgren <tony@...mide.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH] bus: ti-sysc: Use 2-factor allocator arguments

On Mon, Jun 18, 2018 at 10:45 AM, Kees Cook <keescook@...omium.org> wrote:
> This adjusts the allocator calls to use 2-factor argument call style, as
> done treewide already for improved defense against allocation overflows.
>
> Signed-off-by: Kees Cook <keescook@...omium.org>

Friendly ping! :) This is the last 2-factor devm* allocation left in
4.18 to be fixed.

Thanks!

-Kees

> ---
>  drivers/bus/ti-sysc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> index 1cc29629d238..80d60f43db56 100644
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -169,9 +169,9 @@ static int sysc_get_clocks(struct sysc *ddata)
>         const char *name;
>         int nr_fck = 0, nr_ick = 0, i, error = 0;
>
> -       ddata->clock_roles = devm_kzalloc(ddata->dev,
> -                                         sizeof(*ddata->clock_roles) *
> +       ddata->clock_roles = devm_kcalloc(ddata->dev,
>                                           SYSC_MAX_CLOCKS,
> +                                         sizeof(*ddata->clock_roles),
>                                           GFP_KERNEL);
>         if (!ddata->clock_roles)
>                 return -ENOMEM;
> @@ -200,8 +200,8 @@ static int sysc_get_clocks(struct sysc *ddata)
>                 return -EINVAL;
>         }
>
> -       ddata->clocks = devm_kzalloc(ddata->dev,
> -                                    sizeof(*ddata->clocks) * ddata->nr_clocks,
> +       ddata->clocks = devm_kcalloc(ddata->dev,
> +                                    ddata->nr_clocks, sizeof(*ddata->clocks),
>                                      GFP_KERNEL);
>         if (!ddata->clocks)
>                 return -ENOMEM;
> --
> 2.17.0
>
>
> --
> Kees Cook
> Pixel Security



-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ