Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1104444rdb; Fri, 20 Oct 2023 08:32:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETGF8OBBzyEAXpTzRYAqxxmi7gmSJBSPxTFYorPmAcQn15bAVj60PW9zg9gemYkVqZvopu X-Received: by 2002:a05:6a00:1402:b0:693:3851:bd3e with SMTP id l2-20020a056a00140200b006933851bd3emr2301552pfu.3.1697815934265; Fri, 20 Oct 2023 08:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697815934; cv=none; d=google.com; s=arc-20160816; b=wY69w+wv8A7LNQnCQnj7FhyGkiaxU5nJ/+zzPUzazgwslViz7Gv7a4gKCMotjP1iWv Ng4Uh00HuQljhxug6xllkVkMg8jqvAlsskArJjA238YRpCdunCEVypXnkwiwmBaCI1ut F/nOl3aEAMpcm6K+5UDZwGMUGYAZNRwcRAsct9a15/80Z6H4AL0joX8TFyFMfspveSx5 axIWx1jUt35vJ0lSasdiY1rAogu4OvXIbHLuf6Sb869ylS3056r/3clCQkOym9Ldq0ZN ce3rcvYb7oLZlIWmq3z2M9CfBBEr9Tyj3upDvb4s0r2vr5VRjIINjSZ+jfWZdZuRXW1k Nw1w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=UnpnmeYe94FI9Jfaf1RckC7fZwJT75cGxhssDXRtfLA=; fh=i3WS+6AgTKP10/eUP7j46CA4B/XR5qlEIT9hV1ltHe4=; b=hmiEvujRsuBEt9ipta3IW2G3NGpPTXdO/wI7BZp5uf7Zt7dye1xGeTU1a4v6Zl0ob0 tli20J4es5g4DikgVzW553YV8ZQyr2Xl05S8ezt7U5GhIPenSHBTB8NnUinTcNgYdm83 IRMh6oCU+z7i0CrAChy6FEeeK0sT9IrMCTrA0RHkQLc5aUmMCdo69WikNYxIfAMnluCd IAs4ikgERA8EP6C1jGKVKH6IcMI7/sZDGsKcOC6ZK5I4XbvQc2vD7/NhJ+fWdQaMb15i +PuKhnIM/Dto5+fYGASf7YwYQqtTMsbK8DTuhQouB7fRbp47iLRrCMg/tvHeqidCXOyi RE2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="a6if/b3S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q15-20020a056a00084f00b00690d42e3347si2221496pfk.157.2023.10.20.08.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 08:32:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="a6if/b3S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5EC308022B5E; Fri, 20 Oct 2023 08:31:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377723AbjJTPa3 (ORCPT + 99 others); Fri, 20 Oct 2023 11:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377601AbjJTPa0 (ORCPT ); Fri, 20 Oct 2023 11:30:26 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8168D1A8; Fri, 20 Oct 2023 08:30:23 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 98EF4C000A; Fri, 20 Oct 2023 15:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697815821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UnpnmeYe94FI9Jfaf1RckC7fZwJT75cGxhssDXRtfLA=; b=a6if/b3SxaI+6gCiPw/KJlnsg/xbge9hbOApvWT9BcBUmIPuNcGXH4DVGZmJtFBBofYzD4 Sc8ahz78YsknF/xDUjPRcktF3h4jDhnneh86GA7DcoTHq44B7yu+92+EBMVFjKS+hQDPL2 a/gKqbAcwAojaTnznhpm2O6POVI2OoXow+3FFr65mMWTpKg4Y1f4zMeq64dT1RSKLp95u3 cDx0gUMG/qk5lY0IHks90EsEUYgu7rPdZfmMhQ2aAUFs8KYHVKLaxt83Qv9+q72CMexeIA QQf1HHc5tyaFfqDYQJ7AjooUAmOVAl4sKJprFDrgaxxIlBPjpCSvY15RXcjpGg== From: Herve Codina To: Wolfram Sang , Peter Rosin , Stephen Warren , Rob Herring , Greg Kroah-Hartman , Jonathan Cameron Cc: Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , Herve Codina Subject: [PATCH v3 0/3] Fix i2c mux module refcount issues Date: Fri, 20 Oct 2023 17:30:10 +0200 Message-ID: <20231020153017.759926-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 20 Oct 2023 08:31:35 -0700 (PDT) Hi, Some i2c mux drivers wrongly use the pair of_find_i2c_adapter_by_node() / i2c_put_adapter() to lock the parent adapter. Indeed, i2c_put_adapter() decrements the module refcount while of_find_i2c_adapter_by_node() does not increment it. This leads to an overflow over zero of the parent adapter user counter. Identified mux drivers impacted are: - i2c-mux-gpmux - i2c-demux-pinctrl - i2c-mux-pinctrl Commit 48e9743dd648 ("i2c: core: add and export of_get_i2c_adapter_by_node() interface") introduces of_get_i2c_adapter_by_node() to correctly handle this refcount issue. This series fixes the 3 identified mux drivers replacing the of_find_i2c_adapter_by_node() call by an of_get_i2c_adapter_by_node() call. Compare to the previous iteration https://lore.kernel.org/linux-kernel/20231019101017.425284-1-herve.codina@bootlin.com/ This v3 series: - Fixes a wrong char in a commit log message - Add 'Cc: stable@vger.kernel.org' - Add Reviewed-by tags Best regards, Hervé Changes v2 -> v3 - Patch 2 Replace a wrong char by a char in commit message - All patches Add 'Cc: stable@vger.kernel.org' Add 'Reviewed-by: Jonathan Cameron ' Changes v1 -> v2: - All patches Fix commit log Add relevant Fixes tag Add 'Acked-by: Peter Rosin ' Herve Codina (3): i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() drivers/i2c/muxes/i2c-demux-pinctrl.c | 2 +- drivers/i2c/muxes/i2c-mux-gpmux.c | 2 +- drivers/i2c/muxes/i2c-mux-pinctrl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- 2.41.0