Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1048128rdb; Sun, 1 Oct 2023 18:05:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgJPsEk+Iln0djGYKw9GYBEjFS0Zc4KoSchUplbGDGISzCnXOelcQgkXfrF7NphLYFlx+/ X-Received: by 2002:a17:902:c084:b0:1c6:30d1:7214 with SMTP id j4-20020a170902c08400b001c630d17214mr6943426pld.55.1696208728388; Sun, 01 Oct 2023 18:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696208728; cv=none; d=google.com; s=arc-20160816; b=0gqPDNm/YbX225FkFeXtXKzeVHzTNJ1f+iTYcCSKATeL6qGKOgSvI0YRs1PsPIwz0Z RdXUgsNQQcg72NXKQ513n69Lsaj7d1I31mK+ehTT7JR1kcGUfzdBffG6q9IBgaqMcnG2 +YqfY/AC/xayvCH5eZgQEs/qCO2e2vWZtrAbLiJkWsCumccgisTKw1y3983CXpGUBWY6 Hu7sH/MLE3uvZFhNWBdmGXTor5KWyuIgsDE6i48LLD12mUMph4+6a12bDAuzxbIXCiOa BhXTMcqtn/+9UVrS+ZvN4lz2ml9uFsCx580N/E8RIBcVzceiKFC7hAmhDam0E6keoZni Z1sA== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nWGRyz+YIuv74qkbiCqoaXcuRZTJ/y0eHD6SlcR52QA=; fh=UcC90ngqAqc4GNuOhC/QSbXA65W4AiKPQffaGXIAR9M=; b=XR+AauC0HA+DiUYx658QTLowUPgiCL57jvGsMyC5Fec16onV4zB/OBwdtf2nM9rYX9 WJvgxZnzkWPguhRQ951b4O/1ytllT2bHg4kDA4Kmtv1XkF2JFqIx2goHTL4IzzQkDV1J zEnbVJ6Stt8BAV4QfM6fvZr1Bn6+5/U8/WOcKeeinRktcIvQ6NujSPhtDD61/5GHcqT8 wXDbAQftpbVocUMroT6Li5t8Pna5vbitCQqh2AacV+9EAb0Nj7jQzIUNQEah1flAyt33 LvJLl5OmgF7HgLMi7ljHht5dqy2FO12GIl5qinfeb4rqwSAqacLMyu7Z/+R9KhMram7B DYHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SHn4hIVM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s1-20020a170902ea0100b001c4660cd474si27935191plg.634.2023.10.01.18.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 18:05:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SHn4hIVM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5616080C0A50; Sun, 1 Oct 2023 02:11:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234660AbjJAJLW (ORCPT + 99 others); Sun, 1 Oct 2023 05:11:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234530AbjJAJLU (ORCPT ); Sun, 1 Oct 2023 05:11:20 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACC62C6; Sun, 1 Oct 2023 02:11:17 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5346b64f17aso11708887a12.2; Sun, 01 Oct 2023 02:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696151476; x=1696756276; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=nWGRyz+YIuv74qkbiCqoaXcuRZTJ/y0eHD6SlcR52QA=; b=SHn4hIVMC7/9lyshVD+BG9Leyji0cKbtt+aYjL8ToZ4nwrzF4k22t4kQly6APOsSlz AZyU0l8A0dXSqiVHppa33dyyd4Wg6qrCuKZnb4nsSzMsQ8FdQZXuMgSzx0kcHRCjEX0G f8z0wH5hKBk+aKm7Yr13FREcA0Bq3CTg3zqWdSiJ+cOAigetQj7CzwV3pn071TtSmiua D3ZJSx7HdpfXDgvqlbk4vC4Wblpilz9gk2R/gwxFwlVFUS7PbSiVRfx8oIertNENVxIv Jypyp6UhWMN1Eq7HsiEMX4/J2xOINTCxczzqsF3LxefiJL2gAJIHVluFi07fFwyZhGDP djMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696151476; x=1696756276; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nWGRyz+YIuv74qkbiCqoaXcuRZTJ/y0eHD6SlcR52QA=; b=ReSSBi0E+m0h/qpgzBdSLbfsTiS1ga/dNp7BhX1nVNR0i5hnfwtyrUh8HG2813xkL5 0+pvtd/4uEr/16V5f4Soy4FkVJqVGTUvx+MJU+dT47oMBPcW0dAzAS1kUE13jhn6eDWi Uii9DxC7fIDx+4kgFOTSZtpbchMpkf3mbg8oYO0j4quZpwyEdsHV8orKr1HtWPnQ2B4A edmigg52oz+6X1Or2FwDOyxvp6cw1XMV38XB/n5b4VqxZqSDAkJBEEo0TQyClxqW4Lvo BLSzZjZFNxmQwpmB0Jhp0Yyd9dusecJQQcjqGKDg3RMmoL2vLI08EBDjBRzylOsUTD7u ASww== X-Gm-Message-State: AOJu0YziLWiyG3w0I3Br90mBbBF0exE2QNcnSNuYPcAdGC181PhbTZRR PySuOvi5J0kM2vcQIEMdgGeHvXltEZE8Yg== X-Received: by 2002:aa7:df17:0:b0:530:d6e5:9229 with SMTP id c23-20020aa7df17000000b00530d6e59229mr8468289edy.10.1696151475932; Sun, 01 Oct 2023 02:11:15 -0700 (PDT) Received: from ?IPV6:2a02:8389:41cf:e200:4c68:6c03:863b:ad4e? (2a02-8389-41cf-e200-4c68-6c03-863b-ad4e.cable.dynamic.v6.surfer.at. [2a02:8389:41cf:e200:4c68:6c03:863b:ad4e]) by smtp.gmail.com with ESMTPSA id b7-20020a056402350700b0053613c8312bsm5492900edd.42.2023.10.01.02.11.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Oct 2023 02:11:15 -0700 (PDT) Message-ID: <710ed88d-462b-17ed-ae4d-906ddd0dee8a@gmail.com> Date: Sun, 1 Oct 2023 11:11:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] Input: powermate - fix use-after-free in powermate_config_complete To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230916-topic-powermate_use_after_free-v1-1-2ffa46652869@gmail.com> Content-Language: en-US From: Javier Carrasco In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 01 Oct 2023 02:11:49 -0700 (PDT) Hi Dmitry, On 19.09.23 00:10, Dmitry Torokhov wrote: > On Mon, Sep 18, 2023 at 06:51:49AM +0200, Javier Carrasco Cruz wrote: >> Hi, >> >> There's an obvious error in the patch I introduced when cleaningup >> (urb->status should be used instead of just status). I will send a v2. > > I think what we need is call to usb_kill_urb(pm->config) in > powermate_disconnect(), right after call to input_unregister_device(). > > Thanks. > That is definitely a more meaningful and elegant solution, so I will check it out and eventually send a v2 with it if everything seems ok. On the other hand usb_kill_urb() is already used on pm->irq before calling input_unregister_device(), so I would move the existing usb_kill_urb to have both calls right after the unregister_device call for code consistency, if that is alright. Thanks and best regards.