Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2086FC433C1 for ; Tue, 23 Mar 2021 12:19:02 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E31E619B1 for ; Tue, 23 Mar 2021 12:19:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E31E619B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-nwW4SOF1N4qH99Je3Dz7OA-1; Tue, 23 Mar 2021 08:18:56 -0400 X-MC-Unique: nwW4SOF1N4qH99Je3Dz7OA-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 E08CC1B18BC1; Tue, 23 Mar 2021 12:18:50 +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 B45D95C1C5; Tue, 23 Mar 2021 12:18:50 +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 181A34A7C8; Tue, 23 Mar 2021 12:18:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12NCIlgM029402 for ; Tue, 23 Mar 2021 08:18:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id A1B61110AF41; Tue, 23 Mar 2021 12:18:47 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DD5F1134CCC for ; Tue, 23 Mar 2021 12:18:45 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6DD5585A5BF for ; Tue, 23 Mar 2021 12:18:45 +0000 (UTC) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-526-FSHykQ-BPVuU6TAcOskQbg-1; Tue, 23 Mar 2021 08:18:43 -0400 X-MC-Unique: FSHykQ-BPVuU6TAcOskQbg-1 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F4Vj41YZ9z19Gdm; Tue, 23 Mar 2021 20:16:40 +0800 (CST) Received: from [10.174.178.113] (10.174.178.113) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Tue, 23 Mar 2021 20:18:29 +0800 To: Christophe Varoqui , Martin Wilck , Benjamin Marzinski , "dm-devel mailing list" From: lixiaokeng Message-ID: <32644d18-c98d-e239-f1b9-a6091fd34bea@huawei.com> Date: Tue, 23 Mar 2021 20:18:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 X-Originating-IP: [10.174.178.113] X-CFilter-Loop: Reflected 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.78 on 10.11.54.3 X-loop: dm-devel@redhat.com Cc: linfeilong , "liuzhiqiang \(I\)" Subject: [dm-devel] [PATCH] multipathd fix NULL dereference in check_path X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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-GB Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit When iscsi login/logout and multipath command are executed concurrently, there is a coredump. The reason is: check_path ->update_multipath_strings ->sync_paths ->orphan_path //pp->mpp is set to NULL ->update_multipath_status ->dm_get_status //return DMP_NOT_FOUND ->condlog //pp->mpp->alias, NULL dereference Here we don't dereference pp-> mpp if it is NULL. Signed-off-by: Lixiaokeng --- multipathd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipathd/main.c b/multipathd/main.c index 28cb236..5ed2267 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -2010,7 +2010,7 @@ check_path (struct vectors * vecs, struct path * pp, int ticks) if (ret == DMP_NOT_FOUND) { /* multipath device missing. Likely removed */ condlog(1, "%s: multipath device '%s' not found", - pp->dev, pp->mpp->alias); + pp->dev, pp->mpp ? pp->mpp->alias : ""); return 0; } else condlog(1, "%s: Couldn't synchronize with kernel state", -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel