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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 73569C433DB for ; Sun, 14 Mar 2021 08:37:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3FCBF6186A for ; Sun, 14 Mar 2021 08:37:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234889AbhCNIgk (ORCPT ); Sun, 14 Mar 2021 04:36:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:41850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234806AbhCNIgP (ORCPT ); Sun, 14 Mar 2021 04:36:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B615F64EBE; Sun, 14 Mar 2021 08:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615710975; bh=ZS6V5nnNAhbzXMkBCECzzKS2KrJq8/t/D+B+J+8wv8A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VIUWbuYQ+4ZngiJMa1TKSbhSQKKquEkuecHoNiXxa9p2V+DUm+uVtRjk168NhwyZg NfCsSFq0zkbZFYUETd2S7KvLmU8tet3ZxYlttg7cFpVKxti2ByCXl+p8zORoTzQ0zB mu1zIOT7XWCwK9gqpr2VWSSknBSuM6seUgvD15Lk= Date: Sun, 14 Mar 2021 09:36:11 +0100 From: Greg KH To: Fatih Yildirim Cc: santosh.shilimkar@oracle.com, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: Re: [BUG] net: rds: rds_send_probe memory leak Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Sun, Mar 14, 2021 at 11:23:10AM +0300, Fatih Yildirim wrote: > Hi Santosh, > > I've been working on a memory leak bug reported by syzbot. > https://syzkaller.appspot.com/bug?id=39b72114839a6dbd66c1d2104522698a813f9ae2 > > It seems that memory allocated in rds_send_probe function is not freed. > > Let me share my observations. > rds_message is allocated at the beginning of rds_send_probe function. > Then it is added to cp_send_queue list of rds_conn_path and refcount > is increased by one. > Next, in rds_send_xmit function it is moved from cp_send_queue list to > cp_retrans list, and again refcount is increased by one. > Finally in rds_loop_xmit function refcount is increased by one. > So, total refcount is 4. > However, rds_message_put is called three times, in rds_send_probe, > rds_send_remove_from_sock and rds_send_xmit functions. It seems that > one more rds_message_put is needed. > Would you please check and share your comments on this issue? Do you have a proposed patch that syzbot can test to verify if this is correct or not? thanks, gre gk-h