All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: What's the status of 87b47932 patch - mnt: Implicitly add MNT_NODEV on remount as we do on mount
       [not found] ` <20141127101105.GA30605-empE8CJ7fzk2xCFIczX1Fw@public.gmane.org>
@ 2014-11-29 23:04   ` Eric W. Biederman
       [not found]     ` <87k32dlicc.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Eric W. Biederman @ 2014-11-29 23:04 UTC (permalink / raw)
  To: joeyli
  Cc: Stephen Rothwell, Richard Weinberger, Linux Containers,
	Andy Lutomirski, Jim Fehlig, Cedric Bosdonnat

joeyli <jlee-IBi9RG/b67k@public.gmane.org> writes:

> Hi Eric, 
>
> Sorry for bother you. I saw your patch:
> 	mnt: Implicitly add MNT_NODEV on remount as we do on mount
>
> Already commited in linux-next:
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/fs/namespace.c?id=87b47932f40a11280584bce260cbdb3b5f9e8b7d
>
> But, I didn't see this patch show in v3.18-rc kernel in Linus's git tree.
> What's the status of 87b47932 patch? Does there have regression cases it
> could not be merged to v3.18 kernel?

The patch actually breaks remounting filesystems that did not have
MNT_NODEV set when theny were mounted.

The primary issue is that the bug hit at a very inopportune time in my
life (just before kernel summit) after which I had a vacation planned
and after that I had some serious job hunting and moving to do. 

Now I am busily trying to catch up on my queue and these long delayed
bug fixes are the next issue.

If folks can review/test the current version of the patch (to follow in
a moment) I would appreciate it.  Based on previous testing unless I
have a typo what I expect to see is:
lxc  - b0rked.  The old versions of lxc must be broken to fix the
       security issue.
libvirt-lxc - fixed.
Andy's thing - fixed.

Any comments on the next user namespace breaking security fix that is
being finalized would also be appreciated.

Eric

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]     ` <87k32dlicc.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
@ 2014-11-29 23:05       ` Eric W. Biederman
       [not found]         ` <87egsllia3.fsf_-_-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
  2014-12-01  7:32       ` What's the status of 87b47932 patch - mnt: Implicitly add MNT_NODEV on remount as we do on mount joeyli
  1 sibling, 1 reply; 16+ messages in thread
From: Eric W. Biederman @ 2014-11-29 23:05 UTC (permalink / raw)
  To: joeyli
  Cc: Stephen Rothwell, Richard Weinberger, Linux Containers,
	Andy Lutomirski, Jim Fehlig, Cedric Bosdonnat


Now that remount is properly enforcing the rule that you can't remove
nodev at least sandstorm.io is breaking when performing a remount.

It turns out that there is an easy intuitive solution implicitly
add nodev on remount when nodev was implicitly added on mount.

Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
 fs/namespace.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 5b66b2b3624d..3a1a87dc33df 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2098,7 +2098,13 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
 	}
 	if ((mnt->mnt.mnt_flags & MNT_LOCK_NODEV) &&
 	    !(mnt_flags & MNT_NODEV)) {
-		return -EPERM;
+		/* Was the nodev implicitly added in mount? */
+		if ((mnt->mnt_ns->user_ns != &init_user_ns) &&
+		    !(sb->s_type->fs_flags & FS_USERNS_DEV_MOUNT)) {
+			mnt_flags |= MNT_NODEV;
+		} else {
+			return -EPERM;
+		}
 	}
 	if ((mnt->mnt.mnt_flags & MNT_LOCK_NOSUID) &&
 	    !(mnt_flags & MNT_NOSUID)) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]         ` <87egsllia3.fsf_-_-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
@ 2014-11-30  0:07           ` Andy Lutomirski
       [not found]             ` <CALCETrX=B+0PVe8fhvCEyqBGD-D1wLJPd6CrqPn6LCGYgzxPMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2014-11-30 14:58           ` Richard Weinberger
  1 sibling, 1 reply; 16+ messages in thread
From: Andy Lutomirski @ 2014-11-30  0:07 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Stephen Rothwell, Richard Weinberger, Linux Containers, joeyli,
	Jim Fehlig, Cedric Bosdonnat

On Nov 29, 2014 4:06 PM, "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org> wrote:
>
>
> Now that remount is properly enforcing the rule that you can't remove
> nodev at leastsandstorm.iois breaking when performing a remount.
>
> It turns out that there is an easy intuitive solution implicitly
> add nodev on remount when nodev was implicitly added on mount.

Is this intended to be a permanent fix or are you planning on
replacing it with something closer to my version for 3.19?

http://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=userns/fix_magic_nodev&id=bf8b198add82a249d6da4ecf280c30a0865637f6

I still think that the implicit nodev behavior is a bad idea in general.

--Andy

>
> Cc:stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Signed-off-by: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
> ---
>  fs/namespace.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 5b66b2b3624d..3a1a87dc33df 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -2098,7 +2098,13 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
>         }
>         if ((mnt->mnt.mnt_flags & MNT_LOCK_NODEV) &&
>             !(mnt_flags & MNT_NODEV)) {
> -               return -EPERM;
> +               /* Was the nodev implicitly added in mount? */
> +               if ((mnt->mnt_ns->user_ns != &init_user_ns) &&
> +                   !(sb->s_type->fs_flags & FS_USERNS_DEV_MOUNT)) {
> +                       mnt_flags |= MNT_NODEV;
> +               } else {
> +                       return -EPERM;
> +               }
>         }
>         if ((mnt->mnt.mnt_flags & MNT_LOCK_NOSUID) &&
>             !(mnt_flags & MNT_NOSUID)) {
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]         ` <87egsllia3.fsf_-_-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
  2014-11-30  0:07           ` Andy Lutomirski
@ 2014-11-30 14:58           ` Richard Weinberger
       [not found]             ` <547B309E.9020706-/L3Ra7n9ekc@public.gmane.org>
  1 sibling, 1 reply; 16+ messages in thread
From: Richard Weinberger @ 2014-11-30 14:58 UTC (permalink / raw)
  To: Eric W. Biederman, joeyli
  Cc: Stephen Rothwell, Linux Containers, Andy Lutomirski, Jim Fehlig,
	Cedric Bosdonnat

Eric,

Am 30.11.2014 um 00:05 schrieb Eric W. Biederman:
> 
> Now that remount is properly enforcing the rule that you can't remove
> nodev at least sandstorm.io is breaking when performing a remount.
> 
> It turns out that there is an easy intuitive solution implicitly
> add nodev on remount when nodev was implicitly added on mount.

Is this patch supposed to unbreak libvirt-lxc?
At least 1.2.9 is still broken.

Thanks,
//richard

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]             ` <547B309E.9020706-/L3Ra7n9ekc@public.gmane.org>
@ 2014-11-30 15:00               ` Andy Lutomirski
       [not found]                 ` <CALCETrUZRi=Y=CDTpq5oO-tPOvMsZ+osKiydkCk-P0dn4DKJkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Andy Lutomirski @ 2014-11-30 15:00 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: Stephen Rothwell, Linux Containers, joeyli, Jim Fehlig,
	Eric W. Biederman, Cedric Bosdonnat

On Sun, Nov 30, 2014 at 6:58 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
> Eric,
>
> Am 30.11.2014 um 00:05 schrieb Eric W. Biederman:
>>
>> Now that remount is properly enforcing the rule that you can't remove
>> nodev at least sandstorm.io is breaking when performing a remount.
>>
>> It turns out that there is an easy intuitive solution implicitly
>> add nodev on remount when nodev was implicitly added on mount.
>
> Is this patch supposed to unbreak libvirt-lxc?
> At least 1.2.9 is still broken.
>

Either this patch or my variant of it fixes the libvirt-lxc breakage
that I understand, but IIRC there was some other issue that none of us
figured out at K-S.

--Andy

> Thanks,
> //richard



-- 
Andy Lutomirski
AMA Capital Management, LLC

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]                 ` <CALCETrUZRi=Y=CDTpq5oO-tPOvMsZ+osKiydkCk-P0dn4DKJkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-11-30 15:16                   ` Richard Weinberger
       [not found]                     ` <547B34C6.6030709-/L3Ra7n9ekc@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Richard Weinberger @ 2014-11-30 15:16 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Stephen Rothwell, Linux Containers, joeyli, Jim Fehlig,
	Eric W. Biederman, Cedric Bosdonnat

Am 30.11.2014 um 16:00 schrieb Andy Lutomirski:
> On Sun, Nov 30, 2014 at 6:58 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>> Eric,
>>
>> Am 30.11.2014 um 00:05 schrieb Eric W. Biederman:
>>>
>>> Now that remount is properly enforcing the rule that you can't remove
>>> nodev at least sandstorm.io is breaking when performing a remount.
>>>
>>> It turns out that there is an easy intuitive solution implicitly
>>> add nodev on remount when nodev was implicitly added on mount.
>>
>> Is this patch supposed to unbreak libvirt-lxc?
>> At least 1.2.9 is still broken.
>>
> 
> Either this patch or my variant of it fixes the libvirt-lxc breakage
> that I understand, but IIRC there was some other issue that none of us
> figured out at K-S.

Currently it fails here:
2014-11-25 22:36:45.295+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc mode=0777
2014-11-25 22:36:45.295+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount proc on /proc type=proc flags=e
2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:873 : Processing /proc/sys -> /proc/sys
2014-11-25 22:36:45.296+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc/sys mode=0777
2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount /proc/sys on /proc/sys type=(null) flags=1000
2014-11-25 22:36:45.296+0000: 1: error : lxcContainerMountBasicFS:933 : Failed to re-mount /proc/sys on /proc/sys flags=1021: Operation not permitted

Thanks,
//richard

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]                     ` <547B34C6.6030709-/L3Ra7n9ekc@public.gmane.org>
@ 2014-11-30 15:37                       ` Andy Lutomirski
       [not found]                         ` <CALCETrW6QRRB_DfHwYv+UVJ_8yF+8Db+UP+ezd4jG599b4dSiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Andy Lutomirski @ 2014-11-30 15:37 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: Stephen Rothwell, Linux Containers, joeyli, Jim Fehlig,
	Eric W. Biederman, Cedric Bosdonnat

On Sun, Nov 30, 2014 at 7:16 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
> Am 30.11.2014 um 16:00 schrieb Andy Lutomirski:
>> On Sun, Nov 30, 2014 at 6:58 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>>> Eric,
>>>
>>> Am 30.11.2014 um 00:05 schrieb Eric W. Biederman:
>>>>
>>>> Now that remount is properly enforcing the rule that you can't remove
>>>> nodev at least sandstorm.io is breaking when performing a remount.
>>>>
>>>> It turns out that there is an easy intuitive solution implicitly
>>>> add nodev on remount when nodev was implicitly added on mount.
>>>
>>> Is this patch supposed to unbreak libvirt-lxc?
>>> At least 1.2.9 is still broken.
>>>
>>
>> Either this patch or my variant of it fixes the libvirt-lxc breakage
>> that I understand, but IIRC there was some other issue that none of us
>> figured out at K-S.
>
> Currently it fails here:
> 2014-11-25 22:36:45.295+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc mode=0777
> 2014-11-25 22:36:45.295+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount proc on /proc type=proc flags=e
> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:873 : Processing /proc/sys -> /proc/sys
> 2014-11-25 22:36:45.296+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc/sys mode=0777
> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount /proc/sys on /proc/sys type=(null) flags=1000
> 2014-11-25 22:36:45.296+0000: 1: error : lxcContainerMountBasicFS:933 : Failed to re-mount /proc/sys on /proc/sys flags=1021: Operation not permitted

Any chance you can test that with Eric's patch or mine [1] applied?
If that doesn't work, can you try to catch the failure with strace?

--Andy

[1] https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=userns/fix_magic_nodev&id=bf8b198add82a249d6da4ecf280c30a0865637f6

>
> Thanks,
> //richard



-- 
Andy Lutomirski
AMA Capital Management, LLC

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]                         ` <CALCETrW6QRRB_DfHwYv+UVJ_8yF+8Db+UP+ezd4jG599b4dSiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-11-30 17:14                           ` Richard Weinberger
       [not found]                             ` <547B5066.4020509-/L3Ra7n9ekc@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Richard Weinberger @ 2014-11-30 17:14 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Stephen Rothwell, Linux Containers, joeyli, Jim Fehlig,
	Eric W. Biederman, Cedric Bosdonnat

Am 30.11.2014 um 16:37 schrieb Andy Lutomirski:
> On Sun, Nov 30, 2014 at 7:16 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>> Am 30.11.2014 um 16:00 schrieb Andy Lutomirski:
>>> On Sun, Nov 30, 2014 at 6:58 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>>>> Eric,
>>>>
>>>> Am 30.11.2014 um 00:05 schrieb Eric W. Biederman:
>>>>>
>>>>> Now that remount is properly enforcing the rule that you can't remove
>>>>> nodev at least sandstorm.io is breaking when performing a remount.
>>>>>
>>>>> It turns out that there is an easy intuitive solution implicitly
>>>>> add nodev on remount when nodev was implicitly added on mount.
>>>>
>>>> Is this patch supposed to unbreak libvirt-lxc?
>>>> At least 1.2.9 is still broken.
>>>>
>>>
>>> Either this patch or my variant of it fixes the libvirt-lxc breakage
>>> that I understand, but IIRC there was some other issue that none of us
>>> figured out at K-S.
>>
>> Currently it fails here:
>> 2014-11-25 22:36:45.295+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc mode=0777
>> 2014-11-25 22:36:45.295+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount proc on /proc type=proc flags=e
>> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:873 : Processing /proc/sys -> /proc/sys
>> 2014-11-25 22:36:45.296+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc/sys mode=0777
>> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount /proc/sys on /proc/sys type=(null) flags=1000
>> 2014-11-25 22:36:45.296+0000: 1: error : lxcContainerMountBasicFS:933 : Failed to re-mount /proc/sys on /proc/sys flags=1021: Operation not permitted
> 
> Any chance you can test that with Eric's patch or mine [1] applied?
> If that doesn't work, can you try to catch the failure with strace?

With your patch applied on top of Linus's tree as of today libvirt-lxc works fine again. :)

Thanks,
//richard

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]                             ` <547B5066.4020509-/L3Ra7n9ekc@public.gmane.org>
@ 2014-11-30 18:35                               ` Eric W. Biederman
       [not found]                                 ` <871tokleo7.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Eric W. Biederman @ 2014-11-30 18:35 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: Stephen Rothwell, Linux Containers, Andy Lutomirski, joeyli,
	Jim Fehlig, Cedric Bosdonnat

Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> writes:

> Am 30.11.2014 um 16:37 schrieb Andy Lutomirski:
>> On Sun, Nov 30, 2014 at 7:16 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>>> Am 30.11.2014 um 16:00 schrieb Andy Lutomirski:
>>>> On Sun, Nov 30, 2014 at 6:58 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>>>>> Eric,
>>>>>
>>>>> Am 30.11.2014 um 00:05 schrieb Eric W. Biederman:
>>>>>>
>>>>>> Now that remount is properly enforcing the rule that you can't remove
>>>>>> nodev at least sandstorm.io is breaking when performing a remount.
>>>>>>
>>>>>> It turns out that there is an easy intuitive solution implicitly
>>>>>> add nodev on remount when nodev was implicitly added on mount.
>>>>>
>>>>> Is this patch supposed to unbreak libvirt-lxc?
>>>>> At least 1.2.9 is still broken.
>>>>>
>>>>
>>>> Either this patch or my variant of it fixes the libvirt-lxc breakage
>>>> that I understand, but IIRC there was some other issue that none of us
>>>> figured out at K-S.
>>>
>>> Currently it fails here:
>>> 2014-11-25 22:36:45.295+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc mode=0777
>>> 2014-11-25 22:36:45.295+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount proc on /proc type=proc flags=e
>>> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:873 : Processing /proc/sys -> /proc/sys
>>> 2014-11-25 22:36:45.296+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc/sys mode=0777
>>> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount /proc/sys on /proc/sys type=(null) flags=1000
>>> 2014-11-25 22:36:45.296+0000: 1: error : lxcContainerMountBasicFS:933 : Failed to re-mount /proc/sys on /proc/sys flags=1021: Operation not permitted
>> 
>> Any chance you can test that with Eric's patch or mine [1] applied?
>> If that doesn't work, can you try to catch the failure with strace?
>
> With your patch applied on top of Linus's tree as of today libvirt-lxc works fine again. :)

*Scratches head*

Did you really have my latest patch applied?

Andy's patch implies a change of policy that I really don't want to
deploy as a bug fix.

Eric

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]                                 ` <871tokleo7.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
@ 2014-11-30 18:42                                   ` Richard Weinberger
       [not found]                                     ` <547B6531.40504-/L3Ra7n9ekc@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Richard Weinberger @ 2014-11-30 18:42 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Stephen Rothwell, Linux Containers, Andy Lutomirski, joeyli,
	Jim Fehlig, Cedric Bosdonnat

Am 30.11.2014 um 19:35 schrieb Eric W. Biederman:
> Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> writes:
> 
>> Am 30.11.2014 um 16:37 schrieb Andy Lutomirski:
>>> On Sun, Nov 30, 2014 at 7:16 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>>>> Am 30.11.2014 um 16:00 schrieb Andy Lutomirski:
>>>>> On Sun, Nov 30, 2014 at 6:58 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>>>>>> Eric,
>>>>>>
>>>>>> Am 30.11.2014 um 00:05 schrieb Eric W. Biederman:
>>>>>>>
>>>>>>> Now that remount is properly enforcing the rule that you can't remove
>>>>>>> nodev at least sandstorm.io is breaking when performing a remount.
>>>>>>>
>>>>>>> It turns out that there is an easy intuitive solution implicitly
>>>>>>> add nodev on remount when nodev was implicitly added on mount.
>>>>>>
>>>>>> Is this patch supposed to unbreak libvirt-lxc?
>>>>>> At least 1.2.9 is still broken.
>>>>>>
>>>>>
>>>>> Either this patch or my variant of it fixes the libvirt-lxc breakage
>>>>> that I understand, but IIRC there was some other issue that none of us
>>>>> figured out at K-S.
>>>>
>>>> Currently it fails here:
>>>> 2014-11-25 22:36:45.295+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc mode=0777
>>>> 2014-11-25 22:36:45.295+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount proc on /proc type=proc flags=e
>>>> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:873 : Processing /proc/sys -> /proc/sys
>>>> 2014-11-25 22:36:45.296+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc/sys mode=0777
>>>> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount /proc/sys on /proc/sys type=(null) flags=1000
>>>> 2014-11-25 22:36:45.296+0000: 1: error : lxcContainerMountBasicFS:933 : Failed to re-mount /proc/sys on /proc/sys flags=1021: Operation not permitted
>>>
>>> Any chance you can test that with Eric's patch or mine [1] applied?
>>> If that doesn't work, can you try to catch the failure with strace?
>>
>> With your patch applied on top of Linus's tree as of today libvirt-lxc works fine again. :)
> 
> *Scratches head*
> 
> Did you really have my latest patch applied?
> 
> Andy's patch implies a change of policy that I really don't want to
> deploy as a bug fix.

Hmm, let me double check this tomorrow with a fresh brain.
Maybe I got hit by another issue while testing your patch.
Currently I'm fighting against three libvirt-lxc issues in parallel. :-\

Thanks,
//richard

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]             ` <CALCETrX=B+0PVe8fhvCEyqBGD-D1wLJPd6CrqPn6LCGYgzxPMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-11-30 18:46               ` Eric W. Biederman
  0 siblings, 0 replies; 16+ messages in thread
From: Eric W. Biederman @ 2014-11-30 18:46 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Stephen Rothwell, Richard Weinberger, Linux Containers, joeyli,
	Jim Fehlig, Cedric Bosdonnat

Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> writes:

> On Nov 29, 2014 4:06 PM, "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org> wrote:
>>
>>
>> Now that remount is properly enforcing the rule that you can't remove
>> nodev at leastsandstorm.iois breaking when performing a remount.
>>
>> It turns out that there is an easy intuitive solution implicitly
>> add nodev on remount when nodev was implicitly added on mount.
>
> Is this intended to be a permanent fix or are you planning on
> replacing it with something closer to my version for 3.19?
>
> http://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=userns/fix_magic_nodev&id=bf8b198add82a249d6da4ecf280c30a0865637f6
>
> I still think that the implicit nodev behavior is a bad idea in
> general.

I want to consider your change as part of the larger discussion about
how we take the final step towards allowing fuse and other filesystems
with backing store to be merged in the kernel.

There are actually some other possibilities with s_user_ns in the mix.

The cleanest solution is probably to declare dev_t as well as security
labels values that are interpreted with respect to user namespaces.
Then seeting s_user_ns != &init_user_ns will yield device nodes that
simply don't have a meaning in the kernel.  Which winds up being
effectively the same as an implicit nodev, but without the compatibility
hassle.

But all of that is or should be development.  And what my patch is, is
about getting a simple bug fix that works.

Eric

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]                                     ` <547B6531.40504-/L3Ra7n9ekc@public.gmane.org>
@ 2014-12-01  1:29                                       ` Eric W. Biederman
       [not found]                                         ` <87k32ci2dx.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Eric W. Biederman @ 2014-12-01  1:29 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: Stephen Rothwell, Linux Containers, Andy Lutomirski, joeyli,
	Jim Fehlig, Cedric Bosdonnat

Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> writes:

> Am 30.11.2014 um 19:35 schrieb Eric W. Biederman:
>> Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> writes:
>> 
>>> Am 30.11.2014 um 16:37 schrieb Andy Lutomirski:
>>>> On Sun, Nov 30, 2014 at 7:16 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>>>>> Am 30.11.2014 um 16:00 schrieb Andy Lutomirski:
>>>>>> On Sun, Nov 30, 2014 at 6:58 AM, Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> wrote:
>>>>>>> Eric,
>>>>>>>
>>>>>>> Am 30.11.2014 um 00:05 schrieb Eric W. Biederman:
>>>>>>>>
>>>>>>>> Now that remount is properly enforcing the rule that you can't remove
>>>>>>>> nodev at least sandstorm.io is breaking when performing a remount.
>>>>>>>>
>>>>>>>> It turns out that there is an easy intuitive solution implicitly
>>>>>>>> add nodev on remount when nodev was implicitly added on mount.
>>>>>>>
>>>>>>> Is this patch supposed to unbreak libvirt-lxc?
>>>>>>> At least 1.2.9 is still broken.
>>>>>>>
>>>>>>
>>>>>> Either this patch or my variant of it fixes the libvirt-lxc breakage
>>>>>> that I understand, but IIRC there was some other issue that none of us
>>>>>> figured out at K-S.
>>>>>
>>>>> Currently it fails here:
>>>>> 2014-11-25 22:36:45.295+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc mode=0777
>>>>> 2014-11-25 22:36:45.295+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount proc on /proc type=proc flags=e
>>>>> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:873 : Processing /proc/sys -> /proc/sys
>>>>> 2014-11-25 22:36:45.296+0000: 1: debug : virFileMakePathHelper:2436 : path=/proc/sys mode=0777
>>>>> 2014-11-25 22:36:45.296+0000: 1: debug : lxcContainerMountBasicFS:918 : Mount /proc/sys on /proc/sys type=(null) flags=1000
>>>>> 2014-11-25 22:36:45.296+0000: 1: error : lxcContainerMountBasicFS:933 : Failed to re-mount /proc/sys on /proc/sys flags=1021: Operation not permitted
>>>>
>>>> Any chance you can test that with Eric's patch or mine [1] applied?
>>>> If that doesn't work, can you try to catch the failure with strace?
>>>
>>> With your patch applied on top of Linus's tree as of today libvirt-lxc works fine again. :)
>> 
>> *Scratches head*
>> 
>> Did you really have my latest patch applied?
>> 
>> Andy's patch implies a change of policy that I really don't want to
>> deploy as a bug fix.
>
> Hmm, let me double check this tomorrow with a fresh brain.
> Maybe I got hit by another issue while testing your patch.
> Currently I'm fighting against three libvirt-lxc issues in parallel. :-\

Please do.  I just reran through my regression tests that explore this
issue rather throughly and all of my remount test cases are passing.  So
if things are truly failing I want to understand what is going on, and
add to my regression tests.

I should have done that sooner of course but I am still paging back in
after being distracted with the other things in life.

Eric

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: What's the status of 87b47932 patch - mnt: Implicitly add MNT_NODEV on remount as we do on mount
       [not found]     ` <87k32dlicc.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
  2014-11-29 23:05       ` [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount Eric W. Biederman
@ 2014-12-01  7:32       ` joeyli
  1 sibling, 0 replies; 16+ messages in thread
From: joeyli @ 2014-12-01  7:32 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Stephen Rothwell, Richard Weinberger, Linux Containers,
	Andy Lutomirski, Jim Fehlig, Cedric Bosdonnat

Hi Eric, 

On Sat, Nov 29, 2014 at 05:04:03PM -0600, Eric W. Biederman wrote:
> joeyli <jlee-IBi9RG/b67k@public.gmane.org> writes:
> 
> > Hi Eric, 
> >
> > Sorry for bother you. I saw your patch:
> > 	mnt: Implicitly add MNT_NODEV on remount as we do on mount
> >
> > Already commited in linux-next:
> > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/fs/namespace.c?id=87b47932f40a11280584bce260cbdb3b5f9e8b7d
> >
> > But, I didn't see this patch show in v3.18-rc kernel in Linus's git tree.
> > What's the status of 87b47932 patch? Does there have regression cases it
> > could not be merged to v3.18 kernel?
> 
> The patch actually breaks remounting filesystems that did not have
> MNT_NODEV set when theny were mounted.
> 
> The primary issue is that the bug hit at a very inopportune time in my
> life (just before kernel summit) after which I had a vacation planned
> and after that I had some serious job hunting and moving to do. 
> 
> Now I am busily trying to catch up on my queue and these long delayed
> bug fixes are the next issue.
> 
> If folks can review/test the current version of the patch (to follow in
> a moment) I would appreciate it.  Based on previous testing unless I
> have a typo what I expect to see is:
> lxc  - b0rked.  The old versions of lxc must be broken to fix the
>        security issue.
> libvirt-lxc - fixed.
> Andy's thing - fixed.
> 
> Any comments on the next user namespace breaking security fix that is
> being finalized would also be appreciated.
> 
> Eric

Thanks for your quick response and information about your patches.

Joey Lee

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]                                         ` <87k32ci2dx.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
@ 2014-12-02  8:26                                           ` Richard Weinberger
       [not found]                                             ` <547D77C8.7050100-/L3Ra7n9ekc@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Richard Weinberger @ 2014-12-02  8:26 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Stephen Rothwell, Linux Containers, Andy Lutomirski, joeyli,
	Jim Fehlig, Cedric Bosdonnat

Am 01.12.2014 um 02:29 schrieb Eric W. Biederman:
>>>>> Any chance you can test that with Eric's patch or mine [1] applied?
>>>>> If that doesn't work, can you try to catch the failure with strace?
>>>>
>>>> With your patch applied on top of Linus's tree as of today libvirt-lxc works fine again. :)
>>>
>>> *Scratches head*
>>>
>>> Did you really have my latest patch applied?
>>>
>>> Andy's patch implies a change of policy that I really don't want to
>>> deploy as a bug fix.
>>
>> Hmm, let me double check this tomorrow with a fresh brain.
>> Maybe I got hit by another issue while testing your patch.
>> Currently I'm fighting against three libvirt-lxc issues in parallel. :-\
> 
> Please do.  I just reran through my regression tests that explore this
> issue rather throughly and all of my remount test cases are passing.  So
> if things are truly failing I want to understand what is going on, and
> add to my regression tests.
> 
> I should have done that sooner of course but I am still paging back in
> after being distracted with the other things in life.

I can confirm that your patch "mnt: Implicitly add MNT_NODEV on remount as we do on mount"
unbreaks libvirt-lxc too. :-)
Sorry for the false negative.

Thanks,
//richard

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]                                             ` <547D77C8.7050100-/L3Ra7n9ekc@public.gmane.org>
@ 2014-12-02  9:53                                               ` Eric W. Biederman
       [not found]                                                 ` <87ppc22x9d.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Eric W. Biederman @ 2014-12-02  9:53 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: Stephen Rothwell, Linux Containers, Andy Lutomirski, joeyli,
	Jim Fehlig, Cedric Bosdonnat

Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> writes:

> Am 01.12.2014 um 02:29 schrieb Eric W. Biederman:
>>>>>> Any chance you can test that with Eric's patch or mine [1] applied?
>>>>>> If that doesn't work, can you try to catch the failure with strace?
>>>>>
>>>>> With your patch applied on top of Linus's tree as of today libvirt-lxc works fine again. :)
>>>>
>>>> *Scratches head*
>>>>
>>>> Did you really have my latest patch applied?
>>>>
>>>> Andy's patch implies a change of policy that I really don't want to
>>>> deploy as a bug fix.
>>>
>>> Hmm, let me double check this tomorrow with a fresh brain.
>>> Maybe I got hit by another issue while testing your patch.
>>> Currently I'm fighting against three libvirt-lxc issues in parallel. :-\
>> 
>> Please do.  I just reran through my regression tests that explore this
>> issue rather throughly and all of my remount test cases are passing.  So
>> if things are truly failing I want to understand what is going on, and
>> add to my regression tests.
>> 
>> I should have done that sooner of course but I am still paging back in
>> after being distracted with the other things in life.
>
> I can confirm that your patch "mnt: Implicitly add MNT_NODEV on remount as we do on mount"
> unbreaks libvirt-lxc too. :-)
> Sorry for the false negative.

Thanks I will add your Tested-by.

Eric

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
       [not found]                                                 ` <87ppc22x9d.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
@ 2014-12-02 13:12                                                   ` joeyli
  0 siblings, 0 replies; 16+ messages in thread
From: joeyli @ 2014-12-02 13:12 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Stephen Rothwell, Richard Weinberger, Linux Containers,
	Andy Lutomirski, Jim Fehlig, Cedric Bosdonnat

Hi Eric, 

On Tue, Dec 02, 2014 at 03:53:34AM -0600, Eric W. Biederman wrote:
> Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> writes:
> 
> > Am 01.12.2014 um 02:29 schrieb Eric W. Biederman:
> >>>>>> Any chance you can test that with Eric's patch or mine [1] applied?
> >>>>>> If that doesn't work, can you try to catch the failure with strace?
> >>>>>
> >>>>> With your patch applied on top of Linus's tree as of today libvirt-lxc works fine again. :)
> >>>>
> >>>> *Scratches head*
> >>>>
> >>>> Did you really have my latest patch applied?
> >>>>
> >>>> Andy's patch implies a change of policy that I really don't want to
> >>>> deploy as a bug fix.
> >>>
> >>> Hmm, let me double check this tomorrow with a fresh brain.
> >>> Maybe I got hit by another issue while testing your patch.
> >>> Currently I'm fighting against three libvirt-lxc issues in parallel. :-\
> >> 
> >> Please do.  I just reran through my regression tests that explore this
> >> issue rather throughly and all of my remount test cases are passing.  So
> >> if things are truly failing I want to understand what is going on, and
> >> add to my regression tests.
> >> 
> >> I should have done that sooner of course but I am still paging back in
> >> after being distracted with the other things in life.
> >
> > I can confirm that your patch "mnt: Implicitly add MNT_NODEV on remount as we do on mount"
> > unbreaks libvirt-lxc too. :-)
> > Sorry for the false negative.
> 
> Thanks I will add your Tested-by.
> 
> Eric

Cedric help to test my kernel that included your patch. Please feel free to
add:

Tested-by: Cedric Bosdonnat <cbosdonnat-IBi9RG/b67k@public.gmane.org>


Regards
Joey Lee

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-12-02 13:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20141127101105.GA30605@linux-rxt1.site>
     [not found] ` <20141127101105.GA30605-empE8CJ7fzk2xCFIczX1Fw@public.gmane.org>
2014-11-29 23:04   ` What's the status of 87b47932 patch - mnt: Implicitly add MNT_NODEV on remount as we do on mount Eric W. Biederman
     [not found]     ` <87k32dlicc.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2014-11-29 23:05       ` [CFT][PATCH] mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount Eric W. Biederman
     [not found]         ` <87egsllia3.fsf_-_-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2014-11-30  0:07           ` Andy Lutomirski
     [not found]             ` <CALCETrX=B+0PVe8fhvCEyqBGD-D1wLJPd6CrqPn6LCGYgzxPMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-30 18:46               ` Eric W. Biederman
2014-11-30 14:58           ` Richard Weinberger
     [not found]             ` <547B309E.9020706-/L3Ra7n9ekc@public.gmane.org>
2014-11-30 15:00               ` Andy Lutomirski
     [not found]                 ` <CALCETrUZRi=Y=CDTpq5oO-tPOvMsZ+osKiydkCk-P0dn4DKJkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-30 15:16                   ` Richard Weinberger
     [not found]                     ` <547B34C6.6030709-/L3Ra7n9ekc@public.gmane.org>
2014-11-30 15:37                       ` Andy Lutomirski
     [not found]                         ` <CALCETrW6QRRB_DfHwYv+UVJ_8yF+8Db+UP+ezd4jG599b4dSiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-30 17:14                           ` Richard Weinberger
     [not found]                             ` <547B5066.4020509-/L3Ra7n9ekc@public.gmane.org>
2014-11-30 18:35                               ` Eric W. Biederman
     [not found]                                 ` <871tokleo7.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2014-11-30 18:42                                   ` Richard Weinberger
     [not found]                                     ` <547B6531.40504-/L3Ra7n9ekc@public.gmane.org>
2014-12-01  1:29                                       ` Eric W. Biederman
     [not found]                                         ` <87k32ci2dx.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2014-12-02  8:26                                           ` Richard Weinberger
     [not found]                                             ` <547D77C8.7050100-/L3Ra7n9ekc@public.gmane.org>
2014-12-02  9:53                                               ` Eric W. Biederman
     [not found]                                                 ` <87ppc22x9d.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2014-12-02 13:12                                                   ` joeyli
2014-12-01  7:32       ` What's the status of 87b47932 patch - mnt: Implicitly add MNT_NODEV on remount as we do on mount joeyli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.