Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2687329imj; Mon, 11 Feb 2019 07:02:54 -0800 (PST) X-Google-Smtp-Source: AHgI3IZHnJ+JTelQszSS5jYuXo48buxTTEPHb/1ihld3uKGjNDr3HJ61CUW8uFHbShVVkdrKJcw6 X-Received: by 2002:a63:a41:: with SMTP id z1mr28965618pgk.117.1549897374653; Mon, 11 Feb 2019 07:02:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897374; cv=none; d=google.com; s=arc-20160816; b=WUVorjPVE077OK+Ulg4dQc4l/vb/edmRy67rW+fB/GwWnK3ouu8v5MLpmug6gk9Txx 3ISyBXFlBSguCznL27SaXjq8nHY9wbc3jz8iyW3yrystJvN9Z8pFFVguN+696pg0T9To 4mGjx3yth5ndGWgYDFTS7NT80u4edTt3p/4CgS02u2kxwfXsJzUnOys+JB+o4/Psa4CA Ej32fRGatyjA/td5ASO/Rdra9qOFJOZ9lpq0gdfv7dwRA5nCXJFiIZTrD44q+DfkAEBy kdJy2eGSVALpQl69UDybXlvODF5eo62uGVOp+HAg46qJkJ0RjsORfYNDOCPyY17VllvE lB0A== 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=xqa0tjBygsO5BwOUjBGqE3CzqiwqnWFpeh5qaLZYk5I=; b=xn9+4KhrFGtAE86tvcuCYvVAoc+kbn967fdsl/hRPASSJO5hfX4Jeb2cSh/nWuALXS G3JBGcpCpcSjDGLePRXWhGeJiyjTOc+SZgfqBTCinhoB7od+nv6OBRFGGuCmcSPEPVSm NqN7Uc5YE21J4aPR87xHICpWNfdNW59dkd7scbySjkJD1sJZYa/ue0OhyMvVx3A5JLaB kmTIK/4QY+kuJW63JYTeDK7r95uQvYqfkMNoX3xT49OR7tddXdR4mZ6HkgjhJFLK3GT2 iLsTtuM5Uxix7g1Gfzh5zGcIyxHYb5iuQqhcrcIpsr9M/GfL7OQRY/rOsG+85envWAO7 9sRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OpLVBqbJ; 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 t23si10182004plr.128.2019.02.11.07.02.32; Mon, 11 Feb 2019 07:02:54 -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=OpLVBqbJ; 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 S2389929AbfBKPAF (ORCPT + 99 others); Mon, 11 Feb 2019 10:00:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:47934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727896AbfBKPAE (ORCPT ); Mon, 11 Feb 2019 10:00:04 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 B65E7206BA; Mon, 11 Feb 2019 15:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897203; bh=YIQxzfIiqJJ1fUqwrobmz865riNIHrSgSlvHB0ZKL0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OpLVBqbJaLKH9hzJNkLc1c6BULijZynuly7MUZWPmsRis7lW0Ndlu9Wz8V9LkVvS7 xnCf0S+2UhyW1XAYJ6e2IuN2vxbJdAGwj/lkIdx98SNcapZanNKT+yTcj8Tazi1qTz bHMAy6+a2wiu5QkZhfZpYl/qrkyZcnWzRVLpYjRY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Konstantin Khorenko , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.14 125/205] i40e: define proper net_device::neigh_priv_len Date: Mon, 11 Feb 2019 15:18:43 +0100 Message-Id: <20190211141836.657246083@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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. ------------------ [ Upstream commit 31389b53b3e0b535867af9090a5d19ec64768d55 ] Out of bound read reported by KASan. i40iw_net_event() reads unconditionally 16 bytes from neigh->primary_key while the memory allocated for "neighbour" struct is evaluated in neigh_alloc() as tbl->entry_size + dev->neigh_priv_len where "dev" is a net_device. But the driver does not setup dev->neigh_priv_len and we read beyond the neigh entry allocated memory, so the patch in the next mail fixes this. Signed-off-by: Konstantin Khorenko Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 904b42becd45..5d47a51e74eb 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -9772,6 +9772,9 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) ether_addr_copy(netdev->dev_addr, mac_addr); ether_addr_copy(netdev->perm_addr, mac_addr); + /* i40iw_net_event() reads 16 bytes from neigh->primary_key */ + netdev->neigh_priv_len = sizeof(u32) * 4; + netdev->priv_flags |= IFF_UNICAST_FLT; netdev->priv_flags |= IFF_SUPP_NOFCS; /* Setup netdev TC information */ -- 2.19.1