OSDN Git Service

selinux: make left shifts well defined
authorChristian Göttsche <cgzones@googlemail.com>
Mon, 7 Aug 2023 17:11:38 +0000 (19:11 +0200)
committerPaul Moore <paul@paul-moore.com>
Wed, 9 Aug 2023 23:07:48 +0000 (19:07 -0400)
commitaa4b60518280834529f75cb7667ffac91967abea
treee8aa4d49996aeae2c492804a1b0b222fef180ab6
parent002903e1d10fd8c9e215d88e0c71f609a4af5755
selinux: make left shifts well defined

The loops upper bound represent the number of permissions used (for the
current class or in general).  The limit for this is 32, thus we might
left shift of one less, 31.  Shifting a base of 1 results in undefined
behavior; use (u32)1 as base.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/services.c