Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2712452ybe; Thu, 12 Sep 2019 13:45:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhjt/a2Ax6JMSxU08HpusAW8pzWz6YVKC239WB20CDMLqeWtHvvtB/ZtEne6/0eSc5D8n/ X-Received: by 2002:a05:6402:7d1:: with SMTP id u17mr44111844edy.132.1568321104670; Thu, 12 Sep 2019 13:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568321104; cv=none; d=google.com; s=arc-20160816; b=pSBHKUfcY6lBQ2sG10oi5LaxX9IOqVwFT1Xsc84H+gIS6NMTgx3S2NHcCcNVmyJkjj gLBrWk2uR5vxSJGKA2IwVsIGwfbT5fNBkqbwOhh0pE4WuJy73SSvd0GAYJ8U+qeASIW0 JPAyqVxwmX4+v3DEkFHTnilbFZC/sbCBb1pSQ6U/HkiR7TdOcbxIyjX+E0ZmtNqDd6mR Jj7xGNFpTLryPZ2ANuryMyZ8vJsVzqd4f7OXZI3Bx4HNcNNlZDY7WZE/ZFeP6F80enfQ YzpTQZikr43PKdpAjELr4MKkc/kpnHRf+y6mnNoQhNipulEhxBibYnfXaCMTsA0AcU73 p7OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4TYD+cMewnYL5z3ieEOxCFAZpD0FvyxKAgBZKpsQKLA=; b=XZ467JX4VTtjysscLZso7D8ImCRsHZRJ2cUC2a2JH+2GrTatTgR0o/hF3hw/JLWrQJ NLGYDmfbszonzobSxcfbjh/8zetwcbZEW5rshHB6fiv/B3kQDHTLxxUraUSCjZxJTvW7 NwrhS1muPE/O7wB/7l3X4N1aJ2oy+E3gPDfRzuRYw8ANJD56pVfdbAGRhBlDBct2h2VH lX2RBtxWPN+h+8vZe9n2xp966YQvIpm5nv6gDdVcCjARfMc/dwbqxd9yrzkD93F7jEIM lQD17RE+KT+Fg1dFvEhQWlyFo4dd9FLbNWRRkLZHeTlFnsvcWQhoPtLaUtAzYPmugNVM Jkog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="GyqcPE4/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w25si15548084eds.357.2019.09.12.13.44.40; Thu, 12 Sep 2019 13:45:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="GyqcPE4/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1732868AbfILOwX (ORCPT + 99 others); Thu, 12 Sep 2019 10:52:23 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:37580 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732777AbfILOwW (ORCPT ); Thu, 12 Sep 2019 10:52:22 -0400 Received: by mail-qk1-f195.google.com with SMTP id u184so21855464qkd.4; Thu, 12 Sep 2019 07:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4TYD+cMewnYL5z3ieEOxCFAZpD0FvyxKAgBZKpsQKLA=; b=GyqcPE4/EQBaVHpCqx2y3ZULViVFVL8tffo3OyPRfyuexXAahJ07HdkYnsrFM4+Cb4 mvyCnZyx37tY7lxrXcZ+G6iXswOE12khIZ6PgJNpmrNcFd0mqeZhatW3hbubKYuDuNED 9AqqRDHLKy/PvNSE7RvUFkEIwurppFR70hMCcanG1PbPfs2M5LNRgSH1MTTT3765f7Zt kQALaE1WvCoZkRSESWnB5HYlEIBDHqJ7OZ2b67QTo1HsxzckrBnS+GmwO4p1xkumgexT 2DnZYC6XURzprpCttbU2uKTQ+joNI0HKRU0JimpA7mRFi9DksFfFtNgQb4fRNTXGRUsz XRtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4TYD+cMewnYL5z3ieEOxCFAZpD0FvyxKAgBZKpsQKLA=; b=f+ZtiHI5X8lgUYYQzXfj9kWJKYEMu6cEv/o6WTBudwWotEQOmvMk1J3heltKUr6HnS JmhlBTUjxxhXnY43PMPGN11Pb8dFaAbGwRj64cAAWdVSMeN5kCWfLcAz+dKyHcaOOczC /2++bq/CqZGcfpD7tzDzWXH+EKuyPYB418yJtMgBsw/U2Nyzb3f0mow7wFqdbMB2JA4F mO4pMkZX60KTFiXgbQyrud2mtYXcUl3YKmEvR6jMjWD4FuP5EmKO2iCgXIYGGO6Af1xi YSp48O4xm7wudfISzwIByilT8koHdSb+ayMdwjUIfph9ICfRICjqLMbSfHZxMK3T+vIw yYQQ== X-Gm-Message-State: APjAAAXZmiHHwf4wr+HXQAerSQT6c7MbO9lwd/6nzSH0vyuAfKD4UjwF bSCCS7cHHAzt/bIa0/EGLqM= X-Received: by 2002:a37:6681:: with SMTP id a123mr39180452qkc.499.1568299941468; Thu, 12 Sep 2019 07:52:21 -0700 (PDT) Received: from localhost.localdomain ([2001:1284:f016:e600:cd79:21fe:b069:7c04]) by smtp.gmail.com with ESMTPSA id m19sm12221716qke.22.2019.09.12.07.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2019 07:52:20 -0700 (PDT) Received: by localhost.localdomain (Postfix, from userid 1000) id 5B906C0DAD; Thu, 12 Sep 2019 11:52:18 -0300 (-03) Date: Thu, 12 Sep 2019 11:52:18 -0300 From: Marcelo Ricardo Leitner To: Mao Wenan Cc: vyasevich@gmail.com, nhorman@tuxdriver.com, davem@davemloft.net, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Hulk Robot Subject: Re: [PATCH v2 net 3/3] sctp: destroy bucket if failed to bind addr Message-ID: <20190912145218.GT3431@localhost.localdomain> References: <7a450679-40ca-8a84-4cba-7a16f22ea3c0@huawei.com> <20190912040219.67517-1-maowenan@huawei.com> <20190912040219.67517-4-maowenan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190912040219.67517-4-maowenan@huawei.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 12, 2019 at 12:02:19PM +0800, Mao Wenan wrote: > There is one memory leak bug report: > BUG: memory leak > unreferenced object 0xffff8881dc4c5ec0 (size 40): > comm "syz-executor.0", pid 5673, jiffies 4298198457 (age 27.578s) > hex dump (first 32 bytes): > 02 00 00 00 81 88 ff ff 00 00 00 00 00 00 00 00 ................ > f8 63 3d c1 81 88 ff ff 00 00 00 00 00 00 00 00 .c=............. > backtrace: > [<0000000072006339>] sctp_get_port_local+0x2a1/0xa00 [sctp] > [<00000000c7b379ec>] sctp_do_bind+0x176/0x2c0 [sctp] > [<000000005be274a2>] sctp_bind+0x5a/0x80 [sctp] > [<00000000b66b4044>] inet6_bind+0x59/0xd0 [ipv6] > [<00000000c68c7f42>] __sys_bind+0x120/0x1f0 net/socket.c:1647 > [<000000004513635b>] __do_sys_bind net/socket.c:1658 [inline] > [<000000004513635b>] __se_sys_bind net/socket.c:1656 [inline] > [<000000004513635b>] __x64_sys_bind+0x3e/0x50 net/socket.c:1656 > [<0000000061f2501e>] do_syscall_64+0x72/0x2e0 arch/x86/entry/common.c:296 > [<0000000003d1e05e>] entry_SYSCALL_64_after_hwframe+0x49/0xbe > > This is because in sctp_do_bind, if sctp_get_port_local is to > create hash bucket successfully, and sctp_add_bind_addr failed > to bind address, e.g return -ENOMEM, so memory leak found, it > needs to destroy allocated bucket. > > Reported-by: Hulk Robot > Signed-off-by: Mao Wenan > Acked-by: Neil Horman Acked-by: Marcelo Ricardo Leitner