Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3335885imm; Thu, 17 May 2018 07:13:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpCjgM/5CoBoUjhjJ6ZIkYDcbBfCsOapabKMSuidkdtOJRg7lg8OVFRilHpHEf9yd5djQdf X-Received: by 2002:a63:6e87:: with SMTP id j129-v6mr4154515pgc.86.1526566416694; Thu, 17 May 2018 07:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526566416; cv=none; d=google.com; s=arc-20160816; b=T2BK6TUddcA4IDZ7HyxERW32YFUEzHa/7WLJkS0zzVvEds0aiNkEjVDrnrCuCUXrMh G0jazq6aggtwcaO/Ypnht4QqzONCDcQjl5hdxiq/YL0IVtccZsGkXk0zeMJSEj4ctbWB 5ZeBjnxabojH52cmJs9cR/jxUS/jhbha6bpkvm2MvhPR6/cRA02MQtBetVZaoZLDUDnW zCGF50T3tDiPsMy66VeBOa2WmMpg7v+lLpzPo+YdWfYuaIuX+yZ461HNYpPk+LZdi/z6 xQHCDH7XBvSZkKsKsT/j170UK2cMKBWo3oWofwXyPHpAp/fXqUQOKFHz0Zep4Wibj2pD uf3w== 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:arc-authentication-results; bh=Ndq6QRh2e8p/R9X7b0B55k+GZvyNrsZLB6j2GCiR1eo=; b=WxPi9ADOOOITAc1OuPL9dYnhQkcKsBVGBRN3EOQ8CWuVlS1NWBrGR7Yc1oce60TcQi 8Fw9ABJPCu14l5YNcstydSG2F1lA2lBB9c6dIsX8kwrAjq1KLh+8az0deMijjQz9RSoe nZMeyg0ETBIDtUKO/4xTnm+/SjX+3YI4SCFmnH98lSt1qsDMcXSJ5at7yuDWVjyxvI8F gpktzOeAG5aTWyadwCUBrOMXdKtRKemFU/F8Pa4zIevIxXW50aE6RY7fhRDBzf3S9Oju J5gRZYp77uWP7Fd/KiRaqOSjsLbW+MzW8roloZqEtgCfUcWzYC+JH+I1ofqxq9z2Ruz9 Oa6Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3-v6si5148088pld.50.2018.05.17.07.13.19; Thu, 17 May 2018 07:13:36 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbeEQOLF (ORCPT + 99 others); Thu, 17 May 2018 10:11:05 -0400 Received: from gateway33.websitewelcome.com ([192.185.146.85]:11570 "EHLO gateway33.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752002AbeEQOLE (ORCPT ); Thu, 17 May 2018 10:11:04 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 0F3101ADB8B for ; Thu, 17 May 2018 09:11:04 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id JJcWfwg3eWCOCJJcWfnL6J; Thu, 17 May 2018 09:11:04 -0500 X-Authority-Reason: nr=8 Received: from [187.172.56.86] (port=58230 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1fJJcV-000DC8-I6; Thu, 17 May 2018 09:11:03 -0500 Date: Thu, 17 May 2018 09:11:02 -0500 From: "Gustavo A. R. Silva" To: Alexei Starovoitov , Daniel Borkmann , John Fastabend Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH 2/2] bpf: sockmap, fix double-free Message-ID: <96e7f5e59eacddc5e32abb72b7686c3e9163a410.1526565461.git.gustavo@embeddedor.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.172.56.86 X-Source-L: No X-Exim-ID: 1fJJcV-000DC8-I6 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [187.172.56.86]:58230 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 15 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org `e' is being freed twice. Fix this by removing one of the kfree() calls. Addresses-Coverity-ID: 1468983 ("Double free") Fixes: 81110384441a ("bpf: sockmap, add hash map support") Signed-off-by: Gustavo A. R. Silva --- kernel/bpf/sockmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index 41b41fc..c682669 100644 --- a/kernel/bpf/sockmap.c +++ b/kernel/bpf/sockmap.c @@ -1823,7 +1823,6 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map, write_unlock_bh(&sock->sk_callback_lock); return err; out_free: - kfree(e); smap_release_sock(psock, sock); out_progs: if (verdict) -- 2.7.4