Skip to content
Snippets Groups Projects
Commit 76ba89c7 authored by Colin Ian King's avatar Colin Ian King Committed by James Morris
Browse files

commoncap: move assignment of fs_ns to avoid null pointer dereference


The pointer fs_ns is assigned from inode->i_ib->s_user_ns before
a null pointer check on inode, hence if inode is actually null we
will get a null pointer dereference on this assignment. Fix this
by only dereferencing inode after the null pointer check on
inode.

Detected by CoverityScan CID#1455328 ("Dereference before null check")

Fixes: 8db6c34f ("Introduce v3 namespaced file capabilities")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Cc: stable@vger.kernel.org
Acked-by: default avatarSerge Hallyn <serge@hallyn.com>
Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
parent 494b9ae7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment