[PATCH] security/keys/*: user kmemdup()
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
7cf9c2c76c
commit
48ad504ee7
@@ -706,12 +706,10 @@ int __key_link(struct key *keyring, struct key *key)
|
||||
BUG_ON(size > PAGE_SIZE);
|
||||
|
||||
ret = -ENOMEM;
|
||||
nklist = kmalloc(size, GFP_KERNEL);
|
||||
nklist = kmemdup(klist, size, GFP_KERNEL);
|
||||
if (!nklist)
|
||||
goto error2;
|
||||
|
||||
memcpy(nklist, klist, size);
|
||||
|
||||
/* replace matched key */
|
||||
atomic_inc(&key->usage);
|
||||
nklist->keys[loop] = key;
|
||||
|
Reference in New Issue
Block a user