Received: by 10.192.165.148 with SMTP id m20csp778454imm; Fri, 27 Apr 2018 07:23:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqhAveDyJLQ1QVPWt1Oyz/XdvjM/Wf1lH+Zyc3H0uHGa7B5nFQ/IKdOltaLGoQrOQfqA7Mj X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr2478730plb.226.1524838997666; Fri, 27 Apr 2018 07:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524838997; cv=none; d=google.com; s=arc-20160816; b=yBktaDWwZksIYVIssVEeSVjnSAhRKYJuXdPDHLYXHFW8NSceTbyLufSxVyc33GpsCP NUk2LEsOUCNm/K4qJ611XUr7bLXqgNoXmAab7rb5qReNltaDLyt94hEBThscZYmPWJVW rrswwD9+WsjSFg3w1/3WgJMPl5fUXpO4kZ5Yrez3D4UAIRIj/z6Nb5G3FNQx9FLt+b8n QYj6KzZQO5PjIo1vjdEjZ1nCWhIptk6Y92t27ZBuGsAU2yYPjwdEhemKy425uO3KXMNG 3202vHIxWqESGzCOaH/urHnckSIcuwziJtoY/wU7bijQ5XlzFjNHSBLA3X6QCeNi9uEG uNcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=QXcID8nxE4WiOrmCgpdOn8zwaSlxe3LpIdjSH/eK0+U=; b=nW3vhtqvliCp77vAwYWb0iQQ/O1DGNHk2YZvoYO4KGZzE5ym5p6owEH5gY6ujSRX9o Rdl/uwap8HPFtWmBwWtfJgJU2JJQMpgEQTtGCbYVoOfoTWTBS9LbFqj26kgKRPDrgz8E XKR77foP6BS3XKV0t4xq8RlrKPcFVehSvB4+c0FM4wGkP2zlnqPToUj9N6TcekqZxPX9 kzE1hOTJmyXJ4q9F0xG+zGdM6+s+fpMSV6YVGHKa9DaNMYqu+2us6yfy7ks5JIqMADTQ b0qbkWKlgEJlaDAat5XTlqcl1IOH1Ch8cdUr1JCaEmxN5zA3iZl2Xupc9+iKjsy8+reC Nbqw== ARC-Authentication-Results: i=1; mx.google.com; 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 s16-v6si1312842plp.487.2018.04.27.07.23.03; Fri, 27 Apr 2018 07:23:17 -0700 (PDT) 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; 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 S934805AbeD0OMf (ORCPT + 99 others); Fri, 27 Apr 2018 10:12:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:57062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935200AbeD0OMc (ORCPT ); Fri, 27 Apr 2018 10:12:32 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 550B321897; Fri, 27 Apr 2018 14:12:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 550B321897 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Aring , Yotam Gigi , Jamal Hadi Salim , "David S. Miller" Subject: [PATCH 4.16 40/81] net: sched: ife: check on metadata length Date: Fri, 27 Apr 2018 15:58:42 +0200 Message-Id: <20180427135745.421240664@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135743.216853156@linuxfoundation.org> References: <20180427135743.216853156@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexander Aring [ Upstream commit d57493d6d1be26c8ac8516a4463bfe24956978eb ] This patch checks if sk buffer is available to dererence ife header. If not then NULL will returned to signal an malformed ife packet. This avoids to crashing the kernel from outside. Signed-off-by: Alexander Aring Reviewed-by: Yotam Gigi Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ife/ife.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/ife/ife.c +++ b/net/ife/ife.c @@ -69,6 +69,9 @@ void *ife_decode(struct sk_buff *skb, u1 int total_pull; u16 ifehdrln; + if (!pskb_may_pull(skb, skb->dev->hard_header_len + IFE_METAHDRLEN)) + return NULL; + ifehdr = (struct ifeheadr *) (skb->data + skb->dev->hard_header_len); ifehdrln = ntohs(ifehdr->metalen); total_pull = skb->dev->hard_header_len + ifehdrln;