Commit eda378a0 authored by Ryan Lee's avatar Ryan Lee Committed by Greg Kroah-Hartman
Browse files

apparmor: ensure WB_HISTORY_SIZE value is a power of 2



[ Upstream commit 6c055e62 ]

WB_HISTORY_SIZE was defined to be a value not a power of 2, despite a
comment in the declaration of struct match_workbuf stating it is and a
modular arithmetic usage in the inc_wb_pos macro assuming that it is. Bump
WB_HISTORY_SIZE's value up to 32 and add a BUILD_BUG_ON_NOT_POWER_OF_2
line to ensure that any future changes to the value of WB_HISTORY_SIZE
respect this requirement.

Fixes: 136db994 ("apparmor: increase left match history buffer size")

Signed-off-by: default avatarRyan Lee <ryan.lee@canonical.com>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 77d2993d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment