Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp2105141imm; Fri, 6 Jul 2018 12:00:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcrOULoXxao0rtDNpfqNnixHIW/C5XIMV4LqyCREYqNk2jQNgd1T2PeeSQ1+q2WLkiaVKzi X-Received: by 2002:a17:902:7086:: with SMTP id z6-v6mr9858698plk.330.1530903611723; Fri, 06 Jul 2018 12:00:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530903611; cv=none; d=google.com; s=arc-20160816; b=XSRsFdj0i9ii80atizPMLZae9HkCVi1uVq4Pu0+pyXnsdSmBJg2DyE00fojrxh5Q14 QIP/aLjeSAfNOdTQ0Mm2LYbFpOQk0XRIaD//W36JYeOizcOBSWPnTzmz7xfuBf0MLDP3 PbeFKJNaYxCm78TI9N+vW5eVikt82areaUN/M5cnGjshGcy8V5ERGm7N7EgKwOl0BVTG P+0BlwCWzh3i8COgeDBA0ZRFV45nj8g6A5kDBBFR65tbA3aYIqt4vshqWWZTDZfnWluT mNqUKMNu+nXmIQ26jT7ytjpuZ0xR9BgXEP2jS8qEvnPTBJ6w5Pm7EtjPWh41NyVl6aQW Ot6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=CNYScXpvbP4AfeE/Cl3iHNKl+r9wntMVStrfT/cxq8o=; b=SEEOEXDHje19mmKmX/h/WXImwfKSM+ho0lQvIoYMmoiNUpTh8BrW/jDQlg/PjCte20 1RUdRlfEy1MCt8RNE31aaLVnpW45MV3bL8rrziyyhU9MnGCB5z0nXUyMjy9z7uv9xRxx xhbwcMYY8pxax8IuMb6jZhyjk6+4wS4H+MemK0eIJA4eV8Az2nrbrJlzggxqcZTHo+/q PryoS+mJwhrYS7f481Ay1PkZfFF8RSc6oEehukXFVhdbHEp+7EJZZ1JwpAMY0sRNLbCA XBu0mHqApQWom7MChVEloELJhiz281N7QRAg98FASQfXwyg8K/z6G87ZbCuHCtz6E15+ fBeQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 p14-v6si8416662plo.357.2018.07.06.11.59.56; Fri, 06 Jul 2018 12:00:11 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934580AbeGFS7B (ORCPT + 99 others); Fri, 6 Jul 2018 14:59:01 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52462 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934201AbeGFS67 (ORCPT ); Fri, 6 Jul 2018 14:58:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7256C34687; Fri, 6 Jul 2018 18:58:59 +0000 (UTC) Received: from [10.10.121.173] (ovpn-121-173.rdu2.redhat.com [10.10.121.173]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D286111DCF2; Fri, 6 Jul 2018 18:58:58 +0000 (UTC) Subject: Re: [PATCH v3 3/3] uio: fix crash after the device is unregistered To: xiubli@redhat.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org References: <1530845836-49101-1-git-send-email-xiubli@redhat.com> <1530845836-49101-4-git-send-email-xiubli@redhat.com> Cc: hamish.martin@alliedtelesis.co.nz, jannh@google.com, pkalever@redhat.com, pkarampu@redhat.com, atumball@redhat.com, sabose@redhat.com From: Mike Christie Message-ID: <5B3FBBF1.9080902@redhat.com> Date: Fri, 6 Jul 2018 13:58:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1530845836-49101-4-git-send-email-xiubli@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 06 Jul 2018 18:58:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 06 Jul 2018 18:58:59 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mchristi@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/05/2018 09:57 PM, xiubli@redhat.com wrote: > void uio_event_notify(struct uio_info *info) > { > - struct uio_device *idev = info->uio_dev; > + struct uio_device *idev; > + > + if (!info) > + return; > + > + idev = info->uio_dev; > For this one too, I am not sure if it is needed. uio_interrupt -> uio_event_notify. See other mail. driver XYZ -> uio_event_notify. I think drivers need to handle this and set some bits and/or perform some cleanup to make sure they are not calling uio_event_notify after it has called uio_unregister_device. The problem with the above test is if they do not they could have called uio_unregister_device right after the info test so you could still hit the problem.