From patchwork Mon Dec 15 12:19:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 421143 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 86E381400D2; Mon, 15 Dec 2014 23:19:43 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Y0Ucn-0002IW-2f; Mon, 15 Dec 2014 12:19:41 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Y0Uc7-0001xp-NI for kernel-team@lists.ubuntu.com; Mon, 15 Dec 2014 12:18:59 +0000 Received: from av-217-129-142-138.netvisao.pt ([217.129.142.138] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Y0Uc6-0005BI-1i; Mon, 15 Dec 2014 12:18:58 +0000 From: Luis Henriques To: Nicolas Dichtel Subject: [3.16.y-ckt stable] Patch "rtnetlink: release net refcnt on error in do_setlink()" has been added to staging queue Date: Mon, 15 Dec 2014 12:19:03 +0000 Message-Id: <1418645943-9399-1-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 2.1.3 X-Extended-Stable: 3.16 Cc: kernel-team@lists.ubuntu.com, "Eric W. Biederman" , "David S. Miller" X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled rtnetlink: release net refcnt on error in do_setlink() to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y-queue This patch is scheduled to be released in version 3.16.7-ckt3. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.16.y-ckt tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Luis ------ From e219e662fa54df4679d45840d2e7f87ea73bc010 Mon Sep 17 00:00:00 2001 From: Nicolas Dichtel Date: Thu, 27 Nov 2014 10:16:15 +0100 Subject: rtnetlink: release net refcnt on error in do_setlink() commit e0ebde0e131b529fd721b24f62872def5ec3718c upstream. rtnl_link_get_net() holds a reference on the 'struct net', we need to release it in case of error. CC: Eric W. Biederman Fixes: b51642f6d77b ("net: Enable a userns root rtnl calls that are safe for unprivilged users") Signed-off-by: Nicolas Dichtel Reviewed-by: "Eric W. Biederman" Signed-off-by: David S. Miller Signed-off-by: Luis Henriques --- net/core/rtnetlink.c | 1 + 1 file changed, 1 insertion(+) -- 2.1.3 diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index e0b5ca349049..48c2be43f856 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1490,6 +1490,7 @@ static int do_setlink(const struct sk_buff *skb, goto errout; } if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) { + put_net(net); err = -EPERM; goto errout; }