Received: by 10.213.65.68 with SMTP id h4csp584083imn; Tue, 20 Mar 2018 10:10:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELtTgPA2fwjSNplSBnlNVh0RnYtqY27naLu/w5As/+NTlWVOxMLidqfNkcfMxFbp0l+S1VKU X-Received: by 10.99.188.9 with SMTP id q9mr9724208pge.381.1521565811448; Tue, 20 Mar 2018 10:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521565811; cv=none; d=google.com; s=arc-20160816; b=N6mB7J0Nx4NDXIvIjrmuBTX967KNeGGn9GfE1ISeL8jZqZPGpnvKmEJUNk6cbEYvnB pe/9vLQhHbOJLYCIYDxTwA1R342VEWxklVewhWixbnW4lnfNoELxxM/sUP8oYxqBFHGL eFZ9VPheumf8sRCn6jCBw+ZRw3oI0p4IH8GICB5+ne/Q5lG50J9ydhAK12+uZ/TgxoDc mhQxU2iouxWoxFHCL0xsdzqQziNjfiXVJU3a5LzrIVIqyiX/0WDzExHKiPvPShKf+Vii fvnKaQ6ymTpIfrmUwEiKkjygsNPMIkSjBWGh7Kf4CVRUshOgIYV0Os4CxH3uv1yaFGp9 WnGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:organization:from:cc :references:to:subject:arc-authentication-results; bh=yXUiZgPSgrGWMtmf+6GXpj9bIE0MtmSMwh2gQfTyBqE=; b=Fpetv/Ts1uxFlbDKBl5T83pPIa6Lz6PjMrEHeZAKD7z8WOTrzskWObUXhiJv9C+nxT 8bZ+3jOKxoO2eZMxnefjWlhcG0KFD0LEN3deHKIBGikYcYQPZ2FrDG048ksTKj57BIUA UQn3NkpYRAkRAiqIMBsJYP+8vBPZ+ZwZiwxxve7+n+kA4GhHAvIaol5XOBkaIKlFc7v2 wDv8c25Ru4vKet4JeUFDAZLWnIediRPomcrtwBPn8D94vrvlhniDMN05PLAqillMe2ue 16h8rZoYECJAdffG3DWC2IKzB3yfCPrglwUaDzcOAd1EGGTSutrHqPO/iysYbhMCHGI3 ahAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si1988727plh.296.2018.03.20.10.09.56; Tue, 20 Mar 2018 10:10:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752341AbeCTRHy (ORCPT + 99 others); Tue, 20 Mar 2018 13:07:54 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:33760 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752271AbeCTRHu (ORCPT ); Tue, 20 Mar 2018 13:07:50 -0400 Received: from [192.168.100.149] (firewall.candelatech.com [50.251.239.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail2.candelatech.com (Postfix) with ESMTPSA id 3FB7F40A5ED; Tue, 20 Mar 2018 10:07:48 -0700 (PDT) Subject: Re: [PATCH] net: dev_forward_skb(): Scrub packet's per-netns info only when crossing netns To: Liran Alon , "Eric W. Biederman" References: <0d84d286-9965-45cb-93c8-379ca1b2441e@default> <87tvta67gl.fsf@xmission.com> <5AB13A86.9010607@ORACLE.COM> Cc: shmulik.ladkani@gmail.com, netdev@vger.kernel.org, mrv@mojatatu.com, daniel@iogearbox.net, davem@davemloft.net, linux-kernel@vger.kernel.org, yuval.shaia@ORACLE.COM, idan.brown@ORACLE.COM From: Ben Greear Organization: Candela Technologies Message-ID: Date: Tue, 20 Mar 2018 10:07:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <5AB13A86.9010607@ORACLE.COM> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/20/2018 09:44 AM, Liran Alon wrote: > > > On 20/03/18 18:24, ebiederm@xmission.com wrote: >> >> I don't believe the current behavior is a bug. >> >> I looked through the history. Basically skb_scrub_packet >> started out as the scrubbing needed for crossing network >> namespaces. >> >> Then tunnels which needed 90% of the functionality started >> calling it, with the xnet flag added. Because the tunnels >> needed to preserve their historic behavior. >> >> Then dev_forward_skb started calling skb_scrub_packet. >> >> A veth pair is supposed to give the same behavior as a cross-over >> cable plugged into two local nics. A cross over cable won't >> preserve things like the skb mark. So I don't see why anyone would >> expect a veth pair to preserve the mark. > > I disagree with this argument. > > I think that a skb crossing netns is what simulates a real packet crossing physical computers. Following your argument, why would skb->mark should be preserved > when crossing netdevs on same netns via routing? But this does today preserve skb->mark. > > Therefore, I do think that skb->mark should conceptually only be scrubbed when crossing netns. Regardless of the netdev used to cross it. It should be scrubbed in VETH as well. That is one way to make virtual routers. Possibly the newer VRF features will give another better way to do it, but you should not break things that used to work. Now, if you want to add a new feature that allows one to configure the kernel (or VETH) for a new behavior, then that might be something to consider. >> Right now I don't see the point of handling packets that don't cross >> network namespace boundaries specially, other than to preserve backwards >> compatibility. Well, backwards compat is a big deal all by itself! Thanks, Ben >> >> Eric >> > > -- Ben Greear Candela Technologies Inc http://www.candelatech.com