Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp45406rwb; Mon, 26 Sep 2022 14:29:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM525C92cyevMfBWvZxnsDSdwYuOEdU2ZSprU3iJU1q0DV+7WyhDOCT7JYIh1EBs7hT1wKCH X-Received: by 2002:a17:90b:4f84:b0:202:dd39:c03d with SMTP id qe4-20020a17090b4f8400b00202dd39c03dmr776088pjb.63.1664227785631; Mon, 26 Sep 2022 14:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664227785; cv=none; d=google.com; s=arc-20160816; b=aqV8gKIAhvnSx/IOdOrlYRoSloA84w2Hf2VtyfEK/TFq3e6mDqAACCYxmDOxBQfVgl RU4BdsUAwYhHIW0a70SBTnZKbtj0lTK8g3OgFHHYYkCS6xjhjJ71k6UDfqNdDNs62P6K Y2q02ERqNNixrEJT7syNu6JWueFUbEkjozCUEArnnZSt0Oyom11AOuLup1qX6XxsJY4j GFGScGHc979DVN9eM3LBEsYqTkj3tj17zer5JDwsGoXzh0TZEJQB6BG5EYK02rwCYAYt KPscOFof9Jq2uQInuCahGtC6RPeDpsBCWAUvOKZKvaYutOExwpZ+ZOXit4UbTHM3xq6I AbKg== 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; bh=TtVTjysCQCWAz5ElZ1Es0KSaqp56dOZenj2o0I9cNYs=; b=Jt9/TumdyvFXJQineJytj0lUz2rgkNoSKpD9Ida0QWziGBXP4CVWUn7g3cXI3A7uZU ZN31jVDjFNtsDvoLCORHZYSiiGaS2ZiA2EoHygQvsnrkEJIWx6F51FHnUI13n+32I9Hw ScyISNezgUHlK6sTK+vqgWeBQoE0jPfgPW+yZMTXW/BLTxBbFDan7RuX0igQXBP+G/zv 1BWWGLvxVAnGIv8PpBaLnS8zQpAh0t3WaCSay0+LcuYs4YFANjUGu9ukbmsq+zdcwep/ yla0bDU1nQARxmqA5EXJSznUMrWmG4IznlAh6A+8kRCQLLYbvgCv28uJArn3VYpJG/qn BLtw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t31-20020a056a00139f00b00536bbfa4994si21460514pfg.345.2022.09.26.14.29.34; Mon, 26 Sep 2022 14:29:45 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230447AbiIZVUu (ORCPT + 99 others); Mon, 26 Sep 2022 17:20:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231407AbiIZVUm (ORCPT ); Mon, 26 Sep 2022 17:20:42 -0400 Received: from mail.inka.de (mail.inka.de [IPv6:2a04:c9c7:0:1073:217:a4ff:fe3b:e77c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EABE78BCB; Mon, 26 Sep 2022 14:20:40 -0700 (PDT) Received: from mail3.berkhan-weisser.de ([2a03:4000:54:b9a::4]) by mail.inka.de with esmtpsa id 1ocudK-003t0e-S6; Mon, 26 Sep 2022 22:23:18 +0200 Received: from 127.0.0.1 (helo=localhost.localdomain) by mail3.berkhan-weisser.de with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1ocudK-007Trr-Ce; Mon, 26 Sep 2022 22:23:18 +0200 From: Enrik Berkhan To: linux-input@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Rishi Gupta , Enrik Berkhan Subject: [RESEND PATCH v1 0/4] Fixes for the mcp2221 HID-to-I2C-bridge driver Date: Mon, 26 Sep 2022 22:22:35 +0200 Message-Id: <20220926202239.16379-1-Enrik.Berkhan@inka.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=unavailable 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 In this patch series are fixes for issues I found during recent tests of an MCP2221 board. - you can confuse the kernel driver when using the chip from user mode via /dev/hidrawX, typically leading to a NULL pointer dereference in the driver's HID raw event handler - the driver needs > 15s to initialize because the HID raw handling is not enabled during initialization of the GPIO part - data shared with the bottom half code is not protected from concurrent access - the rxbuf pointer can become invalid or even stale if the device would send unsolicited reports Enrik Berkhan (4): HID: mcp2221: don't connect hidraw HID: mcp2221: enable HID I/O during GPIO probe HID: mcp2221: protect shared data with spin lock HID: mcp2221: avoid stale rxbuf pointer drivers/hid/hid-mcp2221.c | 114 ++++++++++++++++++++++++++++++++------ 1 file changed, 97 insertions(+), 17 deletions(-) --- Resend because I had a typo in the linux-input mailing list address. Also adding linux-kernel to increase visibility. -- 2.34.1