Thread (4 messages) 4 messages, 4 authors, 2017-06-30

[PATCH] selinux: return -ENOMEM if kzalloc() fails

From: penguin-kernel@I-love.SAKURA.ne.jp (Tetsuo Handa)
Date: 2017-06-30 13:10:46
Also in: kernel-janitors, selinux

Stephen Smalley wrote:
On Fri, 2017-06-30 at 10:56 +0300, Dan Carpenter wrote:
quoted
We accidentally return success instead of -ENOMEM on this failure
path.

Fixes: 409dcf31538a ("selinux: Add a cache for quicker retreival of
PKey SIDs")
Signed-off-by: Dan Carpenter <redacted>
NAK, that's intentional.  See the comment just above the code in
question.
If allocation failure is no problem, please consider using
GFP_NOWAIT | __GFP_NOMEMALLOC | __GFP_NOWARN instead of
GFP_ATOMIC, for memory reserves is mainly targeted for OOM victims.
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help