Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2534842pxk; Mon, 14 Sep 2020 16:38:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7ujJdT2Z1ANV9xDxibVYonvM77pZJvPzCOxf+Lmc80jkIGCEIqK/Cn/NucGMph3uiwejU X-Received: by 2002:aa7:d8d8:: with SMTP id k24mr19210265eds.97.1600126698017; Mon, 14 Sep 2020 16:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600126698; cv=none; d=google.com; s=arc-20160816; b=vLtWD8CwUw++KlUdNvf/koNwd9rii3pDCrp5v00uPCpwFqfbbtwdvtyJUMXSlSMB4s xJgtmdC50zMU9RR07DMjFjiq8Y9k1gaGYsGPJxVR0ffbwJBINVV0LHZFDFCr1YqKqY9l rCQv1R+JA0kNsfzOM1wj8OpfV0Nh5FhZQpFvNhvWl6zmK6OQrX+OWR3UfsoM7LISo7Ht qUaxvfaTM8JczZkZVzQ8TK+sLBSqxddtUYtq4vLqkiRXVs3VNdI4xna5PK0A59MSzMbb Vg4DHoty2slzfEhNvU2Cvz1fENgpZ+9SIykBu/h2QBYwLO0cvpvZ6UHoWm4/CJXXTTxA 9P5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=2b2VTUHeINPpB3DpbJ9JLCxHo2pTl6C/2FIm+4DloSs=; b=MgA56qTxwE3vze0rN2vxUrAGM8dS/lfotdk+71hbgT1aNKfAtw0H8y5uAgPuT2N1AU /os9+ThCIoMAeJ3o5Oazb/WjZZbfbXEdIWBkWRI8oCNqbgZfh1DrRgGHVrsaI94b/Vc/ toSPGCsUPO3cRT3BQNS+VHT/zECh/77sEHdTG70B0uSpIyLZGYl54HaJkwN0RCpKm2yD Maj7pV+o0u78d/HHLVhm9iqB9qOgNNR0+SbxJBbQ71Hd9UtVNW4iyTk//08syCZHaYkt +PTNRV7djZDp/nlHk9ODUJ73laY4PoRDQHh1XIFoeXJTF+lG7x9DHWCx6IK2NQ0Jv/Fb usMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v9si8659620edd.297.2020.09.14.16.37.55; Mon, 14 Sep 2020 16:38:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726045AbgINXhJ (ORCPT + 99 others); Mon, 14 Sep 2020 19:37:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbgINXhJ (ORCPT ); Mon, 14 Sep 2020 19:37:09 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CDC3C06174A; Mon, 14 Sep 2020 16:37:09 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 6BD0E128BC946; Mon, 14 Sep 2020 16:20:20 -0700 (PDT) Date: Mon, 14 Sep 2020 16:37:06 -0700 (PDT) Message-Id: <20200914.163706.1002264196277641638.davem@davemloft.net> To: yepeilin.cs@gmail.com Cc: jmaloy@redhat.com, ying.xue@windriver.com, kuba@kernel.org, hdanton@sina.com, gregkh@linuxfoundation.org, netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-kernel-mentees@lists.linuxfoundation.org, syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [Linux-kernel-mentees] [PATCH net v2] tipc: Fix memory leak in tipc_group_create_member() From: David Miller In-Reply-To: <20200913080605.1542170-1-yepeilin.cs@gmail.com> References: <20200912102230.1529402-1-yepeilin.cs@gmail.com> <20200913080605.1542170-1-yepeilin.cs@gmail.com> X-Mailer: Mew version 6.8 on Emacs 27.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [2620:137:e000::1:9]); Mon, 14 Sep 2020 16:20:20 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peilin Ye Date: Sun, 13 Sep 2020 04:06:05 -0400 > tipc_group_add_to_tree() returns silently if `key` matches `nkey` of an > existing node, causing tipc_group_create_member() to leak memory. Let > tipc_group_add_to_tree() return an error in such a case, so that > tipc_group_create_member() can handle it properly. > > Fixes: 75da2163dbb6 ("tipc: introduce communication groups") > Reported-and-tested-by: syzbot+f95d90c454864b3b5bc9@syzkaller.appspotmail.com > Cc: Hillf Danton > Link: https://syzkaller.appspot.com/bug?id=048390604fe1b60df34150265479202f10e13aff > Signed-off-by: Peilin Ye > --- > Change in v2: > - let tipc_group_add_to_tree() return a real error code instead of -1. > (Suggested by David Miller ) Applied and queued up for -stable, thank you.