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]
Message-Id: <1559651505-18137-1-git-send-email-92siuyang@gmail.com>
Date:   Tue,  4 Jun 2019 20:31:45 +0800
From:   Young Xiao <92siuyang@...il.com>
To:     davem@...emloft.net, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Young Xiao <92siuyang@...il.com>
Subject: [PATCH] net: compat: fix msg_controllen overflow in scm_detach_fds_compat()

There is a missing check between kmsg->msg_controllen and cmlen,
which can possibly lead to overflow.

This bug is similar to vulnerability that was fixed in commit 6900317f5eff
("net, scm: fix PaX detected msg_controllen overflow in scm_detach_fds").

Signed-off-by: Young Xiao <92siuyang@...il.com>
---
 net/compat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/compat.c b/net/compat.c
index a031bd3..8e74dfb 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -301,6 +301,8 @@ void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm)
 			err = put_user(cmlen, &cm->cmsg_len);
 		if (!err) {
 			cmlen = CMSG_COMPAT_SPACE(i * sizeof(int));
+			if (kmsg->msg_controllen < cmlen)
+				cmlen = kmsg->msg_controllen;
 			kmsg->msg_control += cmlen;
 			kmsg->msg_controllen -= cmlen;
 		}
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ