Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3490221imu; Sun, 11 Nov 2018 16:16:39 -0800 (PST) X-Google-Smtp-Source: AJdET5cNbIH79rLX3f1JLinaGHy+te2RUr6BHHzgzppLoCjovT51Opkc4M08+fZ/gdQPirxl95QR X-Received: by 2002:a62:3707:: with SMTP id e7-v6mr17983034pfa.70.1541981799092; Sun, 11 Nov 2018 16:16:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981799; cv=none; d=google.com; s=arc-20160816; b=vOwUSjiPmWw3/s1hQ5rOs24NGCxfYyss8JiidmVRDVHNED1+dK48VvVJg+5mTX7A7l SDntvqQ2kG/6jSPFYLuaw/WGBfFVXKEoVfqzJm5vdCKdmMJ0surLnuA1XjU4OqXYBdPu g0ivzlX99RY4Cg/Ki9MeveY6RLAx1JIiSnumQ2sBKVxaTyj9SRSYsFO0pZlttGhBjMxk bGx++ks6vqDC1msmEVH/E3lH2gQ30iUF0zVaRILilnsFPGZ9FxzUKb6SGmHSaG9XC8Sz 05xqi5C3/1m89qc0sbU79EmObd9Q2m0nig8fDP7VuOlv0C6fP1WX5U2F6a/XPSFN9cAL H7Lg== 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=MKd7Wx0oZ5lxEmfqx8ciFIZj5FL3nBMA9qY/UoI7vyk=; b=gZFjIuwMw3PrTp7dNI2tbn1Fyldg0agHT/g9V6PtbGlP+EdE4wrOfE+CVrI09lD14w /VtPJuKhHab6NUF/w33khFnYkqx+6BKPUY9qjZsjBHI0ISJgDEmo+MbJsA4TlckKzUkm wogMoek+xW+CWq6YEICnS5bIZX/PhS2TF3pl8sc8v5RU/ch/sP8xciHYiSjbJbI3EGt9 2Df9t3nMxu6He3wyRpldefECH52xHwAdOwS2m1Yo+3MhwamxptOWJBaT04VGZ7vqlJS2 /sw9Mhl3OSj0k0NWCVVl4oGNVfPpM59YljTY+upMBAKZOk/hfRzy+AbzROQ2uQGK3D7x we0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p3lBC7ZQ; 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 3si14520388pgf.124.2018.11.11.16.16.23; Sun, 11 Nov 2018 16:16:39 -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=p3lBC7ZQ; 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 S1730247AbeKLIRJ (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:59712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730098AbeKLIRH (ORCPT ); Mon, 12 Nov 2018 03:17:07 -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 C22E021508; Sun, 11 Nov 2018 22:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975231; bh=ZiV4IyzzicTJDfkcJPKT7UJaozsfgGXF+iauTypusYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p3lBC7ZQtQKw/YZEF4zayfIzCxZy63w5iy4e/nW+d8TopAJG9Fx20DefSGFMke1gA qVplIVbM30LZSwfSqNq4p4Kx+Otro9r2DESzBBzxcC7a6UM2i5rH0MU9qj7ZrV2a8K gBuBeFvhw5gvibdSodGwf0oeaoR4VcZpI4Wyf22o= 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.19 057/361] tun: Consistently configure generic netdev params via rtnetlink Date: Sun, 11 Nov 2018 14:16:44 -0800 Message-Id: <20181111221627.995756065@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@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.19-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 @@ -2264,6 +2264,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; }