Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3740511iog; Tue, 28 Jun 2022 01:32:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1spgml9NzOZtSG1bcyZNbCNqqAXVAaRDkWEWuzjt3k21l5AszESZtAmwOMgofcDBufb4rsX X-Received: by 2002:a17:907:7f8c:b0:726:2c53:2f82 with SMTP id qk12-20020a1709077f8c00b007262c532f82mr16408068ejc.140.1656405157314; Tue, 28 Jun 2022 01:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656405157; cv=none; d=google.com; s=arc-20160816; b=N6RX4G1zWzczhKg+7UfcNM9Ca5GGpOoMo/bn9V1D+m8AMaRCiI6U44nVLaujM3o581 bsR+uc7jMWK+4UE5YPfLpxU/eSlONdWW3iL/pW/am3i2tpvwLEUz7w+sK5pBzNufg5ez PygL6g6Yp99cQXIASClI/+yVfF9CjM1FkXEudSBK/XauHtZ/kedFbKk/CYSZyCMfeEYI 6LPDPakJMfa/fbcQs/O1MAuFPCUPGcBaLQiJQeq8xH1VY/iPbsc/Ege8RvsYU/8cx9TW MSjteYfjFQoqmVo6myi5Ngq69HBcq+LSySQDNb7se3yTARCzG24ARl87+xEL1EENAMFt aK2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=K38YHnI8KKXEsu+LVCyhxZDBDqf305H9Xn5K2Tu2gdA=; b=c0xdV31xbnGGgHS5koR14XNeT6UbxBixMC/fJI96RSvndXpJw4O5SsfHvH6jScRKKS n/oWCzfDFvH9qm9h+gjkfV8GWzXkNq9Pg02ZJ2opG+1zGSJSgmy0ON6XHidod/VNEfkj jMPVXXOuLgO1s7iBkxbjSZzLaW6OhilacGe4ymqF4Vx0UdRex7jNhC9g9BuddNI8nUbP rNWA+wxSRj0vdGmBeLlW8lbLUsD6kWVAjO/jtEw7Rog+bcavaiu54JD2LIYwFQNM2Wit +K9KlpvD3A6VhcNw7dei+3pfrSeGWYFdiZ9In8naxX9JVD68t+oGcLDf0WRLE0NOVKY8 i4tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N6AaPW03; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb32-20020a1709077ea000b006f3fd7b244fsi16384201ejc.102.2022.06.28.01.32.03; Tue, 28 Jun 2022 01:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N6AaPW03; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245445AbiF1IXl (ORCPT + 99 others); Tue, 28 Jun 2022 04:23:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245440AbiF1IWT (ORCPT ); Tue, 28 Jun 2022 04:22:19 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75DEF2E0B6; Tue, 28 Jun 2022 01:21:22 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id x4so11359504pfq.2; Tue, 28 Jun 2022 01:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=K38YHnI8KKXEsu+LVCyhxZDBDqf305H9Xn5K2Tu2gdA=; b=N6AaPW03jIoV2m3jDKOx4pZa24jTgD/3obADz9jYwVMbUqqYOjh9HHQepI7obo9wo1 bGAnpuqAsT6TCAz72wo6D/wlLXkKIQht7p667oB/N8IjpA74e4UlPc0XMIhBJm1B7Nig V7dwJqhlz4TcofZTq6TLk9Jj6p/adcYBVBMkO+cvR3feAbT1uzgx8vShHwdXAeYI8c1F 7bCFh3bcy1qEySiJHQlp321EH3/2dWywbkNqSmS316O/pfb725/OcysXIwe+Ru+WIrHI B43issXB70i//e3PNTODJkyyapwE+Qlnuq+deTrSejnld9dVqe4KdErNZ+2IYyWJ20ji dCFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=K38YHnI8KKXEsu+LVCyhxZDBDqf305H9Xn5K2Tu2gdA=; b=KRDnFXF985oDli69q00w8RKSISzMqqd48Q7sulfQ6P8xnaVIjCEFiVg0OweIUEPz/H k6+wMQe3rkbD+FAhGMoKiIlVVSlfyRC79by238aM++5i63xziNQLJiKxAd/BPAmk0B0m jwKegt9OFZz8Hm7+aNpKPg+gdIdo0xnpPHuKhSTmKidreOsdW4NRJlx8Vamk2ryFte95 hHRERkdyMlBbNl+VOwzsynqA9eFz3m2ZW9D3HLTUIrfh/+7eQ7ejjyA6KuloYzWHbay9 WqMeoMutHVr/Yay58y1tSa2quIvOExTQyyQpUd0gZuSbs69MHAYP1n3I0iE/2oGuwk4T SSdA== X-Gm-Message-State: AJIora9AudDD9ajG1uIHNUfJKW6ElF9YSwPkSwIDoaVUvcZ7IxXijfQW taBoC0eFb6jgykWp7O1McqA= X-Received: by 2002:a63:ef0b:0:b0:40d:287d:71e1 with SMTP id u11-20020a63ef0b000000b0040d287d71e1mr16695519pgh.330.1656404482154; Tue, 28 Jun 2022 01:21:22 -0700 (PDT) Received: from [192.168.50.247] ([103.84.139.165]) by smtp.gmail.com with ESMTPSA id q5-20020a170902bd8500b001640beeebf1sm8510168pls.268.2022.06.28.01.21.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jun 2022 01:21:21 -0700 (PDT) Message-ID: <8f647d13-ed5d-6799-97b1-3f5061879d9e@gmail.com> Date: Tue, 28 Jun 2022 16:21:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] net: tipc: fix possible infoleak in tipc_mon_rcv() Content-Language: en-US To: Tung Quang Nguyen Cc: "netdev@vger.kernel.org" , "tipc-discussion@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" , "jmaloy@redhat.com" , "ying.xue@windriver.com" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" References: <20220628025921.14767-1-hbh25y@gmail.com> From: Hangyu Hua In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 2022/6/28 11:35, Tung Quang Nguyen wrote: >> -----Original Message----- >> From: Hangyu Hua >> Sent: Tuesday, June 28, 2022 9:59 AM >> To: jmaloy@redhat.com; ying.xue@windriver.com; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; >> pabeni@redhat.com >> Cc: netdev@vger.kernel.org; tipc-discussion@lists.sourceforge.net; linux-kernel@vger.kernel.org; Hangyu Hua >> Subject: [PATCH] net: tipc: fix possible infoleak in tipc_mon_rcv() >> >> dom_bef is use to cache current domain record only if current domain >> exists. But when current domain does not exist, dom_bef will still be used >> in mon_identify_lost_members. This may lead to an information leak. >> >> Fix this by adding a memset before using dom_bef. >> >> Fixes: 35c55c9877f8 ("tipc: add neighbor monitoring framework") >> Signed-off-by: Hangyu Hua > >> --- >>  net/tipc/monitor.c | 1 + >>  1 file changed, 1 insertion(+) >> >> diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c >> index 2f4d23238a7e..67084e5aa15c 100644 >> --- a/net/tipc/monitor.c >> +++ b/net/tipc/monitor.c >> @@ -534,6 +534,7 @@ void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr, >>        state->peer_gen = new_gen; >> >>        /* Cache current domain record for later use */ >> +     memset(&dom_bef, 0, sizeof(dom_bef)); >>        dom_bef.member_cnt = 0; > Please remove /dom_bef.member_cnt = 0;/ if memset() is used instead. I get it. I will send a v2. Thanks, Hangyu >>        dom = peer->domain; >>        if (dom) >> -- >> 2.25.1