Skip to contentSkip to conversation

NetworkManager fails to start

DISCUSSION Leon Romanovsky 2 participants 5 messages Jun 15, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 4 lines · Leon Romanovsky

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

 fs/proc/base.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/proc/base.c +3 -1
index 7118ebe38fa6..9cbd915025ad 100644
@@ -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,
#2 lore raw
Quoted 7 lines · Linus Torvalds
Quoted 4 lines · Leon Romanovsky

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

Quoted 25 lines

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(-)
fs/proc/base.c +3 -1
index 7118ebe38fa6..9cbd915025ad 100644
@@ -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,
author Tested-by
#3 lore raw
In reply to Linus Torvalds
Quoted 7 lines · Linus Torvalds
Quoted 4 lines · Leon Romanovsky

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.

Thanks

Quoted 25 lines

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(-)
fs/proc/base.c +3 -1
index 7118ebe38fa6..9cbd915025ad 100644
@@ -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,
#4 lore raw
Quoted 3 lines · Leon Romanovsky

Yes, this patch fixed the issue.

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