All of lore.kernel.org
 help / color / mirror / Atom feed
* NetworkManager fails to start
@ 2021-06-15 16:21 Leon Romanovsky
  2021-06-15 16:26 ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Leon Romanovsky @ 2021-06-15 16:21 UTC (permalink / raw)
  To: Kees Cook, Linus Torvalds
  Cc: Christian Brauner, Andrea Righi, stable, linux-netdev

Hi,

The commit 591a22c14d3f ("proc: Track /proc/$pid/attr/ opener mm_struct")
that we got in v5.13-rc6 broke our regression to pieces. The NIC interfaces
fail to start when using NetworkManager.

There is nothing in dmesg except error that NetworkManager failed to start.

Our setups are:
 * VMs with virtio-net NICs
 * Fedora 29

The revert fixes the issue and VMs boot with network working.

Thanks

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

* Re: NetworkManager fails to start
  2021-06-15 16:21 NetworkManager fails to start Leon Romanovsky
@ 2021-06-15 16:26 ` Linus Torvalds
  2021-06-15 16:49   ` Leon Romanovsky
  2021-06-15 17:45   ` Leon Romanovsky
  0 siblings, 2 replies; 5+ messages in thread
From: Linus Torvalds @ 2021-06-15 16:26 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Kees Cook, Christian Brauner, Andrea Righi, stable, linux-netdev

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

On Tue, Jun 15, 2021 at 9:21 AM Leon Romanovsky <leon@kernel.org> wrote:
>
> The commit 591a22c14d3f ("proc: Track /proc/$pid/attr/ opener mm_struct")
> that we got in v5.13-rc6 broke our regression to pieces. The NIC interfaces
> fail to start when using NetworkManager.

Does the attached patch fix it?

It just makes the open always succeed, and then the private_data that
the open did (that may or may not then have been filled in) is only
used on write.

               Linus

[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 629 bytes --]

 fs/proc/base.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 7118ebe38fa6..9cbd915025ad 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2676,7 +2676,9 @@ static int proc_pident_readdir(struct file *file, struct dir_context *ctx,
 #ifdef CONFIG_SECURITY
 static int proc_pid_attr_open(struct inode *inode, struct file *file)
 {
-	return __mem_open(inode, file, PTRACE_MODE_READ_FSCREDS);
+	file->private_data = NULL;
+	__mem_open(inode, file, PTRACE_MODE_READ_FSCREDS);
+	return 0;
 }
 
 static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,

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

* Re: NetworkManager fails to start
  2021-06-15 16:26 ` Linus Torvalds
@ 2021-06-15 16:49   ` Leon Romanovsky
  2021-06-15 17:45   ` Leon Romanovsky
  1 sibling, 0 replies; 5+ messages in thread
From: Leon Romanovsky @ 2021-06-15 16:49 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Kees Cook, Christian Brauner, Andrea Righi, stable, linux-netdev

On Tue, Jun 15, 2021 at 09:26:19AM -0700, Linus Torvalds wrote:
> On Tue, Jun 15, 2021 at 9:21 AM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > The commit 591a22c14d3f ("proc: Track /proc/$pid/attr/ opener mm_struct")
> > that we got in v5.13-rc6 broke our regression to pieces. The NIC interfaces
> > fail to start when using NetworkManager.
> 
> Does the attached patch fix it?

I pushed it for testing, will update shortly.

Thanks

> 
> It just makes the open always succeed, and then the private_data that
> the open did (that may or may not then have been filled in) is only
> used on write.
> 
>                Linus

>  fs/proc/base.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 7118ebe38fa6..9cbd915025ad 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -2676,7 +2676,9 @@ static int proc_pident_readdir(struct file *file, struct dir_context *ctx,
>  #ifdef CONFIG_SECURITY
>  static int proc_pid_attr_open(struct inode *inode, struct file *file)
>  {
> -	return __mem_open(inode, file, PTRACE_MODE_READ_FSCREDS);
> +	file->private_data = NULL;
> +	__mem_open(inode, file, PTRACE_MODE_READ_FSCREDS);
> +	return 0;
>  }
>  
>  static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,


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

* Re: NetworkManager fails to start
  2021-06-15 16:26 ` Linus Torvalds
  2021-06-15 16:49   ` Leon Romanovsky
@ 2021-06-15 17:45   ` Leon Romanovsky
  2021-06-15 18:06     ` Linus Torvalds
  1 sibling, 1 reply; 5+ messages in thread
From: Leon Romanovsky @ 2021-06-15 17:45 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Kees Cook, Christian Brauner, Andrea Righi, stable, linux-netdev

On Tue, Jun 15, 2021 at 09:26:19AM -0700, Linus Torvalds wrote:
> On Tue, Jun 15, 2021 at 9:21 AM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > The commit 591a22c14d3f ("proc: Track /proc/$pid/attr/ opener mm_struct")
> > that we got in v5.13-rc6 broke our regression to pieces. The NIC interfaces
> > fail to start when using NetworkManager.
> 
> Does the attached patch fix it?

Yes, this patch fixed the issue.
Tested-by: Leon Romanovsky <leonro@nvidia.com>

Thanks

> 
> It just makes the open always succeed, and then the private_data that
> the open did (that may or may not then have been filled in) is only
> used on write.
> 
>                Linus

>  fs/proc/base.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 7118ebe38fa6..9cbd915025ad 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -2676,7 +2676,9 @@ static int proc_pident_readdir(struct file *file, struct dir_context *ctx,
>  #ifdef CONFIG_SECURITY
>  static int proc_pid_attr_open(struct inode *inode, struct file *file)
>  {
> -	return __mem_open(inode, file, PTRACE_MODE_READ_FSCREDS);
> +	file->private_data = NULL;
> +	__mem_open(inode, file, PTRACE_MODE_READ_FSCREDS);
> +	return 0;
>  }
>  
>  static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,


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

* Re: NetworkManager fails to start
  2021-06-15 17:45   ` Leon Romanovsky
@ 2021-06-15 18:06     ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2021-06-15 18:06 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Kees Cook, Christian Brauner, Andrea Righi, stable, linux-netdev,
	youling 257

On Tue, Jun 15, 2021 at 10:45 AM Leon Romanovsky <leon@kernel.org> wrote:
>
> Yes, this patch fixed the issue.
> Tested-by: Leon Romanovsky <leonro@nvidia.com>

Thanks.

I've committed that minimal fix, although we still seem to have some
unexplained failure in this area for android 7 cm14.1 user space.

This has turned out to be fairly painful, with multiple fixes on top
of fixes, and there's still something odd going on. Grr.

           Linus

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

end of thread, other threads:[~2021-06-15 18:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 16:21 NetworkManager fails to start Leon Romanovsky
2021-06-15 16:26 ` Linus Torvalds
2021-06-15 16:49   ` Leon Romanovsky
2021-06-15 17:45   ` Leon Romanovsky
2021-06-15 18:06     ` Linus Torvalds

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.