Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1353599imc; Mon, 11 Mar 2019 11:49:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiXHiF//UeTW63d6VmW3bIXI0vOqJlRmAEMmel5XIgtb/DzidScX6qQmem0VErDgy2LY2w X-Received: by 2002:a63:cd06:: with SMTP id i6mr31492438pgg.267.1552330158169; Mon, 11 Mar 2019 11:49:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552330158; cv=none; d=google.com; s=arc-20160816; b=BExmo54n1R4yy7x62OdywT6KOLeqq2KI0neF+czWf5nDzFznRa0Lh3kx7SnInSiPq/ FnbQpmftae8z4xK8EEDwo7W/eK3NFH4GdY1TtWpHzNsq8JQZpu7af8vBbxE5DvPtBG8L mXUfAk1cQnTjhW7lrlVMDl2p46R8kZN6wCh1u8MGoWbOKcc33A1t+bZ2+K3PoZcAfddj m71FFrVG6jFzbcQNBExvQwWnFUtK+NdQq02xUGHkSh8ji7DC25FI5eH1PV3KTv0vqYR9 rryNnsCBT201Wg79pzXpeLfN9fgYcvHVMR/vH6PPMN5e+2ZHmHT38c7SwOGqn/h4hs4I aYzw== 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=R9aBFyECQDqLE8kcWcrFTaNk6b19WS2DWEH1/8Z/ri4=; b=pDbU0/iXHUA5+0nG9u6w9fVXYXTR+MvWLBFd4f+lHCjP/jPcTfDSM7J9KdyzYdkvGY o29G+82g0WsBH2QCTnlQdu2NLdKeLIScaEFF4qPU7yONLRIiFOgBnIGQPR0mPclmHOQJ aBUb1W0efZsDIXYUSWx6suF6QI0ll1Zarr8OxPSClsBqIgGYacF4CpwtW+pHzmgodbp0 XcWkNvE1GXFzU9/7qDZt/3sXZSY4f5zR9RxYKIV2xCwx7EE5r6sTGRfQgRiTGCgLKs12 bIm4bXkE28sp5is4UBjrSpxPprzcInTq8JPll7bRPG0+OuWaMlDfnATS3k66vooiUz5P GBDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E3CyCkzO; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11si5604978pfh.90.2019.03.11.11.49.02; Mon, 11 Mar 2019 11:49:18 -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=@gmail.com header.s=20161025 header.b=E3CyCkzO; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727868AbfCKSsL (ORCPT + 99 others); Mon, 11 Mar 2019 14:48:11 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:44869 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbfCKSsL (ORCPT ); Mon, 11 Mar 2019 14:48:11 -0400 Received: by mail-oi1-f193.google.com with SMTP id a81so4520051oii.11; Mon, 11 Mar 2019 11:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R9aBFyECQDqLE8kcWcrFTaNk6b19WS2DWEH1/8Z/ri4=; b=E3CyCkzOEUn59R3BNajWY/zfmMNPByDSokd+5eP+vb7mg2PgIp94ATtYrj0ugTS6WY LlSWC7yzhsKZzjuwh+Mo5nZHfdWLNNLvuZdPEPgexqucsexTwLTX7BLRchqpR59/xwOs FC9kRZJsIEu2ouSZp9yIhlqEB8H8rY5Mlo3RcbICOyHTGns3N8uuxQZBoR3umWK9miaW vlbTPIYlaccfWQMD9Gg2QFdfECGGLRQDuZb9ABHptzNACEtBLeKwbyepiDf5+hphl/Oy llrcAAzCnVlkJM7Eiy17JTvYJMl34IKg8F+LDynOG4BsjNl/6Tyq10vdPQdHf9jwDh1l gjgA== 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=R9aBFyECQDqLE8kcWcrFTaNk6b19WS2DWEH1/8Z/ri4=; b=FuwiJByBiJOogbHedZxCBnRlp9X19eVX0nFavRHgls2A6HrQNyf4I9l4RM7fipNLda jzL2q6ET9CfddB2VI9MOWei1LNDz5GGtOcQSpKBSvsnZwCKKpc52OEBO44NqaLHpBvaQ i5sD96++XY39Bp37DiK5mWxzyfoqYJFpXWK90A1WZds9VOmcEt+cZamESlK5/nGsNjDU 8ledlIcPdisMHeFrnjbZRbMG55bdM9SY0+UrWQp7xbnfO6mvSHeOjEwXme0Mf8kJebN+ fpt1tcQ0CbWomZr40oZCg3hXaA22qpxYjQNwfY1TaAH5dh/0JKomLC1XmBU7N2KnV/pF zWEg== X-Gm-Message-State: APjAAAWT/PCdy5QF+BbplsHBhgCsmFuNMsFoWwfCcH0BlndAApsxSKaC ndoOoc41Iswyug95QjJFVqaG0aj2D7eiO9vABxI= X-Received: by 2002:aca:e6d5:: with SMTP id d204mr149970oih.77.1552330090324; Mon, 11 Mar 2019 11:48:10 -0700 (PDT) MIME-Version: 1.0 References: <20190310193246.31761-1-TheSven73@gmail.com> <20190311180042.GA17880@arch> In-Reply-To: From: Sven Van Asbroeck Date: Mon, 11 Mar 2019 14:47:59 -0400 Message-ID: Subject: Re: [PATCH] iio: envelope-detector: fix use-after-free on device remove To: Peter Rosin Cc: Tomasz Duszynski , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" 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 Peter, On Mon, Mar 11, 2019 at 2:41 PM Peter Rosin wrote: > > This is false positive, AFAICT. The delayed work must have > finished while envelope_detector_read_raw() holds the read_lock > mutex, and it would be highly surprising if the device can go > away while it is handling an IIO ->read_raw call. (THAT would be > an interesting bug...) Quite right. I had completely overlooked the fact that wait_for_completion() cannot finish unless explicitly completed. Unlike wait_for_completion_interruptible(). So yes, this looks like a false positive. My apologies. Sven