Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1069138rwb; Fri, 28 Jul 2023 04:25:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlEI92S/O4LaiWakO3Rne4oJrCWRdjHiV23mM9gMl1vaXZDXWIrAm8wO3m4wG/e7CoqmOXoR X-Received: by 2002:a05:6a20:191:b0:12f:c61e:7cac with SMTP id 17-20020a056a20019100b0012fc61e7cacmr1101348pzy.31.1690543520272; Fri, 28 Jul 2023 04:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690543520; cv=none; d=google.com; s=arc-20160816; b=hQ/P9lQRGbiMutOUNwDrL9GaGgRY2y179oTl2ucRYjvarsvY8/ASxBi7zlBd5cV38A E8ShAn4d68zcWtrI7C9mmHOyyr4BYnutolxOqZf2GLJilfzyv1ou/3JrggO8umArON08 FI4yDewHUEEuGx60v8rLLVzTr5KsE7CLZdfzYfD2fr81kLOda2Nb2AC0SZKBXxcEyGMF 4to0/0+ECBtMGXUL7EC4GxIuOsTlZ1cJG2LglxTbuO5eTJw9yJM59ekr7zbTL54od1iR yR4zlX1FjZ+ArnWtPnjzqJK1nHu6UwWEJrlVJcA96R+i/2SpZmYHoO89aJ09ZEydHCiT JY8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xTslGF+cGVJ+28hI9sV2xnWWbHK6zLjpf1NJ9I4rUSU=; fh=jeMMv2Ieyu6F9UAtC234+lrdPW7/SlZnMHl/2cqoLT8=; b=ANjlxnI3Pd5/zt212mfoCh/qBpr7BKiJGvW9yDyHRWYpQnWlYjsk7G9A+CNpHha7L7 tixpA5cKAfX+IEr8raBHrrBO0npPyXoVYBf49GKCQSk3aX33V0cMFsF+8fSgXj7xtyw0 Hyl5g6OrOlPzGheb1M8MDBMYzjn6Rh3VU9PoTkB4mixZX1R3T4x1ehteEzuN3a2XGtSL XdgTYZB1hlSfzuKURvrqqMXkDAU4qLLEOMi1TedVGJ09RbTC6TreGCBSwZdqe3+dKDMf N3xCZYFpmMPyfPQQA3M63jNJwEsWgKM2MAZ5echTLfuZ8SZjBesmYcr1hO944I1oJJXM sSpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=J4C+Awqw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l191-20020a6391c8000000b005641ddd0303si793854pge.596.2023.07.28.04.25.07; Fri, 28 Jul 2023 04:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=J4C+Awqw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234138AbjG1KDh (ORCPT + 99 others); Fri, 28 Jul 2023 06:03:37 -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 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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