Skip to content

Commit 4458bba

Browse files
Tetsuo Handapcmoore
Tetsuo Handa
authored andcommitted
selinux: Add __GFP_NOWARN to allocation at str_read()
syzbot is hitting warning at str_read() [1] because len parameter can become larger than KMALLOC_MAX_SIZE. We don't need to emit warning for this case. [1] https://syzkaller.appspot.com/bug?id=7f2f5aad79ea8663c296a2eedb81978401a908f0 Signed-off-by: Tetsuo Handa <[email protected]> Reported-by: syzbot <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 95ffe19 commit 4458bba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/selinux/ss/policydb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ static int str_read(char **strp, gfp_t flags, void *fp, u32 len)
11011101
if ((len == 0) || (len == (u32)-1))
11021102
return -EINVAL;
11031103

1104-
str = kmalloc(len + 1, flags);
1104+
str = kmalloc(len + 1, flags | __GFP_NOWARN);
11051105
if (!str)
11061106
return -ENOMEM;
11071107

0 commit comments

Comments
 (0)