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, 25 Jun 2020 14:46:57 +0300
From:   Dmitry Yakunin <zeil@...dex-team.ru>
To:     dsahern@...il.com, netdev@...r.kernel.org
Subject: [PATCH iproute2-next] lib: fix checking of returned file handle size for cgroup

Before this patch check is happened only in case when we try to find
cgroup at cgroup2 mount point.

Signed-off-by: Dmitry Yakunin <zeil@...dex-team.ru>
---
 lib/fs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/fs.c b/lib/fs.c
index e265fc0..4b90a70 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -148,10 +148,10 @@ __u64 get_cgroup2_id(const char *path)
 					strerror(errno));
 			goto out;
 		}
-		if (fhp->handle_bytes != sizeof(__u64)) {
-			fprintf(stderr, "Invalid size of cgroup2 ID\n");
-			goto out;
-		}
+	}
+	if (fhp->handle_bytes != sizeof(__u64)) {
+		fprintf(stderr, "Invalid size of cgroup2 ID\n");
+		goto out;
 	}
 
 	memcpy(cg_id.bytes, fhp->f_handle, sizeof(__u64));
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ