From patchwork Mon Feb 22 15:45:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Craig Gallek X-Patchwork-Id: 586321 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AB44E140CA9 for ; Tue, 23 Feb 2016 02:45:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754146AbcBVPpf (ORCPT ); Mon, 22 Feb 2016 10:45:35 -0500 Received: from mail-qg0-f49.google.com ([209.85.192.49]:33415 "EHLO mail-qg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754116AbcBVPpc (ORCPT ); Mon, 22 Feb 2016 10:45:32 -0500 Received: by mail-qg0-f49.google.com with SMTP id b35so113521754qge.0 for ; Mon, 22 Feb 2016 07:45:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=u2JioOt3FlBoVBlvz6kYGIfEYUVjfS+4Xmt2mAN5vwM=; b=jzKlo+g2W4x/+FlFKjQKpz2vGsCzxjdSoy8dSQa2xeBkrqTc0Qdg6dtR9bS43Fgrfp Rsy/5XHPM6k4478VlZS9+0ss9d7ztEtTtCNCJEBzV1qFU/DesS9tLoRmyFDd7tIcMISG ZYvwgwXfkhP/GT7OGjIyZxn2gaPR3uAymDReRfLRt12NQhYHy+G5ou8wPotkJ3h1lIHL X1YIY4/lTEEv2dWm6JjZH6BixH9zIMujASZSqteEsOb6EF++AnHKcEKuI0b7qQpsrZPw 2/HLzX1R32izNFLLJbuGAffJFK/ywVJjGMI8B8CXE0cNC7mHF6a6ZQ/JvlMEV7M5oTPE dw7w== X-Gm-Message-State: AG10YOQsAK+7kECkVtOVL/UkfNX8Ny7FX/DtrK2V+bQxYQSJGxKCdolanqyaClgGGpvxGb5s X-Received: by 10.140.239.66 with SMTP id k63mr37458053qhc.11.1456155931628; Mon, 22 Feb 2016 07:45:31 -0800 (PST) Received: from cgallek-warp18.nyc.corp.google.com ([172.29.18.56]) by smtp.gmail.com with ESMTPSA id r189sm2339187qhb.26.2016.02.22.07.45.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Feb 2016 07:45:30 -0800 (PST) From: Craig Gallek To: netdev@vger.kernel.org, David Miller Cc: eric.dumazet@gmail.com Subject: [PATCH net-next] soreuseport: fix merge conflict in tcp bind Date: Mon, 22 Feb 2016 10:45:29 -0500 Message-Id: <1456155929-2708-1-git-send-email-kraigatgoog@gmail.com> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Craig Gallek One of the validation checks for the new array-based TCP SO_REUSEPORT validation was unintentionally dropped in ea8add2b1903. This adds it back. Lack of this check allows the user to allocate multiple sock_reuseport structures (leaking all but the first). Fixes: ea8add2b1903 ("tcp/dccp: better use of ephemeral ports in bind()") Signed-off-by: Craig Gallek --- net/ipv4/inet_connection_sock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 3d28c6d5c3c3..fb0349acbd45 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c @@ -202,6 +202,7 @@ tb_found: if (((tb->fastreuse > 0 && reuse) || (tb->fastreuseport > 0 && + !rcu_access_pointer(sk->sk_reuseport_cb) && sk->sk_reuseport && uid_eq(tb->fastuid, uid))) && smallest_size == -1) goto success;