mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
selinux: add __GFP_NOWARN to hashtab_init() allocations
As reported by syzbot, hashtab_init() can be affected by abnormally large policy loads which would cause the kernel's allocator to emit a warning in some configurations. Since the SELinux hashtab_init() code handles the case where the allocation fails, due to a large request or some other reason, we can safely add the __GFP_NOWARN flag to squelch these abnormally large allocation warnings. Reported-by: syzbot+bc2c99c2929c3d219fb3@syzkaller.appspotmail.com Tested-by: syzbot+bc2c99c2929c3d219fb3@syzkaller.appspotmail.com Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
951b2de06a
commit
9ab71d9204
1 changed files with 2 additions and 1 deletions
|
|
@ -40,7 +40,8 @@ int hashtab_init(struct hashtab *h, u32 nel_hint)
|
|||
h->htable = NULL;
|
||||
|
||||
if (size) {
|
||||
h->htable = kcalloc(size, sizeof(*h->htable), GFP_KERNEL);
|
||||
h->htable = kcalloc(size, sizeof(*h->htable),
|
||||
GFP_KERNEL | __GFP_NOWARN);
|
||||
if (!h->htable)
|
||||
return -ENOMEM;
|
||||
h->size = size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue