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:   Wed, 10 Nov 2021 09:44:10 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Thomas Weißschuh <linux@...ssschuh.net>
Cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Rushikesh S Kadam <rushikesh.s.kadam@...el.com>,
        Jiri Kosina <jikos@...nel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Benson Leung <bleung@...omium.org>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        Guenter Roeck <groeck@...omium.org>, llvm@...ts.linux.dev
Subject: Re: [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for
 matching devices

On Fri, Oct 29, 2021 at 05:29:00PM +0200, Thomas Weißschuh wrote:
> Previously it was loaded for all ISHTP devices.
> 
> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
> 
> ---
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
> Cc: Rushikesh S Kadam <rushikesh.s.kadam@...el.com>
> Cc: Jiri Kosina <jikos@...nel.org>
> Cc: Benjamin Tissoires <benjamin.tissoires@...hat.com>
> Cc: linux-input@...r.kernel.org
> Cc: Benson Leung <bleung@...omium.org>
> Cc: Enric Balletbo i Serra <enric.balletbo@...labora.com>
> Cc: Guenter Roeck <groeck@...omium.org>
> ---
>  drivers/platform/chrome/cros_ec_ishtp.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c
> index 9d1e7e03628e..8c17358e84c1 100644
> --- a/drivers/platform/chrome/cros_ec_ishtp.c
> +++ b/drivers/platform/chrome/cros_ec_ishtp.c
> @@ -774,6 +774,12 @@ static struct ishtp_cl_driver	cros_ec_ishtp_driver = {
>  	},
>  };
>  
> +static const struct ishtp_device_id cros_ec_ishtp_id_table[] = {
> +	{ cros_ish_guid },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(ishtp, cros_ec_ishtp_id_table);
> +
>  static int __init cros_ec_ishtp_mod_init(void)
>  {
>  	return ishtp_cl_driver_register(&cros_ec_ishtp_driver, THIS_MODULE);
> @@ -791,4 +797,3 @@ MODULE_DESCRIPTION("ChromeOS EC ISHTP Client Driver");
>  MODULE_AUTHOR("Rushikesh S Kadam <rushikesh.s.kadam@...el.com>");
>  
>  MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("ishtp:*");
> -- 
> 2.33.1
> 
> 

This patch in -next as commit facfe0a4fdce ("platform/chrome:
chros_ec_ishtp: only load for matching devices") and the following one
as commit f155dfeaa4ee ("platform/x86: isthp_eclite: only load for
matching devices") break clang and GCC prior to 8.1 (output from
Debian's GCC 6.3.0 below):

$ make -skj"$(nproc)" distclean allmodconfig drivers/platform/
drivers/platform/chrome/cros_ec_ishtp.c:778:4: error: initializer element is not constant
  { cros_ish_guid },
    ^~~~~~~~~~~~~
drivers/platform/chrome/cros_ec_ishtp.c:778:4: note: (near initialization for 'cros_ec_ishtp_id_table[0].guid')
scripts/Makefile.build:288: recipe for target 'drivers/platform/chrome/cros_ec_ishtp.o' failed
make[4]: *** [drivers/platform/chrome/cros_ec_ishtp.o] Error 1
drivers/platform/x86/intel/ishtp_eclite.c:685:4: error: initializer element is not constant
  { ecl_ishtp_guid },
    ^~~~~~~~~~~~~~
drivers/platform/x86/intel/ishtp_eclite.c:685:4: note: (near initialization for 'ecl_ishtp_id_table[0].guid')

I am sure clang should be fixed to recognize this value as a compile
time constant but the kernel supports GCC back to 5.1.0 so this should
be fixed here as well.

Cheers,
Nathan

Powered by blists - more mailing lists