Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2930871imm; Thu, 24 May 2018 19:17:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr6GABXYTG94hzCKwp8wK/fPLjn7LthsdwlxWkt4eiMsYz9pdudnpFogr0Njq6qvQXn4BtM X-Received: by 2002:a17:902:7d94:: with SMTP id a20-v6mr539239plm.123.1527214648166; Thu, 24 May 2018 19:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527214648; cv=none; d=google.com; s=arc-20160816; b=qL+B3IJRO8W0i9V/vYqdRzxjN4yLRrE5nL1iUPYx7o9Ks+O4PKQU0MrHdUhtq8QSa1 CUvWkiaNs9hhbgB2/VuzhnoM6ed5iP/1MAd5sQ9rOOTp07/lk3sqweN+cOOajtZK6Keu 6E+YoVaSp3YeJ8KPXbuvL97ZfbAxc+vA9/vrqgWfsNq61EVSHJr7DDLgpsP2ldfImJNC ICTeStwIW4aC8I8RRjw4/qRyvff+stWZinprXLTJb1eYRNK2SXeUxApAZVq/HtMfSCtH v72W9lUIPTw0x6f6Hvd3KZZ8GmFvkZdN/JmU/R9p/wGutCD+W3FP5vZLjwJvMFRVKxwU 2NLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=OhY1TPmZX5gXTK28yW/sZUFV6YO4mS/MxOjorfSGfO4=; b=Sxfurz8i9KwdQOnPf6aIpPzTTjRX1WXwWgMD3ujmPsFdWl4DWCaxxZhT09lYB1xyDC gO0znbb0JwjkXN42vym1AmMrVkhGwX/8EDTUMOkdefA/P6nA789gJfr/CpB0PSkvvtNV odJtnmhhFDTGq6jOErVCmuOyE3qQfDdZSf8fL8EAPiWdkiWYQl4J9spvBRcLhSEjBqHC NsI0w2g694JCuH9vjrAGsOPd3v/oFxZpyvXujIgJWCg7NPDsvu5LxUI6nS8Zttke3Wq4 oNTGWM60GxHG6w82RPFViZhj71GmU1V8pty3FnCHjB+yyXAweZbjStP5AhK5+OwnQg2c 8qqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=Ct9DK9Si; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a185-v6si17560131pgc.586.2018.05.24.19.17.13; Thu, 24 May 2018 19:17:28 -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; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=Ct9DK9Si; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965802AbeEXOxf (ORCPT + 99 others); Thu, 24 May 2018 10:53:35 -0400 Received: from mail-db5eur01on0047.outbound.protection.outlook.com ([104.47.2.47]:26303 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965332AbeEXOx0 (ORCPT ); Thu, 24 May 2018 10:53:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OhY1TPmZX5gXTK28yW/sZUFV6YO4mS/MxOjorfSGfO4=; b=Ct9DK9SiS17j3yUkkhJqQB8tWhYSEBIVt+c8k9OjHKZ0f3JTZ5IKW4kR9+83tnoB3pHS8wyErUfYz81Uu92b5kNaAEdqF686GUhWYptYto9s4k8an/xQmpvYn801sTG3x6CsQjb2EvTJmHRqNnKYwFcXKaxRrF1BFWph0K+pPdQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=tariqt@mellanox.com; Received: from [10.8.18.17] (193.47.165.251) by HE1PR05MB3257.eurprd05.prod.outlook.com (2603:10a6:7:35::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.16; Thu, 24 May 2018 14:53:22 +0000 Subject: Re: [PATCH 4.16 008/161] packet: in packet_snd start writing at link layer allocation To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, syzbot+71d74a5406d02057d559@syzkaller.appspotmail.com, Willem de Bruijn , "David S. Miller" References: <20180524093018.331893860@linuxfoundation.org> <20180524093019.375532134@linuxfoundation.org> From: Tariq Toukan Message-ID: Date: Thu, 24 May 2018 17:53:15 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180524093019.375532134@linuxfoundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: LO2P265CA0221.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::17) To HE1PR05MB3257.eurprd05.prod.outlook.com (2603:10a6:7:35::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:HE1PR05MB3257; X-Microsoft-Exchange-Diagnost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DXGZaoMoExI1VQ47/73ziROCO5tJwcG57iRzd8by1YMT7LbS4xeHo/MOOyld87kLVP7Tp+ppfFTnvbV+PH29IfFAi6YWUnIHaA2DybLjh99uvShK8PeLidVoXWs3kxdIZ9QSxJJLag7Li+oC3avy5tJ7qGp3+gnwgzSOZJ2Sa2ThdOPNNk++BAO3foEaE9JtZyM3yJlO1dpfBBhCfFDYENdweYyGp7YmEtWOIz/9V8RxSudEay7FRfvZfRCnxNsecIPQjW4kn4hwjNfCxUy3MUuzruc4kPqTsiAfofKqNdifArY4fnEAMgP0hpVS0QJSgQP8h2vkxa89PhQ4oNhYf7UBXUMCNgU6OucHPB2FeVxI/4H19amz;4:AYk6nt8+I/xvFgcJzepFXAZMbjyKvm2sYFHma5isWRBuHNdquSmFglbaDg8s1G7DULtFOTGqBTajcuYXTcrp+7eJDIZqXh2dHxnuvFVkD5uGYxt0UZH7oZQKM6SrFIGXeE27SgvcCT2iq9PbdIfp0a9YM5tJfnkAcF6PHqpcAWgNCg5JWdfzIPwL6bO4JrTV8CxsY3yD5uUOEMdzRM6hpYlZKH3TpYKDZ6cCysmCuL6dNq0SvcaT5Suw1TwTO4haOVAqc/5AuXM62p+M135XuJRGkOBQFGm78K97+6Z1WTXJuvd1VSr2VNj5cGR7dxTZFS8eXP0MvYZQ6Ev3JNvd2PGUMA7kZLlAC0xAP2bRRYs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211936372134217)(153496737603132); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:HE1PR05MB3257;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB3257; X-Forefront-PRVS: 0682FC00E8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(396003)(39380400002)(39860400002)(366004)(376002)(346002)(199004)(189003)(229853002)(106356001)(486006)(64126003)(8676002)(4326008)(956004)(11346002)(54906003)(305945005)(6486002)(25786009)(7736002)(476003)(36756003)(6116002)(6666003)(2616005)(58126008)(97736004)(53936002)(47776003)(6246003)(446003)(81166006)(81156014)(316002)(8936002)(16576012)(77096007)(230700001)(65956001)(65806001)(66066001)(50466002)(5660300001)(23676004)(2906002)(68736007)(52146003)(26005)(478600001)(67846002)(53546011)(16526019)(186003)(386003)(31686004)(76176011)(3846002)(86362001)(105586002)(59450400001)(65826007)(31696002)(52116002)(2486003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB3257;H:[10.8.18.17];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:3; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA1TUIzMjU3OzIzOnFwdWY4aytPZGhoRExORjZ2cUtQcXU1Z0xG?= =?utf-8?B?UElvRGZhZXBmSWN5NkwrR0lrOU5ON3R6MkFWNlRDYnhzdFA2YTB3eEI1ZEx5?= =?utf-8?B?NHdkTjBHSnZmU3gxa2c5cVBSNXliSjZrNWNhL3hhN0tOR2hWVlFMSDhraGxw?= =?utf-8?B?RWFkNk9TNWk3QW0xMWFMdUQwSXllbjMyamxJOUpjL292eFVMdjdGWUZYZDFN?= =?utf-8?B?RkJGY0VPenBYTHFVT2NXVlZoMEtzRlNJSUpCdkFLYXRSMmtqUVVTcWRSZith?= =?utf-8?B?MjQ1Z3ZTUDBSUmkrZE85QkdTRHFHaEFVbnl4ZlhnVDRWUVFvc21GcEhoNkg0?= =?utf-8?B?TmxjdUE0Rm9FN2FDNmt4eXV3N3F4S1l1ZWdpWkNVQSsySEdyeHEzakJWRU4x?= =?utf-8?B?a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S6yzZhLqn94cjlwa7QkGFNHhKSYz6smhxpalz5RYpbL7XR62rJ X-MS-Office365-Filtering-Correlation-Id: ffa02bc6-1f3c-4bef-e5f8-08d5c18618de X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2018 14:53:22.1707 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ffa02bc6-1f3c-4bef-e5f8-08d5c18618de X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3257 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/05/2018 12:37 PM, Greg Kroah-Hartman wrote: > 4.16-stable review patch. If anyone has any objections, please let me know. > Please hold on with this. I think it causes some degradation. I'll report the issue on the original patch. Thanks, Tariq > ------------------ > > From: Willem de Bruijn > > [ Upstream commit b84bbaf7a6c8cca24f8acf25a2c8e46913a947ba ] > > Packet sockets allow construction of packets shorter than > dev->hard_header_len to accommodate protocols with variable length > link layer headers. These packets are padded to dev->hard_header_len, > because some device drivers interpret that as a minimum packet size. > > packet_snd reserves dev->hard_header_len bytes on allocation. > SOCK_DGRAM sockets call skb_push in dev_hard_header() to ensure that > link layer headers are stored in the reserved range. SOCK_RAW sockets > do the same in tpacket_snd, but not in packet_snd. > > Syzbot was able to send a zero byte packet to a device with massive > 116B link layer header, causing padding to cross over into skb_shinfo. > Fix this by writing from the start of the llheader reserved range also > in the case of packet_snd/SOCK_RAW. > > Update skb_set_network_header to the new offset. This also corrects > it for SOCK_DGRAM, where it incorrectly double counted reserve due to > the skb_push in dev_hard_header. > > Fixes: 9ed988cd5915 ("packet: validate variable length ll headers") > Reported-by: syzbot+71d74a5406d02057d559@syzkaller.appspotmail.com > Signed-off-by: Willem de Bruijn > Signed-off-by: David S. Miller > Signed-off-by: Greg Kroah-Hartman > --- > net/packet/af_packet.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > --- a/net/packet/af_packet.c > +++ b/net/packet/af_packet.c > @@ -2903,13 +2903,15 @@ static int packet_snd(struct socket *soc > if (skb == NULL) > goto out_unlock; > > - skb_set_network_header(skb, reserve); > + skb_reset_network_header(skb); > > err = -EINVAL; > if (sock->type == SOCK_DGRAM) { > offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len); > if (unlikely(offset < 0)) > goto out_free; > + } else if (reserve) { > + skb_push(skb, reserve); > } > > /* Returns -EFAULT on error */ > >