Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1085098pxm; Wed, 23 Feb 2022 17:44:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyA75qE9ebPUt3mphBBcShO3jAF1OHbnOMSKgRV6YUu8yAEOdIdOJoDu2fUUE0WF547cHbw X-Received: by 2002:a17:902:c408:b0:14f:d100:a70d with SMTP id k8-20020a170902c40800b0014fd100a70dmr285153plk.146.1645667073435; Wed, 23 Feb 2022 17:44:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645667073; cv=none; d=google.com; s=arc-20160816; b=qZYsv8K+lltFItZrTW7m90K2wP2x5oCFRJFMalWw5ssGhPkaufJ0NyRnQcxtN9nkJe aU0Lz3B157551ekTw3an7EKJg614ST00Q3bYCUGuCuI2JdXU9T9ppsGktAjY5u2mUWqR A5PIOkwpBqsPkVjWkiDikh5gzgFS2yiAa+Q3h1OwNZYaoSgVixgHWYtCpplMfpqZ/Mm2 P9cOuN/Tc2zXnyYRsbEjYafJRjKAHGtyFyJQmtFLMu+HgB/UpFJ2BC8F+OaAo1XeafHB CVuCQlgrr1TvqVxY0mRQldyeXFlieXTz3n+E/2Pu5TdYaDaSf89qmxhndUbR/QVcXVKu 5KdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bnCDqCPu5W0nS2hNz/cxEej5P/bK9uYNkG/dZB6UyI0=; b=JLkqTSpFIZ2kQ256B4DQ82Onsd/lO896HaMXGx8LndfQiVz3CmWkE0qK5jAa+yysKI rOK7FMChc/tnoTY/7QjPeAA4dOMuHPgOgDnJfJ3ITitbQr1fR2HZaf2h1PudFC1lmix/ F+/qQtaw8rttd+L8M2W/kVJlRiqs3LS48u2q1YlhfdR+Z9JeJulfAOQZxYYE93XTXkIx qwd5jqL9lq1hjqW59AwtGkNp2A5jFlNAUZM71c0pda+eS084LT6d0aKKIuC+XhH3KnpV UgzydjJBbYSC6y4O+76/oAEXGrTbo7kump7ZU0UG0h6hDSgh5hIA98moChSAEPhSZf2W eLJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="YffVIX1/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 82si1073357pgh.528.2022.02.23.17.44.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 17:44:33 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="YffVIX1/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D97B5247760; Wed, 23 Feb 2022 17:19:37 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237722AbiBWDDc (ORCPT + 99 others); Tue, 22 Feb 2022 22:03:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235946AbiBWDDb (ORCPT ); Tue, 22 Feb 2022 22:03:31 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 26A404DF7B for ; Tue, 22 Feb 2022 19:03:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645585384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bnCDqCPu5W0nS2hNz/cxEej5P/bK9uYNkG/dZB6UyI0=; b=YffVIX1/6IVVir16NC/ONar2Wa3weKEZkOLNvd8kUKk6Jg66wapGmXfz+DcZgRGiWmKUAm QE9JMyDiyjLZdxkN/xiYStJcmlOTABLVFf360BcPZV8GvThG22LENO7hdEYzhtTbsaXMe+ p05P1Nk05ettfqhc5mDO45haoSqESC8= Received: from mail-yw1-f199.google.com (mail-yw1-f199.google.com [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-50-5vdnGZjDNs-aFeUcSsvGiA-1; Tue, 22 Feb 2022 22:03:02 -0500 X-MC-Unique: 5vdnGZjDNs-aFeUcSsvGiA-1 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-2d07ae11467so161028077b3.12 for ; Tue, 22 Feb 2022 19:03:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bnCDqCPu5W0nS2hNz/cxEej5P/bK9uYNkG/dZB6UyI0=; b=Q2wHuXXmm+P4+az+7/FG/aF4fkftkg/mdkqtJC4DeI5gZUdy1YfeIZJk0q2OTROpYH oT/xb9BmEYT4rgoB1wrHe1hZcG1YiTbzYZYjR4JXkLHej8MfY0lnjXB2Wqyc+eo+69tS VWyMw0xyYxNkaorcRVzjMioHNWZizfarRX9NN5lhlBdEQ9lCcJRFFR2g7qqqxHAsdLGR yC5tMYnoQ0S3v1yw34WH3h2VF29Q0q1bJAj78qtybsG3iwbN/RViXb9omvMF6MRgjplZ H7HQ9pmu/kAuD08ZZ9zQJlU3MjxRcvV+TUyWZld7p2xuU7vVeBIEBGJOuP58AnSG0jN9 aqTA== X-Gm-Message-State: AOAM5311/mrAVnsX8RAqMJqzZRZLKOrFgF2ONpJybZ6UP2DkwJueaeP6 8uyhXLpMAP4adQ8w3pnh5GEwNtgvlGIxFNSTw3RE2BfmOj7AaZ1TDXpz/C4Cro58aHKfyRPmo4b 3e1emf8Kq3uq5LDjal01iXkATyAgcuk/yhWSeiDY= X-Received: by 2002:a0d:fa43:0:b0:2d1:8d8f:c269 with SMTP id k64-20020a0dfa43000000b002d18d8fc269mr27001636ywf.339.1645585382379; Tue, 22 Feb 2022 19:03:02 -0800 (PST) X-Received: by 2002:a0d:fa43:0:b0:2d1:8d8f:c269 with SMTP id k64-20020a0dfa43000000b002d18d8fc269mr27001622ywf.339.1645585382182; Tue, 22 Feb 2022 19:03:02 -0800 (PST) MIME-Version: 1.0 References: <1d287c7e-8aff-beea-1bd6-4b2226f9f3db@opensource.wdc.com> In-Reply-To: <1d287c7e-8aff-beea-1bd6-4b2226f9f3db@opensource.wdc.com> From: Mike Snitzer Date: Tue, 22 Feb 2022 22:02:51 -0500 Message-ID: Subject: Re: [PATCH RESEND v2] dm: Fix use-after-free in dm_cleanup_zoned_dev() To: Damien Le Moal Cc: Kirill Tkhai , "agk@redhat.com" , "dm-devel@redhat.com" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 17, 2022 at 5:49 AM Damien Le Moal wrote: > > On 2/17/22 19:13, Kirill Tkhai wrote: > > > > dm_cleanup_zoned_dev() uses queue, so it must be called > > before blk_cleanup_disk() starts its killing: > > > > blk_cleanup_disk->blk_cleanup_queue()->kobject_put()->blk_release_queue()-> > > ->...RCU...->blk_free_queue_rcu()->kmem_cache_free() > > > > Otherwise, RCU callback may be executed first, > > and dm_cleanup_zoned_dev() touches freed memory: > > Mike, > > Can you queue this please ? I queued it earlier today, please see: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-5.18&id=588b7f5df0cb64f281290c7672470c006abe7160 Thanks, Mike