Received: by 10.192.165.148 with SMTP id m20csp806860imm; Fri, 27 Apr 2018 07:50:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr/ATzIBGyHdFBJWZg91qViHQoG+PMG846WWHzhZQc9S2nYLlXIRvtUDn4v4P6ZnJ7T7dqH X-Received: by 2002:a17:902:bc08:: with SMTP id n8-v6mr2524395pls.97.1524840614019; Fri, 27 Apr 2018 07:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524840613; cv=none; d=google.com; s=arc-20160816; b=DWUry1dp+YpoWyEBzxpZiW7acuGBskW8o4AHUcpRLDLtT9rQ1fbZ+Ih0xCth5Bh3lH kqSwrpeBz/+RoqjaUsi8T60PBgUFzMs9RQxZPFKnXr96R5ZOHEt6HhoaGa/aBS/FBRDE DIpBtMJLsKY0NHULeC4kr+vnMX+gIhoeckdkRGhvGvwHKa9H81LPPFKdrbqKflbeGtVF V2FgVLky2B7T2K/mx7Hq/9aW5QEYFbrV+Ei+ZXpYDutIErlJr5AEZjW0yJ0lqIqdykdf EVOnGfozG7ea0NLHuZG2Mf2ucvc5um78uEDdf62keQyab3/aeMDA10z+RRAwUTtIr4tA Ls3w== 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=dHk0sLviJKJ0961ZpxQeGwsGquCY31AN+z4ACt3y+js=; b=qjSxVfT9n8fACuGCQfdRZMRG3Kwz4CaZpzwbETAhqE8CRL5nqTJ69j1gSF8Q7s1c6A aOrSV3XR4/IebjRkmnbSBXa+x/DMbV3A7P7MGd6/x/KhskCbmwVv4t9oIr18Alnsg31x oGs3a2yf/LwLub9Fzk0jfnYAEDLq3wE32MXYFx0p5t0uqS+/9i19dk5+d/qzwUdZJ2B4 2lW4Tn6/kJL99AVzRwetzMUwktIIzesUJcZB+i7/LJQjWDYtU+qtqHjHUiTHyKI90RNK v6pxtZg+K4ei3rLULJx5cnboTSPMDaStDwxSs53AdY6ixZHfUskDYH++/vqPDIlZIElK prNw== 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 1-v6si1367429plw.519.2018.04.27.07.49.59; Fri, 27 Apr 2018 07:50:13 -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 S934323AbeD0OHf (ORCPT + 99 others); Fri, 27 Apr 2018 10:07:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:53336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934306AbeD0OHb (ORCPT ); Fri, 27 Apr 2018 10:07:31 -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 7AA18218C5; Fri, 27 Apr 2018 14:07:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AA18218C5 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.14 35/80] net: sched: ife: check on metadata length Date: Fri, 27 Apr 2018 15:58:28 +0200 Message-Id: <20180427135734.747464797@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135732.928644313@linuxfoundation.org> References: <20180427135732.928644313@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.14-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;