Message ID | d209a0b1-2514-79a0-257a-22bcb372785a@virtuozzo.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Mike Snitzer |
Headers | show
Return-Path: <dm-devel-bounces@redhat.com> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6827DC433F5 for <dm-devel@archiver.kernel.org>; Thu, 17 Feb 2022 13:35:49 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-176-kygkI5vGPsqr6gXcRFTEUQ-1; Thu, 17 Feb 2022 08:35:44 -0500 X-MC-Unique: kygkI5vGPsqr6gXcRFTEUQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B910A185302C; Thu, 17 Feb 2022 13:35:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8427C7C0EB; Thu, 17 Feb 2022 13:35:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1F22D4A700; Thu, 17 Feb 2022 13:35:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21HADRJl019045 for <dm-devel@listman.util.phx.redhat.com>; Thu, 17 Feb 2022 05:13:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id BC5B8492D4D; Thu, 17 Feb 2022 10:13:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B734548FB04 for <dm-devel@redhat.com>; Thu, 17 Feb 2022 10:13:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 774613C0D1B0 for <dm-devel@redhat.com>; Thu, 17 Feb 2022 10:13:27 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2096.outbound.protection.outlook.com [40.107.22.96]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-464-rbBPEoxNOom7InZ4jvM6sQ-1; Thu, 17 Feb 2022 05:13:25 -0500 X-MC-Unique: rbBPEoxNOom7InZ4jvM6sQ-1 Received: from DB6PR0802MB2374.eurprd08.prod.outlook.com (2603:10a6:4:8a::21) by VE1PR08MB5853.eurprd08.prod.outlook.com (2603:10a6:800:1a5::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16; Thu, 17 Feb 2022 10:13:22 +0000 Received: from DB6PR0802MB2374.eurprd08.prod.outlook.com ([fe80::57c:1b85:7b36:55bf]) by DB6PR0802MB2374.eurprd08.prod.outlook.com ([fe80::57c:1b85:7b36:55bf%5]) with mapi id 15.20.4995.017; Thu, 17 Feb 2022 10:13:22 +0000 References: <c64d2143-284e-7621-440c-971e3405b4d8@virtuozzo.com> To: Damien Le Moal <damien.lemoal@opensource.wdc.com>, "agk@redhat.com" <agk@redhat.com>, "snitzer@redhat.com" <snitzer@redhat.com>, "dm-devel@redhat.com" <dm-devel@redhat.com>, linux-kernel@vger.kernel.org From: Kirill Tkhai <ktkhai@virtuozzo.com> X-Forwarded-Message-Id: <c64d2143-284e-7621-440c-971e3405b4d8@virtuozzo.com> Message-ID: <d209a0b1-2514-79a0-257a-22bcb372785a@virtuozzo.com> Date: Thu, 17 Feb 2022 13:13:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <c64d2143-284e-7621-440c-971e3405b4d8@virtuozzo.com> X-ClientProxiedBy: AS8PR07CA0035.eurprd07.prod.outlook.com (2603:10a6:20b:459::27) To DB6PR0802MB2374.eurprd08.prod.outlook.com (2603:10a6:4:8a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25a8552c-e3eb-4a32-06e5-08d9f1fe208d X-MS-TrafficTypeDiagnostic: VE1PR08MB5853:EE_ X-Microsoft-Antispam-PRVS: <VE1PR08MB5853B1DA1482E10B82A69509CD369@VE1PR08MB5853.eurprd08.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:172 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: i0Kq2n03eHoZk6kTKH7v/ZmWAYTTPyxrCQLJu68hl6BYaeaDy5NVcfJ/5DxV0FGH/mDsmxUWvwPNK1C1aDwQoC6RhoMu+kNSmf2sy5EmHNeKyE4zinbSzoQMvJtsWu/+rh+JM1rHwBV/zg39rq6OnJiBYpiJrOk4dcmzoHtajoPHtn+ivKpaF3FRFeqEzE8p/FDItaD2vbTd2yla/2CUkDPiwogVQ8ZGGJ2s0dWwvkMhwiL0nzePS/Ps/OLO1AcnvIEHpd+b/3assv9DwGkXVoS6R5UQce2+NaMlvqKLmToezhb5otJknSzdmvMt54rtxrcGMkLL+c2kftWNxphBDhX2ePIfQdBlquYNBOG4mN84mDWMdD1FBEArvGCBVd7hDcVzRkZiojBI+JlRlkXj6omNZxQJG2BYwo/TMocNgS/CR3626mGniugCGXPbpbq2+IoC1nPTD1b7fVEvSGEa912YDrU/KzcWF/v5Ejg98my4qUDlCgvlScAw0qjJyKfOyo4bdXsHNVdorMdgILn9FB0Q2nx2dGU+IIYVhM+5B4UwXuCzftTk23CUi28XIkdfFi9H/cBesfRbZmAEgtwIJ60jQUw8egokIWkHOasaG769fhI7g/3WIbE5mTPvsqSk1t9hfX1DsXtqwaDAZWU6xnSUyWPV2OLls9J/ZKsZqR71KaqrRgYLgIpML91SEvasNTQCnwHFvEJrLXnklDd1S1F0RmCK81Gv+sENNWDlOm8d07wcDnL8BBmku7g4yqr3lX315oaug/QNmfWvY7JpKp2Kq/StKjnX8VnNgTO0C1g= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0802MB2374.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(2616005)(186003)(26005)(31686004)(52116002)(6512007)(6506007)(508600001)(316002)(110136005)(36756003)(6486002)(8936002)(2906002)(83380400001)(86362001)(66476007)(66556008)(66946007)(8676002)(5660300002)(31696002)(38100700002)(38350700002)(21314003)(45980500001)(43740500002); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ghemS7/QGvhEj+IFXJJkaiRM18WX?= =?utf-8?q?ZidzDrQBq8RaJmGmkYsILDnLPjoHEbbzfjQysblZ8usUhCPQVz990oILelyn9O+73?= =?utf-8?q?Mn0TRGEUE56RI0Xz0k8s8CukwPcIvKJP54w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WWl/VrWr9YKc0z2OKYBRnIUwdXK75p8x6jMQW?= =?utf-8?q?24YJ3PwzlXvHudAVTSsn095F9NW+zK/Ld4s8FAppR197PY+SF+2IuP8bms2LN2RrV?= =?utf-8?q?ATeb0bB32PlyhVSzht68lJj9DiAFtZqNZJ8ZXErrrvHMMo76vmlrHu2R7mVVtGR6e?= =?utf-8?q?puuMMj6P4i0WIGiEEX8TgYeIANtfCeatHTyPCApTGjVFkB6TC+293NfSPXWG+AgIX?= =?utf-8?q?nYcmS5Vl2yciv2hdxKCp+w1jA+JDAu1TB/jQkL3vbcXxH93dn4gpSIXa8gbJrQtnj?= =?utf-8?q?nFcOknmPRXYWpYq2r/AdKBnHbauxJ8cXbS+f56wbg81uoofRP7Gv2+1KGpzxYbGRa?= =?utf-8?q?rkusQN+y4xBPma8EaO3fcdJjpEL59jq4YJqKtTvnx10tIXOVC1jDKJKUaB1VpLyv9?= =?utf-8?q?l4kmwevbYcdmKm+4iSrklO/O97wKBx1rCb3u+NeviU1HAWTMgImXybSP2haKm5Yfb?= =?utf-8?q?IoanCmZOjXv8txzgBVjLYNS7Hnp8y+kYe95e0ORN1UsgGKYbyUYZ2gxFYEsLQzXER?= =?utf-8?q?Prykithz85aNcDqyyf29tbknu6LwjZU4IywYfD2cH5CnDQMVpPQFFO4=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25a8552c-e3eb-4a32-06e5-08d9f1fe208d X-MS-Exchange-CrossTenant-AuthSource: DB6PR0802MB2374.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2022 10:13:22.2236 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yXFElfsFCMPhhV8NlyvVpzP+3RsNfPBIHJz3mlCWCnyxg95A3QagM2YORiH52dMUCxMvBZCpD+4c5HgSX4Q9Dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5853 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 17 Feb 2022 08:30:58 -0500 Subject: [dm-devel] [PATCH RESEND v2] dm: Fix use-after-free in dm_cleanup_zoned_dev() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development <dm-devel.redhat.com> List-Unsubscribe: <https://listman.redhat.com/mailman/options/dm-devel>, <mailto:dm-devel-request@redhat.com?subject=unsubscribe> List-Archive: <https://listman.redhat.com/archives/dm-devel> List-Post: <mailto:dm-devel@redhat.com> List-Help: <mailto:dm-devel-request@redhat.com?subject=help> List-Subscribe: <https://listman.redhat.com/mailman/listinfo/dm-devel>, <mailto:dm-devel-request@redhat.com?subject=subscribe> Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit |
Series |
[RESEND,v2] dm: Fix use-after-free in dm_cleanup_zoned_dev()
|
expand
|
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index dcbd6d201619..d472fe5dbc1d 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1607,6 +1607,7 @@ static void cleanup_mapped_device(struct mapped_device *md) md->dax_dev = NULL; } + dm_cleanup_zoned_dev(md); if (md->disk) { spin_lock(&_minor_lock); md->disk->private_data = NULL; @@ -1627,7 +1628,6 @@ static void cleanup_mapped_device(struct mapped_device *md) mutex_destroy(&md->swap_bios_lock); dm_mq_cleanup_mapped_device(md); - dm_cleanup_zoned_dev(md); } /*