lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Oct 2022 23:19:01 +0800
From:   Xiaobo Liu <cppcoffee@...il.com>
To:     davem@...emloft.net
Cc:     edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Xiaobo Liu <cppcoffee@...il.com>
Subject: [PATCH] net/atm: fix proc_mpc_write 1 byte less calculated

Then the input contains '\0' or '\n', proc_mpc_write has read them,
so the return value needs +1.

Signed-off-by: Xiaobo Liu <cppcoffee@...il.com>
---
 net/atm/mpoa_proc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
index 829db9eba..444ceda60 100755
--- a/net/atm/mpoa_proc.c
+++ b/net/atm/mpoa_proc.c
@@ -224,8 +224,11 @@ static ssize_t proc_mpc_write(struct file *file, const char __user *buff,
 			free_page((unsigned long)page);
 			return -EFAULT;
 		}
-		if (*p == '\0' || *p == '\n')
+
+		if (*p == '\0' || *p == '\n') {
+			len += 1
 			break;
+		}
 	}
 
 	*p = '\0';
-- 
2.21.0 (Apple Git-122.2)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ