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: <alpine.DEB.2.22.394.2008201218350.2524@hadrien>
Date:   Thu, 20 Aug 2020 12:20:51 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...ia.fr>
To:     Stephen Smalley <stephen.smalley.work@...il.com>
cc:     kbuild-all@...ts.01.org, selinux@...r.kernel.org,
        Paul Moore <paul@...l-moore.com>,
        Eric Paris <eparis@...isplace.org>,
        Ondrej Mosnacek <omosnace@...hat.com>,
        Tom Rix <trix@...hat.com>,
        Ethan Edwards <ethancarteredwards@...il.com>,
        Wei Yongjun <weiyongjun1@...wei.com>, selinux@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] selinux: fix memdup.cocci warnings

From: kernel test robot <lkp@...el.com>

Use kmemdup rather than duplicating its implementation

Generated by: scripts/coccinelle/api/memdup.cocci

Fixes: c7c556f1e81b ("selinux: refactor changing booleans")
CC: Stephen Smalley <stephen.smalley.work@...il.com>
Signed-off-by: kernel test robot <lkp@...el.com>
Signed-off-by: Julia Lawall <julia.lawall@...ia.fr>

---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git next
head:   37ea433c66070fcef09c6d118492c36299eb72ba
commit: c7c556f1e81bb9e09656ed6650d0c44c84b7c016 [4/6] selinux: refactor changing booleans
:::::: branch date: 4 hours ago
:::::: commit date: 2 days ago

 conditional.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/security/selinux/ss/conditional.c
+++ b/security/selinux/ss/conditional.c
@@ -686,12 +686,11 @@ static int cond_bools_copy(struct hashta
 {
 	struct cond_bool_datum *datum;

-	datum = kmalloc(sizeof(struct cond_bool_datum), GFP_KERNEL);
+	datum = kmemdup(orig->datum, sizeof(struct cond_bool_datum),
+			GFP_KERNEL);
 	if (!datum)
 		return -ENOMEM;

-	memcpy(datum, orig->datum, sizeof(struct cond_bool_datum));
-
 	new->key = orig->key; /* No need to copy, never modified */
 	new->datum = datum;
 	return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ