Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3439676imu; Sun, 11 Nov 2018 15:08:01 -0800 (PST) X-Google-Smtp-Source: AJdET5dV0eUk4f+IwUkyOkTzLGWXlIlPAZQ4eb8U+OjQszi9f3i7/YUcUxLKnt+VOLR0pFSzy9J7 X-Received: by 2002:a17:902:2bc5:: with SMTP id l63-v6mr17800482plb.241.1541977681231; Sun, 11 Nov 2018 15:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977681; cv=none; d=google.com; s=arc-20160816; b=WnxiqXpqBnVAURigdvuZVgC/vVWbZ24TYh0iFH3kLclvT7rswyxuGNqqZSKA6O9P66 +HCazWDtn8zuMjIbcHf5xa3Z4fxpza/GQ52Ew4jwQTCxaXLWMg6DycZ90JjQ27lAR4HY /caPpgzr/0Q9ISOuSotpgvgJ8mdWh89CkU/Az0FBp/DN0LlFdxMX2evj0oBFHxHi3jJU iiEWqzlbuOpY+/nzZvDnzgOYvUVqYQpzBdzUsyqjIVkCO4nGE1hbc8FK/cRpY6+4vO3Z njbNJGJpsKRf8SCvCMO5WUSMVob0O56FecEBeNDmC1H5dcRiCcz3excUkRuGqv6G2Z4g Wehg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3/GHsvoEpRaaUuxGRPpp4jT96Rnl4Y2Cw9YDGsOpr2A=; b=cSv8x8yY/cgF31D+dgUp/L25DokIUaReWR11S4gh0ls9Re/I3Hw7rUzG6lgFkSYxF5 /EkaaonXmkiKqZFFyyMvTNalyRjvujxJyspzIl8gqvB3FyAep3vMED8m7DLNLQa5aXNK LRGr+/ZTuahCjcwkG4M4iLwqWOaUwk5vyNqF+MQBJu3a1suqPt3ZS9dS5JZSuvBKchac yP/2tmrUHq6nNtuVSmhH8fRYlRe1YyNFGPU7TjO8meN0iPxMLxWUFT9bDz1Xa4hhnBqS V4aMCosQNMAL1kv1u66sJvup5mycT9VA5mVRX50S0GPUlTvxNqm8dFu8WqlDvNZNKsCE qc+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YrfrhnyM; 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 193si14734662pgc.220.2018.11.11.15.07.46; Sun, 11 Nov 2018 15:08:01 -0800 (PST) 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=@kernel.org header.s=default header.b=YrfrhnyM; 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 S2390460AbeKLI5e (ORCPT + 99 others); Mon, 12 Nov 2018 03:57:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:51200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390295AbeKLIWJ (ORCPT ); Mon, 12 Nov 2018 03:22:09 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 512442241B; Sun, 11 Nov 2018 22:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975532; bh=p1N51I+b2pwvSgs9l6nTdRzlDSbt7KKc5BxWcejCO6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YrfrhnyMod8MW5pP9NPrv6CK+fkTbJ6pTDw17aDFe1ZEp33YJocdydf7g0h2YxpZx 1Xnz4+yMVu8owE9hZr15oDmkbRS0w1x/jw91Qg8YP2dmMleEfE1xcv2+UAoBkNJ0q/ 39EYXgkjdGdP3dJDujySuLd+AA/OVRT5jHwGCIHQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Serhey Popovych , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 043/222] tun: Consistently configure generic netdev params via rtnetlink Date: Sun, 11 Nov 2018 14:22:20 -0800 Message-Id: <20181111221652.021910790@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Serhey Popovych [ Upstream commit df52eab23d703142c766ac00bdb8db19d71238d0 ] Configuring generic network device parameters on tun will fail in presence of IFLA_INFO_KIND attribute in IFLA_LINKINFO nested attribute since tun_validate() always return failure. This can be visualized with following ip-link(8) command sequences: # ip link set dev tun0 group 100 # ip link set dev tun0 group 100 type tun RTNETLINK answers: Invalid argument with contrast to dummy and veth drivers: # ip link set dev dummy0 group 100 # ip link set dev dummy0 type dummy # ip link set dev veth0 group 100 # ip link set dev veth0 group 100 type veth Fix by returning zero in tun_validate() when @data is NULL that is always in case since rtnl_link_ops->maxtype is zero in tun driver. Fixes: f019a7a594d9 ("tun: Implement ip link del tunXXX") Signed-off-by: Serhey Popovych Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/tun.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1814,6 +1814,8 @@ static void tun_setup(struct net_device static int tun_validate(struct nlattr *tb[], struct nlattr *data[], struct netlink_ext_ack *extack) { + if (!data) + return 0; return -EINVAL; }