Patch "tomoyo: don't emit warning in tomoyo_write_control()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tomoyo: don't emit warning in tomoyo_write_control()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tomoyo-don-t-emit-warning-in-tomoyo_write_control.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 01921fab3cb2ede093f584ca7d348d211516dfb6
Author: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Date:   Mon Dec 16 19:38:40 2024 +0900

    tomoyo: don't emit warning in tomoyo_write_control()
    
    [ Upstream commit 3df7546fc03b8f004eee0b9e3256369f7d096685 ]
    
    syzbot is reporting too large allocation warning at tomoyo_write_control(),
    for one can write a very very long line without new line character. To fix
    this warning, I use __GFP_NOWARN rather than checking for KMALLOC_MAX_SIZE,
    for practically a valid line should be always shorter than 32KB where the
    "too small to fail" memory-allocation rule applies.
    
    One might try to write a valid line that is longer than 32KB, but such
    request will likely fail with -ENOMEM. Therefore, I feel that separately
    returning -EINVAL when a line is longer than KMALLOC_MAX_SIZE is redundant.
    There is no need to distinguish over-32KB and over-KMALLOC_MAX_SIZE.
    
    Reported-by: syzbot+7536f77535e5210a5c76@xxxxxxxxxxxxxxxxxxxxxxxxx
    Closes: https://syzkaller.appspot.com/bug?extid=7536f77535e5210a5c76
    Reported-by: Leo Stone <leocstone@xxxxxxxxx>
    Closes: https://lkml.kernel.org/r/20241216021459.178759-2-leocstone@xxxxxxxxx
    Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 6235c3be832aa..e23993c784405 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -2673,7 +2673,7 @@ ssize_t tomoyo_write_control(struct tomoyo_io_buffer *head,
 
 		if (head->w.avail >= head->writebuf_size - 1) {
 			const int len = head->writebuf_size * 2;
-			char *cp = kzalloc(len, GFP_NOFS);
+			char *cp = kzalloc(len, GFP_NOFS | __GFP_NOWARN);
 
 			if (!cp) {
 				error = -ENOMEM;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux