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, 10 Apr 2024 15:27:43 -0700
From: Pavan Holla <pholla@...omium.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Heikki Krogerus <heikki.krogerus@...ux.intel.com>, Benson Leung <bleung@...omium.org>, 
	Tzung-Bi Shih <tzungbi@...nel.org>, Guenter Roeck <groeck@...omium.org>, linux-kernel@...r.kernel.org, 
	linux-usb@...r.kernel.org, 
	Abhishek Pandit-Subedi <abhishekpandit@...omium.org>, chrome-platform@...ts.linux.dev
Subject: Re: [PATCH v4 2/2] usb: typec: ucsi: Implement ChromeOS UCSI driver

I plan to upload the next version after related EC changes land on
ChromeOS. That might take a few weeks.

On Tue, Apr 9, 2024 at 8:16 AM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> On Tue, Apr 09, 2024 at 02:27:37AM +0000, Pavan Holla wrote:
> > +#define DRV_NAME "cros-ec-ucsi"
>
> KBUILD_MODNAME?

Will replace DRV_NAME with KBUILD_MODNAME.

> > +
> > +#define MAX_EC_DATA_SIZE 256
> > +#define WRITE_TMO_MS 500
>
> What are these and why these values?  And tabs perhaps?

MAX_EC_DATA_SIZE is the number of bytes that can be read or written to in the
UCSI data structure using a single host command to the EC.
WRITE_TMO_MS is the time within which a cmd complete or ack notification must
arrive after a command is sent to the PPM.

Will add comments and tabs.

> > +     uint8_t ec_buffer[MAX_EC_DATA_SIZE + sizeof(struct ec_params_ucsi_ppm_set)];
>
> That's a lot of data on the stack, are you sure you want to do that?
>
> And are you sure you are allowed to have this data on the stack?  It
> never ends up being sent using DMA?

I confirmed that this data isn't DMA'ed. However, I don't mind putting
it on the heap, and will do so in the next version.

> And please, don't use non-kernel types like "uint8_t", use "u8" like
> intended.  This isn't userspace (yes, I know a lot of kernel code uses
> these, but as you are going to change this, might as well change that
> too.)

Ack.

Thanks,
Pavan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ