Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5718066ybv; Tue, 18 Feb 2020 02:40:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzSmCEylcq/RWgrtF88adGgBowXOPFr6b3Z0IjppYv0L9OCmFAY0nsgXJVBP/v6lbz5wGPl X-Received: by 2002:aca:2210:: with SMTP id b16mr768570oic.32.1582022448362; Tue, 18 Feb 2020 02:40:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582022448; cv=none; d=google.com; s=arc-20160816; b=lHHF7xC9j1lTDuAS74/WsO32etAjeg7HkNjSAWfNMz6qTuiUB7WvHGlUbI4PZu02u6 Hzr6VYoEzm87psRA+dZ/0V1BMmFT+F5Q/tq3+3kDl6MZbT/BE1cr+11iEhXKxJ+a5GS0 Wp5QCZ7CyUZ2mm9vXB1G1X4tadSBtMelEMQUVV9m1LMBd84iaBz5AUhuB5WqgLIZaCVT XDoYvc3u5CdK7MmxUtefPPyOKN7hWYIpGtu8gWqS+b+pdZGHOR0Z3Bi683nA9zPIprzg MOPwZJJhD7cfkIzl2t4hgVOU8GRRqLcc3rkS3kq0rwqc/PSpZsiU4gujH35q4Ep8I0I9 ThdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=TdO6y8AHR+AaKNMW/gc1AonKG1Co8fKJjYOLG4b+LMk=; b=CaU+iM+oXsTFEgF6Wt4HoLll+Yo4hWzY6E9I3oiIzSVrFeO1qNDWBmvxsXIms+VtGu MQ6S3o/C4mzgZ0m0FzP2qCjCwPhkK4SiIkFMHfn7sXbDtZOecjFDW62fJGpfCGlt9ubP oVj1cqtBCrngZcrTp0gSV8IORWBMEXoYQ1NxxyfQtCzgrlB+7TsNko1lIjATiNqYWF/W clJr4iOGTgJsjPUeV5IOxSUXH5akaqBt4DyQGj7CBumFIDglfPlSXqYQeW0rJ3Peflc3 PmwNDbSvWq0wtMW3Xeff1Cl6lT1E41NUgPDgZ9TnE3/27+ORp0uupHOsgIobGc1g0Jjq oEBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZK2NEwWO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d28si1514140otc.123.2020.02.18.02.40.35; Tue, 18 Feb 2020 02:40:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZK2NEwWO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726373AbgBRKkY (ORCPT + 99 others); Tue, 18 Feb 2020 05:40:24 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:34794 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726199AbgBRKkY (ORCPT ); Tue, 18 Feb 2020 05:40:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582022423; 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: in-reply-to:in-reply-to:references:references; bh=TdO6y8AHR+AaKNMW/gc1AonKG1Co8fKJjYOLG4b+LMk=; b=ZK2NEwWO7LhC7cNlQOmHTOay3zBYoAJTKgrGPmsaAkPtoXcfg3wqUY0trsRtdGLJG45DcB iG9OrtTnrjeq4SBbnKd8KYr2aHoAALAs4Y/aV924ARdfprLDPQAKdcQVtu95wI7q8X41vE WYEZ3KE/2Na45loYUnkr0HqG9a7uDK0= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-LZ_QlZZSMG27vsZhuan82A-1; Tue, 18 Feb 2020 05:40:20 -0500 X-MC-Unique: LZ_QlZZSMG27vsZhuan82A-1 Received: by mail-qt1-f199.google.com with SMTP id l25so12810394qtu.0 for ; Tue, 18 Feb 2020 02:40:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TdO6y8AHR+AaKNMW/gc1AonKG1Co8fKJjYOLG4b+LMk=; b=GCL3oo70hs2f/IRj63C/vfrFTsHBuCiSXuO0gqdlHDM1nTKD5dpoGZz9vlt0u9XaYJ fKMB/njg65ErYEJFmmibrS0HDa+wJL+vbTSCr4sXZLf6Z2BTQS3AMt2D84U5vDuNWQ7u HGcPea/G+JOZ3yNVawSz18MEto4fUkx8gJ/5eW15a1ilBL2wm5oGjlbv+3Of3wdu1hBV IId29Of5RXNk0+KO2T67SRBsmLd9dH1asXs0Kuwfb+RHY1zqzwjQWo9Wyn2S44DOuHA2 8g/MlsE+ZPeG5b6azRsS9Q+czaSLfz3Dx2e9gqY5OvqaSRSMJNcuB0SNu+iaZxK0bn3R /u4g== X-Gm-Message-State: APjAAAUy5SpgjRanQJAgni4d6HfSQYpswDg5sDG4bmeA3/eqememXMM3 oxYwDIBfx5yq6vdWEKRfXUupnUsSyGm9TBH0W+5nDhPfJFg+1R4JIOHh3rKfG6zepKQf25tTCIT ypxAZbNxdqtur/6bg0gxBsZ6aH+dCHBnB/w7e+GV/ X-Received: by 2002:ac8:4914:: with SMTP id e20mr16568403qtq.199.1582022420169; Tue, 18 Feb 2020 02:40:20 -0800 (PST) X-Received: by 2002:ac8:4914:: with SMTP id e20mr16568385qtq.199.1582022419942; Tue, 18 Feb 2020 02:40:19 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Benjamin Tissoires Date: Tue, 18 Feb 2020 11:40:09 +0100 Message-ID: Subject: Re: [PATCH 0/3] HID: hid-bigbenff: fixing three crash bugs in a gamepad driver To: Hanno Zulla Cc: Jiri Kosina , "open list:HID CORE LAYER" , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hanno, On Mon, Feb 17, 2020 at 4:24 PM Hanno Zulla wrote: > > Hi there, > > the hid-bigbenff.c had three bugs causing possible kernel crashes. > > The first patch fixes a double free during device removal, which was > caused by a wrong use of input_ff_create_memless(). The > "driver-specific data to be passed into play_effect" parameter of > input_ff_create_memless() would later be freed automatically when the ff > device is removed. Since the driver also uses the managed resource API, > it would automatically free the memory of this parameter twice, causing > a general protection fault moments later. > > The second patch fixes the error path after hid_hw_start(), as a call > to hid_hw_stop() is required in case of an error. > > The second patch also removes the hid_hw_close() call during device > removal, as several other hid device drivers don't call this routine, > either. > > The third patch adds a flag to avoid a race condition when there is > still scheduled work left (or newly being scheduled) during or after > device removal, which could cause a kernel crash. > > Thanks in advance for your review & kind regards, > I think the patches are correct (have you tested them with actual HW?). However, checkpatch complains that the From and Signed-off-by email differ. Can you send a v2 with a fix for that? Cheers, Benjamin