OSDN Git Service

netlabel: fix shift wrapping bug in netlbl_catmap_setlong()
authorDmitry Mastykin <dmastykin@astralinux.ru>
Thu, 8 Jun 2023 13:57:54 +0000 (16:57 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jun 2023 18:54:06 +0000 (19:54 +0100)
commitb403643d154d15176b060b82f7fc605210033edd
tree0197cdad58ee677b218e74f14cb5d62de5766cab
parent14df9526046d2a6d2b3e002e952714ce04fc9bd7
netlabel: fix shift wrapping bug in netlbl_catmap_setlong()

There is a shift wrapping bug in this code on 32-bit architectures.
NETLBL_CATMAP_MAPTYPE is u64, bitmap is unsigned long.
Every second 32-bit word of catmap becomes corrupted.

Signed-off-by: Dmitry Mastykin <dmastykin@astralinux.ru>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlabel/netlabel_kapi.c