Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp507693rwb; Thu, 27 Jul 2023 16:52:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlF8hcFb/L1OxDJz8QOcYwc+t9XrI1QuX8UJhRVXHQBSly1uKiBRH1MqrMNu+5PLwHbZkKMI X-Received: by 2002:a17:903:2309:b0:1bb:b832:4bed with SMTP id d9-20020a170903230900b001bbb8324bedmr176951plh.20.1690501943239; Thu, 27 Jul 2023 16:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690501943; cv=none; d=google.com; s=arc-20160816; b=uHtKNxR1XX6rRwOUMlGFV+zbdzZa71m9ARxtPz9XxpvUKK8m4RgY0cUGuuCapWTv7S zfYPruX2yRfCVygONuQodFXGxjgSlGd9BobmGAKFado5C5YgkatDRiFAGeLAPSy1yIZ+ Mjl47PinzrURH35qh1Aq9+O9iHDVgsJeP7IqhperKq9NsHiE9W0fJKZqGCBtMrqJ6znR k8W5XF6iqgaLttjCmuTiPTxJwdvSmciuZFhHzXKi5TTrDgcnN+/VZHTd8cbb32Q0kC19 skB6LtR+Vf7cM3DuqVVll//hJ/ZUJcgCqOan1r9dHr3jx9Ql1QW29zocEdTi3Lt5y4Pl FpmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=ZM2MxAETSRwIlgrl0T63dARbFrBqIf2rAhBEukPah0I=; fh=Y7BFmZtWkoA8zgZGBmL1wwOUoYQP4GqXowdbCUc67J0=; b=X3BC/fqY3GZ7wSgj3eICd+btQs0Jy9I//8y9W4dTNZlnESlrmmSpciolOtBKCcPnkN v0pJL0ThItmMZPDqBAMOqRd59yLptDiqZ6jt2h5po9xzVwvQWV9KBWlMbX58OwETx2Tn puA+JwCF3oZoNj145u0/0BWxmzEcV1r5RyhD7JTqDc3B4S7uw13wgAKfjkRVdLQlFQHV SJ1ZZC5P63vcmDNwA9nnBqCoN+2NsVtkpFPKqcVW86kJxXrszPnjGF5KIelW1hMjdpp5 dYRKB7rLCRWLMPJytgyQ0MnC88e92vmkPhbuZiZ+YZjhzPIebblLza3J8TgViSEMLhTd ps7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=k2v1Nypl; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l13-20020a170903244d00b001b801bd7fbasi2046335pls.417.2023.07.27.16.51.59; Thu, 27 Jul 2023 16:52:23 -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=@protonmail.com header.s=protonmail3 header.b=k2v1Nypl; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233126AbjG0Wyq (ORCPT + 99 others); Thu, 27 Jul 2023 18:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233106AbjG0Wyo (ORCPT ); Thu, 27 Jul 2023 18:54:44 -0400 Received: from mail-0201.mail-europe.com (mail-0201.mail-europe.com [51.77.79.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72FE12113; Thu, 27 Jul 2023 15:54:43 -0700 (PDT) Date: Thu, 27 Jul 2023 22:54:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1690498478; x=1690757678; bh=ZM2MxAETSRwIlgrl0T63dARbFrBqIf2rAhBEukPah0I=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=k2v1NyplU7U9MVHuxmB62DgXjrMW1NPd1fEmnaTWcESSYOisZeOkoU/wJSvILBPXz ByEEa7zA9oxsrLgWXSYaumF1ZXSlfZm5+PPv5vfA4SofPD2fs9USIIAliVxcbzVNnB Kfzmeq//96bKyPBgjA1Ee/ODMUiF0f5Lc98NxesPmvRbK+WqGXE1H8ywaICcvB5ADm 9E4x1/R24ONLa92DPR+YX7BHMc83YwxXx/bw0/2APDqvkRpAAR0Af086cQ9CciERYA S4yYnG9Kjz5PT4Y6oMAIdvKLe1LpPMZMqniVzN/2Mj1ukkN3bjOMFjK1buum0rfOFj URybea5NBh3Ag== To: Hans de Goede From: =?utf-8?Q?Barnab=C3=A1s_P=C5=91cze?= Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, Mark Gross , Armin Wolf , Andy Shevchenko Subject: Re: [RFC PATCH v1] platform/x86: wmi: Do not register driver with invalid GUID Message-ID: In-Reply-To: References: <20230715211604.1272227-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi 2023. j=C3=BAlius 26., szerda 10:45 keltez=C3=A9ssel, Hans de Goede =C3=ADrta: > [...] > On 7/15/23 23:24, Barnab=C3=A1s P=C5=91cze wrote: > > Since a WMI driver's ID table contains strings it is relatively > > easy to make mistakes. At the moment, there is no feedback > > if any of the specified GUIDs are invalid (since > > 028e6e204ace1f080cfeacd72c50397eb8ae8883). > > > > So check if the GUIDs in the driver's ID table are valid, > > print all invalid ones, and refuse to register the driver > > if any of the GUIDs are invalid. > > > > Signed-off-by: Barnab=C3=A1s P=C5=91cze >=20 > Thank you for working on this! >=20 > About the do this here, vs do this in file2alias.c discussion, > we have many old style WMI drivers which are not covered by > the check you are adding for the new style WMI bus driver. >=20 > So I think having a check in file2alias.c would be a very good > thing to have. AFAICT that would also cause compile time > failures rather then the run-time errors your current approach > results in. >=20 > 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()`? 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". Regards, Barnab=C3=A1s P=C5=91cze