From patchwork Tue Jul 17 15:26:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Vuijk X-Patchwork-Id: 10529727 X-Patchwork-Delegate: stefan@osg.samsung.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 176C960247 for ; Tue, 17 Jul 2018 15:26:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF3D293C6 for ; Tue, 17 Jul 2018 15:26:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 027D3293CD; Tue, 17 Jul 2018 15:26:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 944EB293C6 for ; Tue, 17 Jul 2018 15:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729661AbeGQP7j (ORCPT ); Tue, 17 Jul 2018 11:59:39 -0400 Received: from mail-eopbgr70075.outbound.protection.outlook.com ([40.107.7.75]:14560 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729805AbeGQP7i (ORCPT ); Tue, 17 Jul 2018 11:59:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sownet.onmicrosoft.com; s=selector1-sownet-nl; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1E2BC9Ry0RShOqU/A15bPNZumA1hsNsoWtmRkaaQ6y8=; b=nK0nZss3l5g3iYviVLJIzFhEtiG1jg9pZ6NS0tYnkKhkQgdI0M9w0eiQMedqpJrizLdXA3Wiil71guPwaAsfci4BTQ/UKc3MtTFp8+uXSRKg13moExQZXxBD+xqy4WpmfE6vuQNbzzqHGR62Uciw/QoRWQeC8d3UmWyFwi5gFKM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=r.vuijk@sownet.nl; Received: from Rafael-Mac.intra.sownet.nl (2001:982:c549:1:61c3:7b2c:983:94af) by DB7PR10MB2315.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:4e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.18; Tue, 17 Jul 2018 15:26:24 +0000 Date: Tue, 17 Jul 2018 17:26:20 +0200 From: Rafael Vuijk To: Alexander Aring , Jukka Rissanen , linux-wpan@vger.kernel.org, linux-bluetooth@vger.kernel.org Subject: [PATCH 2/2 v2] ieee802154: assembly of 6LoWPAN fragments improvement Message-ID: <20180717152620.GB22664@Rafael-Mac.intra.sownet.nl> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [2001:982:c549:1:61c3:7b2c:983:94af] X-ClientProxiedBy: AM4PR0501CA0044.eurprd05.prod.outlook.com (2603:10a6:200:68::12) To DB7PR10MB2315.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9865f65b-6917-4c60-f143-08d5ebf9a897 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021125)(8989117)(5600053)(711020)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990107)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020); SRVR:DB7PR10MB2315; X-Microsoft-Exchange-Diagnostics: 1; DB7PR10MB2315; 3:wXRjGzWl7DZEp5gW0gWIbVqqO+zfhfmWdecjdlJxFfOkwgbEAodLTXy+m9ZO7qlCJ6aLwUgfZ+Al9sHABrk8vc/dX8FYo3Mastey5rUqBwvFe4FH7fd6A2MFrH+vcDOQLTQvacbCI7bEVd+Ac983SvyAVBkf8kUbkB647gfKAGSNFg0ehaKldSf0T0vHzK7GdlisMKVQmXGF0WLWOJWpj3Dv52Y7SRT/nzX0aKsLXtRCNKgROoBnxSsbUDZOg0DO; 25:bRhXwjSo9EAynjmP6NwBkBsrkWYloZRwEaUnDz7+9t6YG4aZK3njwY+dos+fn9PsESewGth4lB9NiRWbGHeVwKkSjocUkAVTGgMG+xoVx7NkrPsHDKnHB0iuhSYRzuHe2M+rghYkOdyu4h4h0gb/grZS7w1ua+xjQrRZslKi7SKP1I8UqReYFvwMe4oRoioutLOHXln/3chb69NZUheZfjYIdjHJtOsNoIFmBI9+KZWbZE8Ci/vwK7bU8M7RqLHGHq/QTqcDwcOA+/CZk4Lzh0QhBh8aPigNcLRYp7ZQykj4PM46qemQYRdsTkSpn3s5MuAUbQlCAGVS+KKa27MTpA==; 31:jwca/on/waYzx6q3GZ2SJc1EehcukrA15qIL8zrVEiIHw5YhIYDvHDlpAuSI8Al3YSDe/PFgYnqrqiqRVjPX5eL19pPBtQo73jsuKL2szlfmYXlvE/XMNiGIjuk4lkn/mDXx7OPz6jve66rLsRxh6/AXZfp2yS7Jo+QwR5aapVHcjlr+XpnZamvhCH9u+82ds6hoANDIi8fnebxb/jBkZt/63gM8lQzdrt5AQVAA3mk= X-MS-TrafficTypeDiagnostic: DB7PR10MB2315: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(2016111802025)(6043046)(6072148)(201708071742011)(7699016); SRVR:DB7PR10MB2315; BCL:0; PCL:0; RULEID:; SRVR:DB7PR10MB2315; X-Microsoft-Exchange-Diagnostics: 1; DB7PR10MB2315; 4:dgyv/SHW4Wr9jbXLzD/jwQny8+DJlDiJAlh9hAKRvJ1QnCvGOGAYurbeXatw/uqIQgTu2r53nzf/7MpsW3wLWagYSJKGOPxkwRqlZbXfMNHVK0mzRlnLuB9eoSPTrce8S7PTokKszzWqgaY1rxlBrTCW4bUbaNAOGWEArdLVLbkScYa8vIBfZfrYH7eNrg/xxJU1vM7fIKOSxkgtVzZogiBzO6Dyg8juTBxZMjG5ErmaTXgOTfQzN4JRViaXaSopZMohYg81T+2RiKPlXOXkCA== X-Forefront-PRVS: 073631BD3D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(39830400003)(136003)(346002)(189003)(199004)(39060400002)(6666003)(106356001)(105586002)(478600001)(5660300001)(2906002)(68736007)(47776003)(33656002)(53936002)(97736004)(25786009)(46003)(476003)(81166006)(52396003)(386003)(74482002)(8676002)(50466002)(52116002)(81156014)(16526019)(55016002)(186003)(110136005)(58126008)(16586007)(316002)(7736002)(23726003)(86362001)(486006)(305945005)(8936002)(7696005)(6116002)(1076002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR10MB2315; H:Rafael-Mac.intra.sownet.nl; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: sownet.nl does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB7PR10MB2315; 23:TvsCM/qfVrVSsw1rmiEQkQ3przPwmFacrUWCYPKTP?= =?us-ascii?Q?tFX2zcdmOPhN1ec3FXiA/VjbLImEj24S5jPXlZufmAJH+HoeGhbRmz8h1zgp?= =?us-ascii?Q?dcmp6c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JPWQntCwKFn7YwIMnp+ENm5bzA53RAh1kn+bqRZl4dxXg3JNL9efuXRG4j7S+ACGqGxQMZL8cwfSwCoF8vQ38bXWL3PBW+ulkC3RoSKxEwfflnWaqLe4+Vszp/+aRiw2ZAvAcyiIUMpfOtc2e8eLMB7SgeQahND9RDpYCsM=; 24:VAJBiKqOGslVVljsDa8cBi5+D9iB/GmgfmvmoDpBBsaaUKe7cCgs8Rwj6JvDKnw6sITyUE9Uoos//1VGsKfWFdQavNn+n4mC2QtFMuOzhFM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB7PR10MB2315; 7:PbuTOHk8hYS9ohYlxAj1DAs7EisNxlCMwHo1v+BsQHVWD/HtOHxEpb1eAm9ZLE1GGSrCMbE/Cw3mMevuQNjDZJgNrWU7slnRHL84SLe4IHoqxU/SQWMgjP109gly//LOCmx/LuMeFt/Ra9Hp87udZD30IfxuMnCaToK+GQzo/tpS2tt8OebxJ8mCQ5tujaitd+NB9GWrCMMQIdwY/GGS68lilOGcJwPDXSoSH/Xj77zZAU88H15gGd1P+L3vnqWX X-OriginatorOrg: sownet.nl X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2018 15:26:24.8519 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9865f65b-6917-4c60-f143-08d5ebf9a897 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b942e044-b452-4fc3-a156-54104fe5c4b6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR10MB2315 Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 6LoWPAN reassembly fragment overlap checks. Signed-off-by: Rafael Vuijk --- To unsubscribe from this list: send the line "unsubscribe linux-wpan" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- ./net/ieee802154/6lowpan/reassembly.c 2018-02-20 11:10:06.000000000 +0100 +++ ./net/ieee802154/6lowpan/reassembly.c 2018-02-21 09:13:29.000000000 +0100 @@ -179,6 +170,13 @@ static int lowpan_frag_queue(struct lowp } found: + /* Current fragment overlaps with previous fragment? */ + if (prev && (lowpan_802154_cb(prev)->d_offset << 3) + prev->len > offset) + goto err; + /* Current fragment overlaps with next fragment? */ + if (next && offset + skb->len > lowpan_802154_cb(next)->d_offset << 3) + goto err; + /* Insert this fragment in the chain of fragments. */ skb->next = next; if (!next)