From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A01AC0015E for ; Fri, 28 Jul 2023 10:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235194AbjG1KDk (ORCPT ); Fri, 28 Jul 2023 06:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235613AbjG1KCs (ORCPT ); Fri, 28 Jul 2023 06:02:48 -0400 Received: from mgamail.intel.com (unknown [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A70F93C07; Fri, 28 Jul 2023 03:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690538559; x=1722074559; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=YzZuAZZZIjFoo83EUPCtvSsd8Mis2DtPCekd+t0N+Oo=; b=J4C+AwqwgHnYBbxhDQoIc8ZecKWvlkxBLlF1VJ785i851+VVuXmb+O2D ee0Fk/RxNHVmPgcRi2zVEWKkf+OTaAoOJr+OwJm7YjwLNwYPdi7WTG1pT g+Eu9oqq1TKFMJB2wFLPL3Hce2vWfhdCiTZ3MQCIoslayge9+IwLWIIPG fgtz0OlroZD1g0tVTx8N+11Mb8a67gfxSy7mk70MnBdHM+LCXQ+TtKR3S vyLvNCOCFzce0hcIoTTjTfHf4JaP5APHHhtdsHkXbdVLVI14TQ36lZdRC l+2rhjMj/26SWhlafliKDaeHzf0wH4k0h/9ieGmWQakkPfcbXKKss9aBF w==; X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="371257124" X-IronPort-AV: E=Sophos;i="6.01,237,1684825200"; d="scan'208";a="371257124" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2023 03:02:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="762571977" X-IronPort-AV: E=Sophos;i="6.01,237,1684825200"; d="scan'208";a="762571977" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga001.jf.intel.com with ESMTP; 28 Jul 2023 03:02:37 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qPKIt-00CcyQ-22; Fri, 28 Jul 2023 13:02:35 +0300 Date: Fri, 28 Jul 2023 13:02:35 +0300 From: Andy Shevchenko To: =?utf-8?Q?Barnab=C3=A1s_P=C5=91cze?= Cc: Hans de Goede , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, Mark Gross , Armin Wolf Subject: Re: [RFC PATCH v1] platform/x86: wmi: Do not register driver with invalid GUID Message-ID: References: <20230715211604.1272227-1-pobrn@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 27, 2023 at 10:54:26PM +0000, Barnabás Pőcze wrote: > 2023. július 26., szerda 10:45 keltezéssel, Hans de Goede írta: > > On 7/15/23 23:24, Barnabás Pőcze wrote: ... > > I think that having an additional check like the one which you > > propose has some value too, even if it is just to cover drivers > > which for some reason don't use `MODULE_DEVICE_TABLE()`, but IMHO > > the most important check to have is a check in file2alias.c . > > Okay... any tips on how to avoid copying `uuid_is_valid()`? I think I already told the rough design: we need to split uuid.c to three files: libuuid.h, libuuid.c uuid.c and libuuid.c should be built twice: once for uuid.c and once for file2alias.c. libuuid.h should contain the definitions file2alias.c is using. Something like that. > Another idea I had was that maybe `struct wmi_device_id::guid_string` needs to be > changed to be `guid_t` and then `GUID_INIT()` or something similar could be used > to initialize it. That way it is impossible to mess up the format. The only downside > I can see is that guid is no longer "grep-able". Strictly speaking you may not do that because it's a (semi-)ABI. -- With Best Regards, Andy Shevchenko