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: <f2a361aa-a256-41a5-8100-703e40df975d@t-8ch.de>
Date: Tue, 11 Jun 2024 09:23:24 +0200
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Tzung-Bi Shih <tzungbi@...nel.org>
Cc: Benson Leung <bleung@...omium.org>, 
	Guenter Roeck <groeck@...omium.org>, Sebastian Reichel <sre@...nel.org>, 
	"Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>, 
	Robert Moore <robert.moore@...el.com>, chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org, 
	linux-pm@...r.kernel.org, Mario Limonciello <mario.limonciello@....com>, 
	Dustin Howett <dustin@...ett.net>, Stephen Horvath <s.horvath@...look.com.au>, 
	Rajas Paranjpe <paranjperajas@...il.com>, linux-acpi@...r.kernel.org, acpica-devel@...ts.linux.dev, 
	Matt Hartley <matt.hartley@...il.com>
Subject: Re: [PATCH v3 3/5] platform/chrome: cros_ec_proto: Introduce
 cros_ec_cmd_versions()

On 2024-06-11 06:32:38+0000, Tzung-Bi Shih wrote:
> On Mon, Jun 10, 2024 at 05:51:08PM +0200, Thomas Weißschuh wrote:
> > If the command is not supported at all the EC returns
> > -EINVAL/EC_RES_INVALID_PARAMS.
> > 
> > This error is translated into an empty version mask as that is easier to
> > handle for callers and they don't need to know about the error details.
> 
> I'm not sure whether the behavior is what we want or not as existing
> EC_CMD_GET_CMD_VERSIONS usages don't have it.

At least the caller of cros_ec_get_host_command_version_mask() expects
it:

ret = cros_ec_get_host_command_version_mask(..., &ver_mask);
if (ret < 0 || ver_mask == 0)
...

ver_mask == 0 will never happen as in that case -EINVAL would have been
returned.

Others, like cros_ec_cec_get_write_cmd_version(), expect the current
semantic of ver_mask != 0 but log spurious errors in case of -EINVAL.
cros_pchg_cmd_ver_check(), works with both semantics, but currently also
logs a spurious error message.

To me the new semantic looks more obvious and much easier to handle.
For each command version a bit is set. no command versions -> no bits.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ