Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1479DC4332F for ; Mon, 19 Dec 2022 11:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231742AbiLSLxC (ORCPT ); Mon, 19 Dec 2022 06:53:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231685AbiLSLxA (ORCPT ); Mon, 19 Dec 2022 06:53:00 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1435B65A4 for ; Mon, 19 Dec 2022 03:53:00 -0800 (PST) Received: from kwepemm600010.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NbJ3358H0zJqZw; Mon, 19 Dec 2022 19:51:59 +0800 (CST) Received: from [10.174.177.197] (10.174.177.197) by kwepemm600010.china.huawei.com (7.193.23.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 19 Dec 2022 19:52:57 +0800 Subject: Re: [PATCH V2] Fix NULL dereference in super_by_fd To: Paul Menzel CC: Jes Sorensen , , , Wu Guanghao , References: From: lixiaokeng Message-ID: <5d201758-2fc3-2def-04c5-ccba74f3c810@huawei.com> Date: Mon, 19 Dec 2022 19:52:57 +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 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.197] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600010.china.huawei.com (7.193.23.86) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org On 2022/12/14 15:55, Paul Menzel wrote: > Dear lixiaokeng, > > > Thank you for your patch. I found a few style issues. > > Am 14.12.22 um 04:17 schrieb lixiaokeng: >> When we create 100 partitions(major is 259 not 254) in a raid device, > > Please add a space before the (. > >> mdadm may coredump: >> >> Core was generated by `/usr/sbin/mdadm --detail --export /dev/md1p3'. >> Program terminated with signal SIGSEGV, Segmentation fault. >> #0  __strlen_sse2 () >>      at ../sysdeps/x86_64/multiarch/strlen-vec.S:126 >> 126        movdqu    (%rax), %xmm4 >> (gdb) bt >> #0  __strlen_sse2 () >>      at ../sysdeps/x86_64/multiarch/strlen-vec.S:126 >> #1  0x00007f1944659139 in __strcpy_chk ( >>      dest=dest@entry=0x55ea8d7c23ac "", src=0x0, >>      destlen=destlen@entry=32) at strcpy_chk.c:28 >> #2  0x000055ea8d10b66d in strcpy (__src=, >>      __dest=0x55ea8d7c23ac "") >>      at /usr/include/bits/string_fortified.h:79 >> #3  super_by_fd (fd=fd@entry=3, >>      subarrayp=subarrayp@entry=0x7ffe6a1dff08) at util.c:1289 >> #4  0x000055ea8d11b3a6 in Detail ( >>      dev=0x7ffe6a1e2f22 "/dev/md1p3", c=0x7ffe6a1e1700) >>      at Detail.c:101 >> #5  0x000055ea8d101e61 in misc_list (c=, >>      ss=, dump_directory=, >>      ident=, devlist=) >>      at mdadm.c:1959 >> #6  main (argc=, argv=) >>      at mdadm.c:1629 > > Please do not wrap the pasted lines. > >> The direct cause is fd2devnm return NULL. Here add a check. > > … returning NULL, so add a check. > >> Signed-off-by:Lixiaokeng >> Signed-off-by:Wuguanghao > > Please add a space after the colon, and before the <. Also, is Lixiaokeng your name, or could it be written Li Xiao Keng? Please use that format – `git config --global user.name "…"`. > >     git commit --amend --author="Li Xiao Keng " > >> --- > > As this is the second iteration (version 2) of the patch, it’s common, that you add a note, what the difference between this and the previous versions are. > >>   mapfile.c | 4 ++++ >>   util.c    | 7 ++++++- >>   2 files changed, 10 insertions(+), 1 deletion(-) > > […] > > > Kind regards, > Thanks for your advices. I will change it and send it V3 again. > Paul > > .