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.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 354D0C10F14 for ; Tue, 23 Apr 2019 04:18:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBAA020B1F for ; Tue, 23 Apr 2019 04:18:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dXqG/6VL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727414AbfDWES3 (ORCPT ); Tue, 23 Apr 2019 00:18:29 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43246 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbfDWES3 (ORCPT ); Tue, 23 Apr 2019 00:18:29 -0400 Received: by mail-pl1-f193.google.com with SMTP id n8so6812971plp.10 for ; Mon, 22 Apr 2019 21:18:28 -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=X12fmZ5dqLLSsvVr75gqJZArAZ2GrdvXk8ev9kaCXJg=; b=dXqG/6VLIxKaSK/k95ZIBSSQVV4w7B7ZoagWOPdwQeMQeuKVc9oZFJNHbq1nzDjI9+ QoOBb4UpKAyYcqSy4zKRt/YUSpc+RUw5kL2eCBDcZZdZGtFCNS9NrZ69yV/6HX39Rg7Z i/5X2ES274RSJcwXGQK4FBP1s13khcvq2EJXzF5ud38NYGOwSQeDsmnT4jgjbVIDrzdE 4UDQxmHAYhq0CPzkOJkf+SY3lEEE+iM3B4o3Uxakglh7kzZdHTe2nTY+SMPaQxHFy4ho QWjY3VE6BveE0KbtxY37CELQ0vepUISUPAXTe72llhgZN5WPynakpHk1UlJ/IZSKugOT WV/Q== 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=X12fmZ5dqLLSsvVr75gqJZArAZ2GrdvXk8ev9kaCXJg=; b=JdgVG5XRVGtucC6LbTfeKFfkRuI89nT4GIowI+IZF3ZqqW0ZdgVDKVcLnE72hcVJXs Ii823AdDUUbdFPVp0qPPLKtqbk+KQjVGzWlYW6bforDpjb2clrgzSCaFry5xsK4fLxZf 1A5RtRLcVhkiG1ukEKOGWLgjhTT0R9o3Oemj7A+rn8Hz0RvVP4CM1yMspbJzr3Wfw476 R+sGRDj7T0tMiQ4yLpuC1S8nI8vAtI8zf1Zb3tfB53I/t6McaiEgQQ4ZsqArH/8jAtnu 2hJO8Mc5+PWCeakHX1O+MPevX0AQBRV5IpaIZA/sdp9q7Ooy7Hl+ws/XwLIbhDg7ZjwG ZNqQ== X-Gm-Message-State: APjAAAWtHVqhubbDcTI9OrqD3rnI+VwJv1sNNIQ8m2lbTal450xl3PIr +19gIE/BE1mAUTO+tfWJ6zI= X-Google-Smtp-Source: APXvYqwMff31K5Fp8AMCy1twpXprC4PZ3nyOMK/oJeqSo8pqn3hdOQaK29PUP0FeYPQ6yW/YJiWqtw== X-Received: by 2002:a17:902:7885:: with SMTP id q5mr24077619pll.12.1555993108433; Mon, 22 Apr 2019 21:18:28 -0700 (PDT) Received: from dhcp-12-139.nay.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id 66sm22491134pfr.44.2019.04.22.21.18.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Apr 2019 21:18:27 -0700 (PDT) Date: Tue, 23 Apr 2019 12:18:17 +0800 From: Hangbin Liu To: Miroslav Lichvar Cc: Richard Cochran , Jiri Benc , 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: <20190423041817.GE18865@dhcp-12-139.nay.redhat.com> 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> <20190418080509.GD5984@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190418080509.GD5984@localhost> 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 Hi Miroslav, On Thu, Apr 18, 2019 at 10:05:09AM +0200, Miroslav Lichvar wrote: > > 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 I think this is not enough as user could enable HWTSTAMP_FILTER_NONE. > select a more general filter. A container could run a PTP clock if it Do you have an idea about how to select a general filter? If we have enabled HWTSTAMP_FILTER_PTP_V2_L4_SYNC on host and a user in container want to enable HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ, then which one is more general? > 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 Could traffic sharping/limitation fix it? > timestamping would need to be restricted to the real interface to > fully protect it from applications having access to the virtual > interfaces. Thanks Hangbin