Received: by 10.213.65.68 with SMTP id h4csp11816imn; Thu, 15 Mar 2018 08:07:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELtHbzR7jOtkYDkMA5e/IUpYOzjEIA7i4M/zeha8x4vo7661uwqfUZyqM8Lqm3/xHGIHKtYA X-Received: by 10.101.85.71 with SMTP id t7mr6980914pgr.386.1521126436589; Thu, 15 Mar 2018 08:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521126436; cv=none; d=google.com; s=arc-20160816; b=hFwYH9FYPRs/6W46irpxLJZHmhmKsMwVAJOOMu0MEuxGTBbkBCkKd78Hh7hD9bG5xs HWH/ao3hrVipoFbpLtrf0fuqJDWBgOrexajgxqI/L5vPS6Cq8nA1SEiZg76c5deF0A+d 6yBn2GjsnlZhHa8D38Riwio7NcxaAryN6IAUix6WVb/QiEEyd/lCc9fM/drG1XntcmGU LLhW+XSm/PJlX50zKN6weXhZ8brbeNUiuX4AWQ3jwMeVwrYSvGGSRGsjBursD5puWHbD 6995UkSrLE4o98yZQyZbyDVARlVtkppE4x2Grml7nEsFQ3ogf+awordqPpJG/Mb5fPBc 2Lxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:subject:cc:to:from:date:message-id :mime-version:dkim-signature:arc-authentication-results; bh=jkQu7cIGBudcenY78Ro76qOKJ293QVPMFAjFkrS5mYM=; b=kMd3lFhXRo1IuH9G+ZXeUpmkMC5wXOqc3WA3Cx5Rjpn2o6xTsqVlr10pAfAaYcSIdb Eevb35u/IpbhEwuFrlBgC9J9sYN+Zss317XZFARft1mJsZUWx0dbkqRZduzSurQubSeV Z5TYGUGkK51HQOAmcaEzaR0C2nqu2Cu/S2ssagpR9i89rsQWbo0NhbansR5y/sVjz7UP wG2mlVBdxIgz7wi6TlK57Wv2j/OGDdTJ4okPcplE/UyVx3M1bp+b3NrjynR5i6tiQXIh 1HOSIdzEFZb7h4Cm74yfzZ8XlbjsMAcpfzo26ZvWq0IkVs40KhHGBC4divrX7IcEIcd9 /a1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=aNhltFTU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g125si3494849pgc.738.2018.03.15.08.07.02; Thu, 15 Mar 2018 08:07:16 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=aNhltFTU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbeCOPGB (ORCPT + 99 others); Thu, 15 Mar 2018 11:06:01 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:56130 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752652AbeCOPGA (ORCPT ); Thu, 15 Mar 2018 11:06:00 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2FF4wKI194887; Thu, 15 Mar 2018 15:05:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : to : cc : subject : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=jkQu7cIGBudcenY78Ro76qOKJ293QVPMFAjFkrS5mYM=; b=aNhltFTU7AtpsKWRZ76MWd17g85Bc670/FkT8H4Pp/Ps7syxhORefotWnRwsZ3lyK/nI 8GJiqljV3AF97+B8CPkLSOHetOtaVkgXwyL/spOsCcYlNSE/EvJXFwLLb3e4Sjo+7lbS q8lR/NewVsG3vO0SFQPbFniL4w02PEos32/lDeeFVB+G56ZNpneMillx8LdZZN96lx3x NGxFOu3f9n5Qq7P3Dd1cxwiB0PcbnqvCF76TnJIhczgANizyU/07QDQH/7dBTUYEX55a kVQT93O/zWh+rjT4rACXScfmYt1c9lcq8dvLEvx8Yu74vyGFq4AUOJjGRqbbSd+Gy1pu Dg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2gqu5kr075-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Mar 2018 15:05:34 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2FF5Y2g003938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Mar 2018 15:05:34 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2FF5XbC013427; Thu, 15 Mar 2018 15:05:33 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 15 Mar 2018 08:05:33 -0700 (PDT) From: Liran Alon To: Cc: , , , , , , Subject: Re: [PATCH] net: dev_forward_skb(): Scrub packet's per-netns info only when crossing netns X-Mailer: Zimbra on Oracle Beehive Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8832 signatures=668690 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803150167 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- daniel@iogearbox.net wrote: > On 03/15/2018 03:35 PM, Roman Mashak wrote: > > Liran Alon writes: > > [...] > >>> Overall I think it might be nice to not need scrubbing skb in > such > >>> cases, > >>> although my concern would be that this has potential to break > >>> existing > >>> setups when they would expect mark being zero on other veth peer > in > >>> any > >>> case since it's the behavior for a long time already. The safer > >>> option > >>> would be to have some sort of explicit opt-in e.g. on link > creation to > >>> let > >>> the skb->mark pass through unscrubbed. This would definitely be a > >>> useful > >>> option e.g. when mark is set in the netns facing veth via > >>> clsact/egress > >>> on xmit and when the container is unprivileged anyway. > >>> > >>> Thanks, > >>> Daniel > >> > >> I see your point in regards to backwards comparability. > >> However, not scrubbing skb when it cross netns via some kernel > functions compared to > >> others is basically a bug which could easily break with a little > bit of more refactoring. > >> Therefore, it seems a bit weird to me to from now on, we will > force > >> every user on link creation to consider that once there was a bug > leading > >> to this weird behavior on specific netdevs. >=20 > Why bug specifically? It could well be that for some unpriv > containers > it would be fine to do e.g. in cases where orchestrator sets up > clsact/ > egress on veth/ipvlan/etc in the container to set the mark and where > app > cannot mess with this while for others you need to act out of host > facing > veth; thus, explicit opt-in per dev could provide such more fine > grained > control. >=20 > > One valid use case could be preserving a source namespace nsid in > > skb->mark when a packet crosses netns. >=20 > Right, was thinking about something similar. I agree with all the above but this behavior was not supported both before and after this commit. skb->mark is always zeroed when crossing netn= s. This commit only changes behavior for skb crossing netdevs on *same* netns via dev_forward_skb(). Therefore, I believe we should discuss here what we want default behavior t= o be and how it should be controlled for backwards comparability. Only after we should discuss about adding an extra feature of controlling s= kb scrub per netdev or something similar.