Skip to content

Commit

Permalink
kernel: fix out of bound reading. close #1227
Browse files Browse the repository at this point in the history
  • Loading branch information
tiann committed Dec 27, 2023
1 parent fe7f509 commit d6cbda4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/allowlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ void ksu_prune_allowlist(bool (*is_uid_valid)(uid_t, char *, void *), void *data
modified = true;
pr_info("prune uid: %d, package: %s\n", uid, package);
list_del(&np->list);
allow_list_bitmap[uid / BITS_PER_BYTE] &= ~(1 << (uid % BITS_PER_BYTE));
if (likely(uid <= BITMAP_UID_MAX)) {
allow_list_bitmap[uid / BITS_PER_BYTE] &= ~(1 << (uid % BITS_PER_BYTE));
}
remove_uid_from_arr(uid);
smp_mb();
kfree(np);
Expand Down

0 comments on commit d6cbda4

Please sign in to comment.