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=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 DC2F0C432C2 for ; Wed, 25 Sep 2019 23:33:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A924C20673 for ; Wed, 25 Sep 2019 23:33:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731739AbfIYXdY (ORCPT ); Wed, 25 Sep 2019 19:33:24 -0400 Received: from mga12.intel.com ([192.55.52.136]:32056 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728763AbfIYXdY (ORCPT ); Wed, 25 Sep 2019 19:33:24 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 16:33:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,549,1559545200"; d="scan'208";a="201419350" Received: from jekeller-desk.amr.corp.intel.com ([10.166.244.172]) by orsmga002.jf.intel.com with ESMTP; 25 Sep 2019 16:33:23 -0700 From: Jacob Keller To: netdev@vger.kernel.org Cc: Intel Wired LAN , Jeffrey Kirsher , Jacob Keller , Richard Cochran , Felipe Balbi , "David S . Miller" , Christopher Hall Subject: [net-next 0/2] new PTP ioctl fixes Date: Wed, 25 Sep 2019 16:33:10 -0700 Message-Id: <20190925233312.13977-1-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.23.0.245.gf157bbb9169d 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 I noticed recently that Filip added new versions of the PTP ioctls which correctly honor the reserved fields (making it so that we can safely extend them in the future). Unfortunately, this breaks the old ioctls for a couple of reasons. First, the flags for the old ioctls get cleared. This means that the external timestamp request can never be enabled. Further, it means future new flags will *not* be cleared, and thus old ioctl will potentially send non-zero data and be mis-interpreted. Additionally, new flags are not protected against in-driver, because no current driver verifies that the flags are only one of the supported ones. This means new flags will be mis-interpreted by the drivers. This series provides patches to fix drivers to verify and reject unsupported flags, as well as to fix the ioctls to clear flags on the old version of the ioctl properly. Cc: Richard Cochran Cc: Felipe Balbi Cc: David S. Miller Cc: Christopher Hall Jacob Keller (2): ptp: correctly disable flags on old ioctls net: reject ptp requests with unsupported flags drivers/net/dsa/mv88e6xxx/ptp.c | 5 +++++ drivers/net/ethernet/broadcom/tg3.c | 4 ++++ drivers/net/ethernet/intel/igb/igb_ptp.c | 8 +++++++ .../ethernet/mellanox/mlx5/core/lib/clock.c | 10 +++++++++ drivers/net/ethernet/microchip/lan743x_ptp.c | 4 ++++ drivers/net/ethernet/renesas/ravb_ptp.c | 9 ++++++++ .../net/ethernet/stmicro/stmmac/stmmac_ptp.c | 4 ++++ drivers/net/phy/dp83640.c | 8 +++++++ drivers/ptp/ptp_chardev.c | 4 ++-- include/uapi/linux/ptp_clock.h | 22 +++++++++++++++++++ 10 files changed, 76 insertions(+), 2 deletions(-) -- 2.23.0.245.gf157bbb9169d