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=-4.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no 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 76662C4CEC6 for ; Sun, 15 Sep 2019 06:48:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A3BD20830 for ; Sun, 15 Sep 2019 06:48:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="hnYIyqYf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726890AbfIOGs2 (ORCPT ); Sun, 15 Sep 2019 02:48:28 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:53003 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbfIOGs1 (ORCPT ); Sun, 15 Sep 2019 02:48:27 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 96EA6214CE; Sun, 15 Sep 2019 02:48:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 15 Sep 2019 02:48:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=PyFjIh2IIbLO8u6I/ MQ8+eSUic8PpGKxnYzWgduQg7U=; b=hnYIyqYfe2QfGuFqwPlnmFaOZW9eQBuVt rFrZ9QPpadWlLUzNLcedmA4wKoqPhSRFrjhaR35DbcQ/OBwegEahw2cTiR2IHvlL 21B3qfcGfAGdxRHCxAoHMOmJmzzrjmB4J/jJ+lKGpsEV0jugLZvvIpAI4xQxbPBL o45sLha+khAFBkHbB+Bt7gbOz/xD00syhGLVhVFylVDRp2EPJw7jcZpJAXJfjV0y IjksMa6dFEQc+o5BqYGmpVgxxU9fZ/wwHT334md6BJUjU7RaXs2QWq4sQgszSt7f pYqxbZTMnPqnYbWTrrr2FeOJgfMGr/9fYKWl9pAFtfvp2fMNL/6SQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtgdduudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiughoshgt hhdrohhrgheqnecukfhppeduleefrdegjedrudeihedrvdehudenucfrrghrrghmpehmrg hilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrghenucevlhhushhtvghrufhi iigvpedt X-ME-Proxy: Received: from splinter.mtl.com (unknown [193.47.165.251]) by mail.messagingengine.com (Postfix) with ESMTPA id 0F50680060; Sun, 15 Sep 2019 02:48:22 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, jiri@mellanox.com, nhorman@tuxdriver.com, jakub.kicinski@netronome.com, mlxsw@mellanox.com, Ido Schimmel Subject: [PATCH net-next 0/2] drop_monitor: Better sanitize notified packets Date: Sun, 15 Sep 2019 09:46:34 +0300 Message-Id: <20190915064636.6884-1-idosch@idosch.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel When working in 'packet' mode, drop monitor generates a notification with a potentially truncated payload of the dropped packet. The payload is copied from the MAC header, but I forgot to check that the MAC header was set, so do it now. Patch #1 sets the offsets to the various protocol layers in netdevsim, so that it will continue to work after the MAC header check is added to drop monitor in patch #2. Ido Schimmel (2): netdevsim: Set offsets to various protocol layers drop_monitor: Better sanitize notified packets drivers/net/netdevsim/dev.c | 3 +++ net/core/drop_monitor.c | 6 ++++++ 2 files changed, 9 insertions(+) -- 2.21.0