linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.16 16/18] vti6: better validate user provided tunnel names
Date: Wed, 11 Apr 2018 00:23:51 +0200	[thread overview]
Message-ID: <20180410212759.435007511@linuxfoundation.org> (raw)
In-Reply-To: <20180410212758.564682823@linuxfoundation.org>

4.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>


[ Upstream commit 537b361fbcbcc3cd6fe2bb47069fd292b9256d16 ]

Use valid_name() to make sure user does not provide illegal
device name.

Fixes: ed1efb2aefbb ("ipv6: Add support for IPsec virtual tunnel interfaces")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv6/ip6_vti.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -212,10 +212,13 @@ static struct ip6_tnl *vti6_tnl_create(s
 	char name[IFNAMSIZ];
 	int err;
 
-	if (p->name[0])
+	if (p->name[0]) {
+		if (!dev_valid_name(p->name))
+			goto failed;
 		strlcpy(name, p->name, IFNAMSIZ);
-	else
+	} else {
 		sprintf(name, "ip6_vti%%d");
+	}
 
 	dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN, vti6_dev_setup);
 	if (!dev)

  parent reply	other threads:[~2018-04-10 22:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 22:23 [PATCH 4.16 00/18] 4.16.2-stable review Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 01/18] sparc64: Oracle DAX driver depends on SPARC64 Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 02/18] arp: fix arp_filter on l3slave devices Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 03/18] net: dsa: Discard frames from unused ports Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 04/18] net/ipv6: Increment OUTxxx counters after netfilter hook Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 05/18] net/sched: fix NULL dereference in the error path of tcf_bpf_init() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 06/18] pptp: remove a buggy dst release in pptp_connect() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 07/18] sctp: do not leak kernel memory to user space Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 08/18] sctp: sctp_sockaddr_af must check minimal addr length for AF_INET6 Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 09/18] sky2: Increase D3 delay to sky2 stops working after suspend Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 10/18] vlan: also check phy_driver ts_info for vlans real device Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 11/18] net: fool proof dev_valid_name() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 12/18] ip_tunnel: better validate user provided tunnel names Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 13/18] ipv6: sit: " Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 14/18] ip6_gre: " Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 15/18] ip6_tunnel: " Greg Kroah-Hartman
2018-04-10 22:23 ` Greg Kroah-Hartman [this message]
2018-04-10 22:23 ` [PATCH 4.16 17/18] net_sched: fix a missing idr_remove() in u32_delete_key() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 18/18] nfp: use full 40 bits of the NSP buffer address Greg Kroah-Hartman
2018-04-11  6:02 ` [PATCH 4.16 00/18] 4.16.2-stable review kernelci.org bot
2018-04-11 17:15 ` Shuah Khan
2018-04-12 12:31   ` Greg Kroah-Hartman
2018-04-11 17:27 ` Guenter Roeck
2018-04-12 12:31   ` Greg Kroah-Hartman
2018-04-11 19:26 ` Dan Rue
2018-04-12 12:32   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180410212759.435007511@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).