From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751343AbdIRUrS (ORCPT ); Mon, 18 Sep 2017 16:47:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38018 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750747AbdIRUrQ (ORCPT ); Mon, 18 Sep 2017 16:47:16 -0400 Date: Mon, 18 Sep 2017 13:47:10 -0700 From: Ram Pai To: Dawid Ciezarkiewicz Cc: linux-kernel@vger.kernel.org Subject: Re: Read-only `slaves` with shared subtrees? Reply-To: Ram Pai References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 17091820-0004-0000-0000-000012F0EA6F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007758; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000230; SDB=6.00918950; UDB=6.00461661; IPR=6.00699177; BA=6.00005595; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017199; XFM=3.00000015; UTC=2017-09-18 20:47:15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091820-0005-0000-0000-0000842441AB Message-Id: <20170918204710.GI5698@ram.oc3035372033.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-18_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709180291 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 15, 2017 at 10:57:30AM -0700, Dawid Ciezarkiewicz wrote: > Hi, > > (Please keep me in CC me when responding.) > > I have an use-case for shared subtrees that is not covered by: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.kernel.org_doc_Documentation_filesystems_sharedsubtree.txt&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=m-UrKChQVkZtnPpjbF6YY99NbT8FBByQ-E-ygV8luxw&m=l46zr30OWtcm54Kc2X1KfLkB11GtFf2YLA0WcpI6Tuo&s=L-i2sXNn5dHjJfzl_lCW-JvlZnGf8NdOB7ZktFGTUdY&e= > > and I wasn't able to figure out any working solution - it might not be possible > ATM. > > Long story short: > I'd like the `slave` mount (service in a container) to mount propagated events > as RO, no matter how did `master` (host) mount them. Host might need that data > RW, but slave must have it RO only. > > I'm using Linux containers to isolate processes. I need the container > to follow part of the host system mount tree, but not have a write-access to it > (for security reasons). It's a trivial setup as long > as everything is static, but as soon as a part of what the container needs > to access is mounted/unmounted at runtime (and thus shared subtrees > are involved), > there seems to be no way to control the flags of the propagated mount events. It is possible to make a slave mount readonly, by remounting it with 'ro' flags. something like mount -o bind,remount,ro Any mount-propagation events reaching a read-only-slave does inherit the slave attribute. However it does not inherit the read-only attribute. Should it inherit? or should it not? -- that has not been thought off AFAICT. it think we should let it inherit. RP