[PATCH net] netlabel: cope with NULL catmap

David Miller davem at davemloft.net
Wed May 13 01:13:42 UTC 2020

From: Paolo Abeni <pabeni at redhat.com>
Date: Tue, 12 May 2020 14:43:14 +0200

> The cipso and calipso code can set the MLS_CAT attribute on
> successful parsing, even if the corresponding catmap has
> not been allocated, as per current configuration and external
> input.
> Later, selinux code tries to access the catmap if the MLS_CAT flag
> is present via netlbl_catmap_getlong(). That may cause null ptr
> dereference while processing incoming network traffic.
> Address the issue setting the MLS_CAT flag only if the catmap is
> really allocated. Additionally let netlbl_catmap_getlong() cope
> with NULL catmap.
> Reported-by: Matthew Sheets <matthew.sheets at gd-ms.com>
> Fixes: 4b8feff251da ("netlabel: fix the horribly broken catmap functions")
> Fixes: ceba1832b1b2 ("calipso: Set the calipso socket label to match the secattr.")
> Signed-off-by: Paolo Abeni <pabeni at redhat.com>

Applied and queued up for -stable, thanks.

More information about the Linux-security-module-archive mailing list