From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752726AbcHHTKW (ORCPT ); Mon, 8 Aug 2016 15:10:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35553 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752619AbcHHTKS (ORCPT ); Mon, 8 Aug 2016 15:10:18 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, ajneu , Oliver Hartkopp , Marc Kleine-Budde Subject: [PATCH 3.14 17/21] can: fix handling of unmodifiable configuration options fix Date: Mon, 8 Aug 2016 21:09:48 +0200 Message-Id: <20160808180144.651289013@linuxfoundation.org> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160808180143.919366850@linuxfoundation.org> References: <20160808180143.919366850@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Oliver Hartkopp commit bce271f255dae8335dc4d2ee2c4531e09cc67f5a upstream. With upstream commit bb208f144cf3f59 (can: fix handling of unmodifiable configuration options) a new can_validate() function was introduced. When invoking 'ip link set can0 type can' without any configuration data can_validate() tries to validate the content without taking into account that there's totally no content. This patch adds a check for missing content. Reported-by: ajneu Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/dev.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -665,6 +665,9 @@ static int can_changelink(struct net_dev } } + if (!data) + return 0; + if (data[IFLA_CAN_CTRLMODE]) { struct can_ctrlmode *cm;