From: Dan Carpenter <hidden> Date: 2017-06-30 07:56:26
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>
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
From: Stephen Smalley <hidden> Date: 2017-06-30 12:48:14
On Fri, 2017-06-30 at 10:56 +0300, Dan Carpenter wrote:
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.
@@ -160,8 +160,10 @@ static int sel_ib_pkey_sid_slow(u64
subnet_prefix, u16 pkey_num, u32 *sid)
? ?* is valid, it just won't be added to the cache.
? ?*/
? new = kzalloc(sizeof(*new), GFP_ATOMIC);
- if (!new)
+ if (!new) {
+ ret = -ENOMEM;
? goto out;
+ }
?
? new->psec.subnet_prefix = subnet_prefix;
? new->psec.pkey = pkey_num;
--
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
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
From: Paul Moore <paul@paul-moore.com> Date: 2017-06-30 22:30:19
On Fri, Jun 30, 2017 at 9:10 AM, Tetsuo Handa
[off-list ref] wrote:
Stephen Smalley wrote:
quoted
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.
I have a todo item to try and consolidate some of the SELinux object
cache code, this seems like something worth experimenting with when
that happens.
--
paul moore
www.paul-moore.com
--
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