Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2726646rwb; Sun, 4 Sep 2022 23:47:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7lQE3qdD2Jw/Nyx/to0sjtaqpZj07ODCNyo56h463fOUQ3eGlMJjcD+ANj1UHLNXVUW+v3 X-Received: by 2002:a05:6a00:88a:b0:53a:b7a0:ea3a with SMTP id q10-20020a056a00088a00b0053ab7a0ea3amr25716333pfj.21.1662360467730; Sun, 04 Sep 2022 23:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662360467; cv=none; d=google.com; s=arc-20160816; b=LZS4pIPEKiURy5Ml3A6khJSixA3OKBce1+Qfrk3rsoWoOM0ZZQPX2dmnEkJmOpRV88 IGtRKO/27yGLX/lRnw5nvJD9uAfSmy6mFME4nN6jf+IpAa+Opv3Yn/HSufTUmQ6y/Q0O KzUdB27fRb1jSn9hPsDEOjSBaM92nR7CIM2r8pOQtzegPO4lH8jpYvtLLQ2anxn1Jjju OZOgbNJW5DSxm5H4Tti7kj2x0NmpvZoAvvSGIM/+abNGJbJiB4X2fymEnmO+RsZv/Nmn 6a21tPf3+JGjEy5gNIhPMNJTchveqc8MD04Usijicx7wBEi2u4C4cjXdbVOhdV7d62xp 70+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=gu2T/45m5AD+7ItmxlKKRXx6O6owwnqgWlgcp4TzOxE=; b=WqD+UhABaj+NFyfg9/UO9J1cYS+491OijmV8p/iTmHgPuBPJqBp37OfwSaio0F3/E4 eDQlzY/M0UPDWNjGOz9ir/uoYEcBfgZ0d+fLt4FfUtgiOC3MBLox/Kcaw+hD9kEKL6nP Z66oKSKYcSnaTJmxXMULzn7UvmcGNuWzq6StRH4saiQ0Nvb5xoWM1g/NOVWfiZHfwGAF iFsXRVOmWPQSZGi6X3wOT3JexzkiXZ5UCIZ8GFPGGG1y/dNPNK4LRT51BjaX5y61HA4M A/DGqFPV7mJKs0JIGjD49MVull12PCTv5WcBQ3V1ZO5nNLFmDSP80aHb9XsShQBjYqt2 VGeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FUCDZ3a1; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a056a000ac400b00537fe344fa8si10315057pfl.34.2022.09.04.23.47.36; Sun, 04 Sep 2022 23:47:47 -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=@linaro.org header.s=google header.b=FUCDZ3a1; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236332AbiIEGhL (ORCPT + 99 others); Mon, 5 Sep 2022 02:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235616AbiIEGgw (ORCPT ); Mon, 5 Sep 2022 02:36:52 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC34B33E04 for ; Sun, 4 Sep 2022 23:36:37 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id z25so11764207lfr.2 for ; Sun, 04 Sep 2022 23:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=gu2T/45m5AD+7ItmxlKKRXx6O6owwnqgWlgcp4TzOxE=; b=FUCDZ3a1HUvgGOt7gjfiseJAb6VttELEuPLL3CvfD3qlT1zVmdkdTqgWmqnuaZCY5g aQ6Qcj/RNWhm4/9YS/21JWaHd2W2/QTT2fPX8uwXLqobCClJuwILdqYrtaCJk/H3nqcS ePnmp6HpTJheFVvvbLoUV2OmoahbVswnuDMxzuAt/bEpYoJK9DNaF2iXZjH5XxjDHA9C +8GDLlIkOa1XCQExs1gkjuc0nctgb2HFqV0S+0Z3gklwA0HL329DcZQYwqPkVOFih8x5 ZJtfas7R4Isz+DrzCFIArJem5ElOq2ips62CNpQxULttfblI3gEJ4bNq2Tq5BD5hiebs 90Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=gu2T/45m5AD+7ItmxlKKRXx6O6owwnqgWlgcp4TzOxE=; b=3UjLgOCQp21kIH3tW8Jf2M4OPgODGNbBgkxZ8DITvhSl1fHM+DpMukAg8JF2uVf596 kDZcIQxSq8Gzq7CFYA2XPRo68wl17c6wPr2K/u/JibqS6INcL1QcDzzBS2fspyzJf+P5 YOg2iyWl7/PIEpQZirCJZ0zXHJXtobf0LPCR1sKoIzEL+pIPW2ZJL8TvkauXlTyOzdnv 6LQMYGuvfkUCFRnvy8u9lLEftRNre+676x5xdKAqmuNIGYnd8QUWu8b/6XxNVh57o5WJ /McY54L5AMHOPsOSicmKJlfpT4auEjmkha8wx+H927lLSpojEc6ytV5/qTm7gVkvrGaz 10fA== X-Gm-Message-State: ACgBeo195tyxYUCLOScEx74IqPgoUpmPdrsgEldLavH6xZxIyGuT8vpk vMCYYcIbiXSOqaiSi5A7jhRBmA== X-Received: by 2002:a05:6512:128e:b0:491:4087:d853 with SMTP id u14-20020a056512128e00b004914087d853mr17592003lfs.537.1662359795997; Sun, 04 Sep 2022 23:36:35 -0700 (PDT) Received: from [192.168.0.21] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id g13-20020a19ee0d000000b00494618889c0sm1091831lfb.42.2022.09.04.23.36.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Sep 2022 23:36:35 -0700 (PDT) Message-ID: Date: Mon, 5 Sep 2022 09:36:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH] driver core: fix driver_set_override() issue with empty strings Content-Language: en-US To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Stephen Hemminger , Bjorn Helgaas , "Rafael J. Wysocki" , Andy Shevchenko , stable , Huisong Li References: <20220901163734.3583106-1-gregkh@linuxfoundation.org> From: Krzysztof Kozlowski In-Reply-To: <20220901163734.3583106-1-gregkh@linuxfoundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 On 01/09/2022 19:37, Greg Kroah-Hartman wrote: > Python likes to send an empty string for some sysfs files, including the > driver_override field. When commit 23d99baf9d72 ("PCI: Use > driver_set_override() instead of open-coding") moved the PCI core to use > the driver core function instead of hand-rolling their own handler, this > showed up as a regression from some userspace tools, like DPDK. > > Fix this up by actually looking at the length of the string first > instead of trusting that userspace got it correct. > > Reported-by: Stephen Hemminger > Fixes: 23d99baf9d72 ("PCI: Use driver_set_override() instead of open-coding") > Cc: Krzysztof Kozlowski > Cc: Bjorn Helgaas > Cc: "Rafael J. Wysocki" > Cc: Andy Shevchenko > Cc: stable > Tested-by: Huisong Li Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof