From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2AF3C43387 for ; Mon, 7 Jan 2019 13:24:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 786F12183E for ; Mon, 7 Jan 2019 13:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546867472; bh=dWuV6VvnvQHQjezLx5scxKZa6QqAgNfI4f9Fb6xUUxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Ne/C8palG7FsyMDIdKGo6j9HnpXe+xPecC75M9Au9yxVI/NTqYC/QokjnpnltFJ8+ 4wCeqY/C0jMEFjm5ODOv/wrgnIue7lEeVxgAz2/byErnxIhRhBoIraa5dMvYT/DarT xP+RzhiXzTInX3btpKb39dHvR/5E8sjgaNdQsF4w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726947AbfAGMeO (ORCPT ); Mon, 7 Jan 2019 07:34:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:46190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727138AbfAGMeN (ORCPT ); Mon, 7 Jan 2019 07:34:13 -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 B368D21736; Mon, 7 Jan 2019 12:34:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546864453; bh=dWuV6VvnvQHQjezLx5scxKZa6QqAgNfI4f9Fb6xUUxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KleAFnG5OPq97jQA+zGaBwdoAD/4CbinLURg50ZpESWz5vbU4ug8CtjdCIjPXgSrV VIisFf6WFIY7RzjV48ytIUGCW6xIF9E0yG/JzRFApvRqT5wlerxtm3rdS397fjs45p cECWWKpvWb5Lcibo3s/ahDymR5E2wh9/QmnJoMSU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Willem de Bruijn , Alexander Aring , "David S. Miller" Subject: [PATCH 4.20 008/145] ieee802154: lowpan_header_create check must check daddr Date: Mon, 7 Jan 2019 13:30:45 +0100 Message-Id: <20190107104438.392865197@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104437.308206189@linuxfoundation.org> References: <20190107104437.308206189@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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Willem de Bruijn [ Upstream commit 40c3ff6d5e0809505a067dd423c110c5658c478c ] Packet sockets may call dev_header_parse with NULL daddr. Make lowpan_header_ops.create fail. Fixes: 87a93e4eceb4 ("ieee802154: change needed headroom/tailroom") Signed-off-by: Willem de Bruijn Acked-by: Alexander Aring Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ieee802154/6lowpan/tx.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/ieee802154/6lowpan/tx.c +++ b/net/ieee802154/6lowpan/tx.c @@ -48,6 +48,9 @@ int lowpan_header_create(struct sk_buff const struct ipv6hdr *hdr = ipv6_hdr(skb); struct neighbour *n; + if (!daddr) + return -EINVAL; + /* TODO: * if this package isn't ipv6 one, where should it be routed? */