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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 8AD8AC10F0B for ; Thu, 18 Apr 2019 08:05:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 627A82183F for ; Thu, 18 Apr 2019 08:05:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388246AbfDRIFW (ORCPT ); Thu, 18 Apr 2019 04:05:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33104 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728074AbfDRIFV (ORCPT ); Thu, 18 Apr 2019 04:05:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC33381F12; Thu, 18 Apr 2019 08:05:20 +0000 (UTC) Received: from localhost (holly.tpb.lab.eng.brq.redhat.com [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 318D960BF7; Thu, 18 Apr 2019 08:05:19 +0000 (UTC) Date: Thu, 18 Apr 2019 10:05:09 +0200 From: Miroslav Lichvar To: Richard Cochran Cc: Jiri Benc , Hangbin Liu , netdev@vger.kernel.org, David Miller , Patrick McHardy , stefan.sorensen@spectralink.com Subject: Re: [PATCH net-next] macvlan: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to real device Message-ID: <20190418080509.GD5984@localhost> References: <20190320022333.3378-1-liuhangbin@gmail.com> <20190417061452.GA18865@dhcp-12-139.nay.redhat.com> <20190417154306.om6rjkxq4hikhsht@localhost> <20190417205958.6508bda2@redhat.com> <20190418033157.irs25halxnemh65y@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190418033157.irs25halxnemh65y@localhost> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 18 Apr 2019 08:05:21 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Apr 17, 2019 at 08:31:57PM -0700, Richard Cochran wrote: > On Wed, Apr 17, 2019 at 08:59:58PM +0200, Jiri Benc wrote: > > The problem here is this patch gives access to physical interface > > settings through a virtual interface layered on top of it. Whenever > > such thing is done, the virtual interface needs to provide a suitable > > way of moderating access to the shared resources, so the individual > > virtual interfaces do not affect each other. That's not what's being > > done here. > > So I guess the macvlan should reject SIOCSHWTSTAMP but allow > SIOCGHWTSTAMP. FWIW, my suggestion was to limit what the SIOCSHWTSTAMP ioctl can do on the virtual interface. It could only enable HW timestamping or select a more general filter. A container could run a PTP clock if it had also access to the PHC device, or it could have the NET_ADMIN capability for other reasons, but it couldn't disable HW timestamping enabled by the host or other container. If I understand it correctly, even without this ioctl a container can prevent the host or other containers from getting some of the HW timestamps by requesting TX timestamps at a high rate. I suspect the timestamping would need to be restricted to the real interface to fully protect it from applications having access to the virtual interfaces. -- Miroslav Lichvar