From mboxrd@z Thu Jan 1 00:00:00 1970 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=-16.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 F3C13C4320A for ; Wed, 1 Sep 2021 02:21:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D7E6A60EE3 for ; Wed, 1 Sep 2021 02:21:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241597AbhIACWi (ORCPT ); Tue, 31 Aug 2021 22:22:38 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:49374 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241408AbhIACWh (ORCPT ); Tue, 31 Aug 2021 22:22:37 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0Ump9hix_1630462887; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0Ump9hix_1630462887) by smtp.aliyun-inc.com(127.0.0.1); Wed, 01 Sep 2021 10:21:27 +0800 Subject: Re: [PATCH] Revert "net: fix NULL pointer reference in cipso_v4_doi_free" From: =?UTF-8?B?546L6LSH?= To: Paul Moore , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , netdev@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org References: <18f0171e-0cc8-6ae6-d04a-a69a2a3c1a39@linux.alibaba.com> <7f239a0e-7a09-3dc0-43ce-27c19c7a309d@linux.alibaba.com> Message-ID: <4c000115-4069-5277-ce82-946f2fdb790a@linux.alibaba.com> Date: Wed, 1 Sep 2021 10:21:27 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <7f239a0e-7a09-3dc0-43ce-27c19c7a309d@linux.alibaba.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, it confused me since it's the first time I face such situation, but I just realized what you're asking is actually this revert, correct? Regards, Michael Wang On 2021/9/1 上午10:18, ηŽ‹θ΄‡ wrote: > This reverts commit 733c99ee8be9a1410287cdbb943887365e83b2d6. > > Since commit e842cb60e8ac ("net: fix NULL pointer reference in > cipso_v4_doi_free") also applied to fix the root cause, we can > just revert the old version now. > > Suggested-by: Paul Moore > Signed-off-by: Michael Wang > --- > net/ipv4/cipso_ipv4.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > > diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c > index 7fbd0b5..099259f 100644 > --- a/net/ipv4/cipso_ipv4.c > +++ b/net/ipv4/cipso_ipv4.c > @@ -465,16 +465,14 @@ void cipso_v4_doi_free(struct cipso_v4_doi *doi_def) > if (!doi_def) > return; > > - if (doi_def->map.std) { > - switch (doi_def->type) { > - case CIPSO_V4_MAP_TRANS: > - kfree(doi_def->map.std->lvl.cipso); > - kfree(doi_def->map.std->lvl.local); > - kfree(doi_def->map.std->cat.cipso); > - kfree(doi_def->map.std->cat.local); > - kfree(doi_def->map.std); > - break; > - } > + switch (doi_def->type) { > + case CIPSO_V4_MAP_TRANS: > + kfree(doi_def->map.std->lvl.cipso); > + kfree(doi_def->map.std->lvl.local); > + kfree(doi_def->map.std->cat.cipso); > + kfree(doi_def->map.std->cat.local); > + kfree(doi_def->map.std); > + break; > } > kfree(doi_def); > } >