Skip to content
Commit 41c3bd20 authored by Paul Moore's avatar Paul Moore
Browse files

netlabel: fix a problem when setting bits below the previously lowest bit



The NetLabel category (catmap) functions have a problem in that they
assume categories will be set in an increasing manner, e.g. the next
category set will always be larger than the last.  Unfortunately, this
is not a valid assumption and could result in problems when attempting
to set categories less than the startbit in the lowest catmap node.
In some cases kernel panics and other nasties can result.

This patch corrects the problem by checking for this and allocating a
new catmap node instance and placing it at the front of the list.

Cc: stable@vger.kernel.org
Reported-by: default avatarChristian Evans <frodox@zoho.com>
Signed-off-by: default avatarPaul Moore <pmoore@redhat.com>
Tested-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
parent 615e51fd
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment