Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1440945img; Tue, 19 Mar 2019 07:43:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTVYI2OhrUbV3Ltj7gZ+KU0sWdHj45INo1CALNAVGLRDttXqzZjh5rE6GUO1IE25rpLTV9 X-Received: by 2002:a62:be02:: with SMTP id l2mr2343807pff.55.1553006621765; Tue, 19 Mar 2019 07:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553006621; cv=none; d=google.com; s=arc-20160816; b=FdTCYx17y8z2ZtEbUFCamHU2bfxkhWTFWbKkQmU2irDl7/JqYUf3Pt/2kHZBuQvT7v wtsU+bj19ukqC0DjdpI5lQ3EdizKANEpbssBcmE9iRJPvTa9smUPiOUkt+vLUogCUxLO bIFJZ/+j0zZJThC744oAs+ZuJE5OdKGUfqM+On//bNSMgezwL2QclYPbJ2VlleYFgvu3 hSJVvHa2/Jqt6oxBP/qmkS1fjhhJ27wgAARMtzho0hB8+lyNk43RIXasOcqpEl6B6yFN ct8g3O9lao1RNBcuZAv7lzTc7q0S/34qFuJ7OXQI1bo9ivwfQHMJ0HoCwtu7d/+QeOat E4lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=6H23VCHiGGEjof7G4KPBheYg6IryV1oyx0sRJhThX+c=; b=mRCyEtdI531aUpdY1h2nDx034E+xkbuqI8Q0Jh2a26a8EW/Ibc2eaaU8TgOKh8Un95 ER5B9F3MHK/hWWVKcG4dEswpqi3ui4rw6LQfO4CHMRxxIFKdzDi5RZ602CTCXvcyx5x5 aPfPCM7EmK1nhrCCyMtaIiHfOrmQMr5wa9PywoeFSe4rz5xTVoaJGXTALJEldjs6/gDs NBx4R/GCtWnJL9shT+JQYz+rEhqmejlf9jtG9jdRPrB3/9TOGGgkjJeAc6w80Ap09b6H H6wsjRfn84rWbIMKMCEJKnP74AlJ2IOuw5JLAMmrJ6eO1TdOyVMhjxBRaX93rrawOCeO +dUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bfx7zwFW; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p17si11696817pgb.329.2019.03.19.07.43.26; Tue, 19 Mar 2019 07:43:41 -0700 (PDT) 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=@kernel.org header.s=default header.b=bfx7zwFW; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727756AbfCSOmN (ORCPT + 99 others); Tue, 19 Mar 2019 10:42:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:52332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727694AbfCSOmM (ORCPT ); Tue, 19 Mar 2019 10:42:12 -0400 Received: from pobox.suse.cz (prg-ext-pat.suse.com [213.151.95.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 077FE20850; Tue, 19 Mar 2019 14:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553006532; bh=Gu743qy4OIV2LMjMYn6MzjH4V5Sfb2TTSRtVTiYWIdE=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=bfx7zwFWPTGXiKa+iItOP0r7n81yXWoyEBES09oWMK8d0ngbBrmw2C49byMMHaB8v yeAv5NDYSFUOMybw3OZBBHqvdNYPxt6Lsyl7s3h4RI/5/lWIbu4mqxPQAX4U22F9iZ qNmeXCFeBn/zHlnU+IJOiRBICUFPrtB7WFoxweKg= Date: Tue, 19 Mar 2019 15:42:09 +0100 (CET) From: Jiri Kosina To: "He, Bo" cc: "benjamin.tissoires@redhat.com" , "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Zhang, Jun" , "Zhang, Yanmin" Subject: Re: must hold the driver_input_lock in hid_debug_rdesc_show In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Mar 2019, He, Bo wrote: > we see the below kernel panic logs when run suspend resume test with > usb mouse and usb keyboard connected. > > the scenario is the userspace call the hid_debug_rdesc_show to dump > the input device while the device is removed. the patch > hold the driver_input_lock to avoid the race. > > [ 5381.757295] selinux: SELinux: Could not stat > /sys/devices/pci0000:00/0000:00:15.0/usb1/1-2/1-2:1.0/0003:03F0:0325.0320/input/input960/input960::scrolllock: > No such file or directory. > [ 5382.636498] BUG: unable to handle kernel paging request at 0000000783316040 > [ 5382.651950] CPU: 1 PID: 1512 Comm: getevent Tainted: G U O 4.19.20-quilt-2e5dc0ac-00029-gc455a447dd55 #1 > [ 5382.663797] RIP: 0010:hid_dump_device+0x9b/0x160 > [ 5382.758853] Call Trace: > [ 5382.761581] hid_debug_rdesc_show+0x72/0x1d0 > [ 5382.766343] seq_read+0xe0/0x410 > [ 5382.769941] full_proxy_read+0x5f/0x90 > [ 5382.774121] __vfs_read+0x3a/0x170 > [ 5382.788392] vfs_read+0xa0/0x150 > [ 5382.791984] ksys_read+0x58/0xc0 > [ 5382.801404] __x64_sys_read+0x1a/0x20 > [ 5382.805483] do_syscall_64+0x55/0x110 > [ 5382.809559] entry_SYSCALL_64_after_hwframe+0x49/0xbe > > Signed-off-by: he, bo > Signed-off-by: "Zhang, Jun" I rewrote the changelog to explain the situation a bit more clearly, and applied. Thanks, -- Jiri Kosina SUSE Labs