Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp6318626imb; Fri, 8 Mar 2019 14:49:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwHOym0Aa+wJndo30cpUWy9lHRBdUM41ww6fozcNP1vCk2uw8jdxcbpcRRUQv/v5MLFUBBA X-Received: by 2002:a63:ea52:: with SMTP id l18mr19078481pgk.317.1552085349739; Fri, 08 Mar 2019 14:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552085349; cv=none; d=google.com; s=arc-20160816; b=VmVHCNo6S8B+eOCb2teC3c/svvGXQRExuFjKCojenEErhEXlrDYeTKY6eiwrAcq6ti Tnc071xC/5Y+mVjV+02YSd9dAsncMQvZ0HWsCdyhvC7hWSYUf4zktaJHD36IiCTu0Zd9 8BkTTeggDWCNGuHaw3W3dqdQd/FEP78HG2jJpqMSEVxb/5zP4Aju1lTUhLTJA164+dWS YLRBfkcBfYwYaMCGweJHdLfBuCp+/dwVK5b+WoWP+QIzlYNobIrpH8rJfOc15tDelnKV CVRF1LuV/c1S5Vt+Xc/Tlgkj4wXKVkbMPAAUGIjdsqhJC++rpgIcvAUEOCQM9piu40yU vLhQ== 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=vFcYUr04KwGP5Qc7R1Y9xAYqLxD0IXc69XmuN4hpOKo=; b=z5SPjz/yyV+31a7Q5D2KcMCxV0YwP7potCDQQqgBU97lFbkscm9Eek+sDUF/QP07/c PQZNiqpTeoIn3v4YWmEqDILxSLWzZdiKAJh3PeRqKbhu8wN5IUU1YzKYafgseK6GEOY3 XPW61wpu/2W0mdiXdD8BSBt6czEgiHXBk62Xh/aDOoz8nmhD/gHSgAqfDa3jxb+wkdSW gCrNq4VcgaAwh86fgl3kCTxNcZzrzNMLKw6dnHP39hIXONbeVoJf7GR/Qxatm8jnN+kC BgC1EI9EYHYSMzd0RoW+euJpZG32yyrlcUzcGmIpOvguvZYHF5O88Etx9eeLDEo6mvvN pQww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S3pzMB1x; 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 e2si7676822pgm.568.2019.03.08.14.48.54; Fri, 08 Mar 2019 14:49:09 -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=@gmail.com header.s=20161025 header.b=S3pzMB1x; 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 S1726731AbfCHWqg (ORCPT + 99 others); Fri, 8 Mar 2019 17:46:36 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:36138 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfCHWqf (ORCPT ); Fri, 8 Mar 2019 17:46:35 -0500 Received: by mail-oi1-f195.google.com with SMTP id t206so17146936oib.3; Fri, 08 Mar 2019 14:46:35 -0800 (PST) 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=vFcYUr04KwGP5Qc7R1Y9xAYqLxD0IXc69XmuN4hpOKo=; b=S3pzMB1xxyA6ySeElsxo9LkrPd8vvsAd9YuftDp+ErSPcBUrnX1+UT66XVbDo45BBE 0J7gf8E9bGqm8AM4e49/t/zJJyOtQJ5MD5uBMx2tK/QCNDt2iTbt35JTVs1rvgfNHco4 ZzwVhDghiHYNAz6JLYLNWc8Nixm0JjW7OCqYzBdylXkky5cyhbHG9aaxoMm/sY1tbAqO dVWD7X/KgRwfZJvciNbl/1dX9D24hRDpdVx4XYF9F8uCQec6+hGc2q11YfAKkr0DYvot dP2HIgFX04WICbBMwSdLlP68pMty/3Q/eUUW5Va4D87LOkYS+U0EZ9+6UxwsL7CkgvZm Vuhg== 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=vFcYUr04KwGP5Qc7R1Y9xAYqLxD0IXc69XmuN4hpOKo=; b=txLktamkVDONEJE5Klwx58Gl4L0ocU+im4LAPizJkgK/L3K43Q95rwERrVveFbBl9Q 57pEMrkDQd2TyFOnS36ZzNX8gzvyoymZIJVRBygVm5Hxu3qalB5dk5K8yxBmhZs7zhuo +Zyd1p85uvpouDCe57hjbvIJabMpuwTmoHmSqNRmYIvRMWUdFxsz2ZQvCsct8kwTK7ji 1QW8QpZaWNyjJCfE0XqS688P/GlrJOCQGIpa3OwiHwt2YYEcjjLmKwRwLFHPiMyfpJaf DmiC7FhkTXTo9ooMlBLy9UFxTBRiRpFkM5YlP+8dx0h+zk9lTtPqidCwUjM1FLaqOk1z uCDQ== X-Gm-Message-State: APjAAAXvIYAu7BYWmHiA1lQk8AOw1emU3oMUTb+OAyjl813H6IYwRudq 0YttJzXiYYPpmzOIsgUMLMi3clKi5MYimnlQhcw= X-Received: by 2002:aca:5d0a:: with SMTP id r10mr9305475oib.92.1552085194812; Fri, 08 Mar 2019 14:46:34 -0800 (PST) MIME-Version: 1.0 References: <20190308175935.21904-1-TheSven73@gmail.com> <20190308202936.GA32641@arch> <20190308223249.GC32641@arch> In-Reply-To: <20190308223249.GC32641@arch> From: Sven Van Asbroeck Date: Fri, 8 Mar 2019 17:46:24 -0500 Message-ID: Subject: Re: [PATCH v2] iio: proximity: as3935: fix use-after-free on device remove To: Tomasz Duszynski Cc: Jonathan Cameron , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, Linux Kernel Mailing List , Matt Ranostay 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 On Fri, Mar 8, 2019 at 5:33 PM Tomasz Duszynski wrote: > > > So perhaps that change deserves a separate patch because it smells like > a code cleanup. Not really. This patch fixes the order in which resources are torn down on release(). You do this by fixing the order by which devm-resources are allocated on probe(). So it's a fundamental use-after-free fix, and not really a cleanup. But I'm happy to split into multiple patches if you want ?