From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Amit Shah <amit@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Thomas Gleixner <tglx@kernel.org>,
linux-kernel@vger.kernel.org, virtualization@lists.linux.dev,
Sungho Bae <baver.bae@lge.com>
Subject: Re: [PATCH] virtio_console: Fix alloc_buf(.gfp) usage
Date: Sat, 29 Aug 2026 08:14:47 +0200 [thread overview]
Message-ID: <2026082929-steep-clumsily-3f5e@gregkh> (raw)
In-Reply-To: <20260828153706.GR687043@noisy.programming.kicks-ass.net>
On Fri, Aug 28, 2026 at 05:37:06PM +0200, Peter Zijlstra wrote:
>
> Commit fc220d6be3c7 ("virtio_console: refactor __send_to_port() buffer
> ownership") added a .gfp argument to alloc_buf(), but forgot to convert
> all allocation calls.
>
> The result is that any GFP_ATOMIC calls, such as those from:
>
> hvc_console_print()
> put_chars()
> alloc_buf(.gfp = GFP_ATOMIC)
>
> will trip the might_sleep_if() check when used from an atomic context.
>
> Fixes: fc220d6be3c7 ("virtio_console: refactor __send_to_port() buffer
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>
> diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
> index 62eecfa61646..7f6cbe851d1e 100644
> --- a/drivers/char/virtio_console.c
> +++ b/drivers/char/virtio_console.c
> @@ -426,7 +426,7 @@ static struct port_buffer *alloc_buf(struct virtio_device *vdev, size_t buf_size
> * Allocate buffer and the sg list. The sg list array is allocated
> * directly after the port_buffer struct.
> */
> - buf = kmalloc_flex(*buf, sg, pages);
> + buf = kmalloc_flex(*buf, sg, pages, gfp);
> if (!buf)
> goto fail;
>
Sorry about that, will grab it after -rc1 is out.
thanks,
greg k-h
prev parent reply other threads:[~2026-08-29 6:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 15:37 Peter Zijlstra
2026-08-29 6:14 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026082929-steep-clumsily-3f5e@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=amit@kernel.org \
--cc=arnd@arndb.de \
--cc=baver.bae@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@kernel.org \
--cc=virtualization@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®