Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2501028pxf; Sun, 14 Mar 2021 00:39:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeGx4kUzp6cEgEhChZKhGSL5oXHiO0XImRrMNZeQFdBx5dFVg1kzWfR0av1BIXRrF5T4cY X-Received: by 2002:a17:906:1444:: with SMTP id q4mr17646867ejc.343.1615711162029; Sun, 14 Mar 2021 00:39:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615711162; cv=none; d=google.com; s=arc-20160816; b=C2uEZVZwAGHeabDiQroaJBpmxL9xrMaGD4nTFxhBX/5/cDZw7u6bJe1v5aumjVNgqk 61/CXoKi7iQsV4r5ylx3cRXmeLNS5rhSWqgqPvs8MYJZ1GWMaLpMYjKfSzJOou5NN4+p xW2XIcKEr+wtW7nJCpboKQWtgg6Mi9g7dzXpcRrY39RYQhnxQIT5B7LLu2k1QINDPf50 OxEWVShiqNMs5kS4VwCo8pgXXHq3v8zWUFOUNL0hYghvSAxcLheSLtG7BnaPH0NjORw9 8A5TeteV97ybrlHIDiW/uDuKG3GVu2CqBr5LLCG05rjqkGaDUlm2F5bcD4XEB5oTCta5 Q9cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Os4W6t9mwpDW0uXAjY+Pc7qcaenYi1L/3N7cD7s7Na4=; b=dmzj+eJYlNRT0k5T8gEfNLzp0pKbfbGfCVLrrH6MhazuSJT44AK1AzFxCUgEFG+6Hc 0lvIJAOK1ve/k5eansaNqQ6HYzWgkKHSGFd84kIshc3owktzCq9VpgWH3cKQN5Z24wUq jg4eQQL0P96HY1vAm9O0tnnc6OpP2xLM0E3Z5/6PfP785yNw/YMjdm3/WOheY/T/SJSr HfgRg/xBWIEZsdN5ypCZOYUjd8A/oOSSRGVIrOPiN+nOmSBCy3NEmCSJ7sNd4AfNgXDr m1PNxRYXKfOYJMPNE4ElixhQaITI/45LsRWpHICX9PkIzDAjmyB3l32UQMk/042IwPYn Dyfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VIUWbuYQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si8375732edv.220.2021.03.14.00.38.59; Sun, 14 Mar 2021 00:39:22 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VIUWbuYQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234997AbhCNIgo (ORCPT + 99 others); Sun, 14 Mar 2021 04:36:44 -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-kernel@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