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=-5.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, USER_AGENT_MUTT autolearn=ham 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 949A2C10F12 for ; Wed, 17 Apr 2019 08:05:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59BBE206BA for ; Wed, 17 Apr 2019 08:05:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kbH4szPu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730316AbfDQIFX (ORCPT ); Wed, 17 Apr 2019 04:05:23 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36672 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbfDQIFW (ORCPT ); Wed, 17 Apr 2019 04:05:22 -0400 Received: by mail-pl1-f195.google.com with SMTP id ck15so11678618plb.3 for ; Wed, 17 Apr 2019 01:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7Ch/6Yq/+BV15ZMHjjrULwTeybG2QS8+OZqJNeMuXIM=; b=kbH4szPud2ocWv3t6xlfnJ39YKyHurZp65s+Kpo0xuivEPbn2Ia3jgorobyouFxQhP fcehR2S70MS1lSDk95GKs178/N1FtMMzhj2adFBoYpM8Xio0/4BVcO5YLYeQxR433S9c 5k88wikfBb9B3aSMHk1pyvGP6wIMGLBUjBY/c6wx2Lw6st8g83C0fehQNj7xy1CioN6u qAi5PRxqWwKGOR0NG6/ldnzF2PjzfoM0bPikoyLRPv+2F2FtkK9BiPj5y0WSt7+I/due otU+meP67jk9jhdnrHf4NjL4kl3FcDBjDNpBEsKYPS3waoUp/2c3S4cOrrLt3Hr6sruk AHAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7Ch/6Yq/+BV15ZMHjjrULwTeybG2QS8+OZqJNeMuXIM=; b=KQ0+8U7J59GQGaU/w3xGGSnPxTM4aqSga+Mcg0TMAQa9y9sSFH6VJFj3KbGssWGtM5 Y6Q1Vc4BMXt/02oPQMbi+GtOMe1+vvN69SkpOBZXCtJz0lNH4V6BBg9BY4UwrDKCsxcQ Bmtxe/Ya/zncmSvWVHviy7oZQW1M+7kOxcImjI6/MrE2jpml4qmj6Ey8FEnw8qhTTHzQ nOtgD2z3EJfXPam2vr3+8G5RoDqvGq1h9qT+fLQRW1hjzxSNinxTw/NsmUXnDb8dv9gI I+2H9rC2Ufl91TrN/xF4p0PwSMFOAmWGHfC6HKmHk72WBZK/3XAqWBgH2pg/5eaZsUg/ qj1A== X-Gm-Message-State: APjAAAU8LUT5p1QUugBOLazLCA4i5fq1p0WpvGSxvRqy0+JSWgJ7xNsE nEtdSAjOTFpl9OIWoAI0pjhkS6V7 X-Google-Smtp-Source: APXvYqzQYkB4eEPJQnxkUT4ghdJJREUd5cJddkMNXNvc56bDXt8AS/dekFuEMYdRYmL4PjyiUe0bLg== X-Received: by 2002:a17:902:8a81:: with SMTP id p1mr88354947plo.106.1555488321916; Wed, 17 Apr 2019 01:05:21 -0700 (PDT) Received: from dhcp-12-139.nay.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id w23sm74000793pgj.72.2019.04.17.01.05.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Apr 2019 01:05:21 -0700 (PDT) Date: Wed, 17 Apr 2019 16:05:09 +0800 From: Hangbin Liu To: netdev@vger.kernel.org Cc: David Miller , Richard Cochran , Miroslav Lichvar , Patrick McHardy , Jiri Benc , stefan.sorensen@spectralink.com Subject: Re: [PATCH net-next] macvlan: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to real device Message-ID: <20190417061452.GA18865@dhcp-12-139.nay.redhat.com> References: <20190320022333.3378-1-liuhangbin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190320022333.3378-1-liuhangbin@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Mar 20, 2019 at 10:23:33AM +0800, Hangbin Liu wrote: > Similiar to commit a6111d3c93d0 ("vlan: Pass SIOC[SG]HWTSTAMP ioctls to > real device") and commit 37dd9255b2f6 ("vlan: Pass ethtool get_ts_info > queries to real device."), add MACVlan HW ptp support. > > Signed-off-by: Hangbin Liu Hi all, For this patch. Jiri mentioned that running two ptp4l/phc2sys instances on two containers will not work. But I think the admin should avoid this scenario as we should not run two phc2sys instances on the same real device. In NET_ADMIN enabled containers, if a normal user which has mapped to root wants to run ptp4l, the admin need either add the device specifically (--device=/dev/ptp1) or give the container privileged permission (--privileged). So I think this should not be a security problem. On the other hand, Miroslav pointed that with NET_ADMIN enabled in container, a normal user could be mapped to root and is able to change the real devices's rx filter via ioctl on macvlan, which may affect the other ptp process on host. ptp over vlan also has this issue, but macvlan is more frequently used in container. To prevent this issue, here are some options: 1. limit ioctl SIOCSHWTSTAMP to only enabling timestamping and switching to more general filters. The limitation could be only in container and leave init_net free. 2. reject SIOCSHWTSTAMP in container. 3. revert the patch. The vlan part is too late to revert. So what do you think? which one do you prefer? Thanks Hangbin