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]
Date:   Mon, 6 Jun 2022 16:34:36 -0700
From:   Stephen Boyd <swboyd@...omium.org>
To:     Prashant Malani <pmalani@...omium.org>,
        linux-kernel@...r.kernel.org
Cc:     bleung@...omium.org, Guenter Roeck <groeck@...omium.org>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        Tzung-Bi Shih <tzungbi@...nel.org>,
        Brian Norris <briannorris@...omium.org>,
        chrome-platform@...ts.linux.dev
Subject: Re: [PATCH 3/3] platform/chrome: cros_ec_proto: Update size arg types

Quoting Prashant Malani (2022-06-06 13:18:05)
> cros_ec_cmd() takes 2 size arguments. Update them to be of the more
> appropriate type size_t.
>
> Suggested-by: Stephen Boyd <swboyd@...omium.org>
> Signed-off-by: Prashant Malani <pmalani@...omium.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@...omium.org>

> diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h
> index 816da4eef3e5..85e29300f63d 100644
> --- a/include/linux/platform_data/cros_ec_proto.h
> +++ b/include/linux/platform_data/cros_ec_proto.h
> @@ -232,7 +232,7 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature);
>  int cros_ec_get_sensor_count(struct cros_ec_dev *ec);
>
>  int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, void *outdata,
> -                   int outsize, void *indata, int insize);
> +                   size_t outsize, void *indata, size_t insize);

We should also mark 'outdata' as const in another patch because it's
being copied out and I assume unmodified by the callee. It's nice to
tell the caller that their data will be sent unmodified.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ