Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1937028imj; Sun, 10 Feb 2019 14:06:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IYwudlE4tbrs6I+52a5sA2sgS2cr8AxQ1yj02FAeH80GsKTH8/m+iTHJ2h1acrPYnbe2L+j X-Received: by 2002:a63:1cd:: with SMTP id 196mr6698194pgb.58.1549836370626; Sun, 10 Feb 2019 14:06:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549836370; cv=none; d=google.com; s=arc-20160816; b=HBU/fiEHE412zKrjA1/UCrblQKDg48Uxc49EdK8FoJi2e252OLL/9kKwPxSumxbVTN DnFrfoPpWbDsDH9C4fG8prLHQML+0J1gubCt8f1TgEul4IfV5HRJXzvy+HNa5G6NkRXg PcNlaaR0Hkb6DjsaYn5lwpHceA8wWXXcMFEUcev0lhkx7kvCyFKs8+GIYCKkCM1VxAD9 19yWz0W0/m7M06QE+IJxxnetwyjcR/esm5Cj+NPGAnu8SdLhtcopYKWnDlK8420L8VLG TxF7yO2VR18nUFVGYPK/8+5TLQAdLJfIyP1DUyS+LpjhUAz6tTsMUTyZkPRBe1TjmY25 PHLg== 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=lZbFEtMRAHlQjjK1Rxo/FhZal8/vyQI89TUl7Lr92HI=; b=HNFcIvW36jvB5ZPQBQFyBWvoX71VgBDb3VVbGJW0NVWTD+DdcDMEYj1lXdTWjMb0L+ b47A9kEwYA0GzVAf06LuJLdMvhsXxW3lIpnUQIrP7L4Zbvw6fN7x20ug/IQfD8drX9sq lAUShP1oqSaaE+pFF4z3/QMTvZr3wpC0juAiiivvyWApxcxsIuHZjrYKh+wdyDY7IsH1 fYPRDGHSd1eQlixLkA+DcmiZGyYGAvsw05LhFIobfE6F/nAjC8PSbrdBDlhFApHCsSH2 lIJFlSJsfxlWxvh8l7fEZaPBJuBTZXlLtTr4BVNNhVdJ4+0fWB4ZLtlNvaWPwHo/5Srm r9hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sdDS7LWR; 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 p126si8050691pgp.529.2019.02.10.14.05.42; Sun, 10 Feb 2019 14:06:10 -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=sdDS7LWR; 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 S1726300AbfBJWDe (ORCPT + 99 others); Sun, 10 Feb 2019 17:03:34 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:42411 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbfBJWDe (ORCPT ); Sun, 10 Feb 2019 17:03:34 -0500 Received: by mail-ot1-f68.google.com with SMTP id i5so3939797oto.9 for ; Sun, 10 Feb 2019 14:03:34 -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=lZbFEtMRAHlQjjK1Rxo/FhZal8/vyQI89TUl7Lr92HI=; b=sdDS7LWR9SYiItw3LWHbM04ueS1K94o7YyeHbClOS340fpCTKe1Ziv3LfdtSPwPa4y nsCmqsCpu9fW4i0NRkvGMWhFjyzgjwWoIb5tWZMs0OM11R5DDm/rSovj64O4FwhJc6Kh kabgYI17yM6EONCdU+RDdln0ne6xEybkQaEQJCeDy6lgxw/B47TLQY9Gt0tPla/9jR2p KMf9Cxji4nmNbSBsY057hR8HH6UC/Tjlx/1yDbDSFb4798As3cN347uAO2HFKrlHO/Du GOKmEauOkQLWvjP1GN6FV+avErdI+xC29FN1MVXxtt/cxB+3oi3cSbNHWcUQvwsNJ8tB j9sQ== 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=lZbFEtMRAHlQjjK1Rxo/FhZal8/vyQI89TUl7Lr92HI=; b=AVFco7lIlv3NMZ8R3ontVcggVR9ieHzaF2Dg+obVpjDOMzKgB2bg5fC2SWvuHWJ1Gu veG8FXJauYdXaagQEb3Kv8gpRyLWr7vE/F+jXS879BAScMpRgXsmjD55o4ZsFkneHtTm bsjYmZfV4oNfa2ZQS8WRsZ2jU8b/3m1aifDAYHzkdT6Aq5cmTLOnwIZLM4bn4yawCA38 +tjPrAwgrfItDk+o88wKdE/kCKn/Dr18dS9dZ2xPauG5vFTcD1CwyyxEC8J5GakxtcMA SILyRTU9JMs2jI2Y1vbIJgxtX4QCbHHFjxSxyDKR4HsQuiz8FFGMRj3bBgXtUhplGh5E EJSA== X-Gm-Message-State: AHQUAubX8xWnRvdVqHi37PZ32jc7wNnR7731Bbrr/I1hZrvHznuOoJd7 T1gqWAolWWfID74D7PKDty4HQekU6CsMVjWTSAk= X-Received: by 2002:a9d:74c3:: with SMTP id a3mr17806014otl.107.1549836213694; Sun, 10 Feb 2019 14:03:33 -0800 (PST) MIME-Version: 1.0 References: <20190209001522.GA11769@gmail.com> In-Reply-To: <20190209001522.GA11769@gmail.com> From: Sven Van Asbroeck Date: Sun, 10 Feb 2019 17:03:22 -0500 Message-ID: Subject: Re: [PATCH] auxdisplay: ht16k33: fix potential user-after-free on module unload To: Miguel Ojeda Cc: Robin van der Gracht , Tejun Heo , Lai Jiangshan , Sebastian Reichel , Dmitry Torokhov , Kees Cook , Linux Kernel Mailing List 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, Feb 8, 2019 at 7:15 PM Miguel Ojeda wrote: > > On module unload/remove, we need to ensure that work does not run > after we have freed resources. Concretely, cancel_delayed_work() > may return while the callback function is still running. > > From kernel/workqueue.c: > > The work callback function may still be running on return, > unless it returns true and the work doesn't re-arm itself. > Explicitly flush or use cancel_delayed_work_sync() to wait on it. > > Link: https://lore.kernel.org/lkml/20190204220952.30761-1-TheSven73@googlemail.com/ > Reported-by: Sven Van Asbroeck > Signed-off-by: Miguel Ojeda Yes, this should do the trick. Reviewed-by: Sven Van Asbroeck