Re: [PATCH] virtio-console: avoid DMA from stack

2017-03-02 Thread Jan Dakinevich
I also faced with the same issue. Could you clarify it for me whether it is safe to allocate memory inside console driver handler? For example, what would happen if put_chars was triggered by fail in another memory allocation? On 02/01/2017 11:02 AM, Omar Sandoval wrote: > From: Omar Sandoval >

Re: [PATCH] virtio-console: avoid DMA from stack

2017-03-01 Thread Michael S. Tsirkin
On Wed, Mar 01, 2017 at 12:01:10PM -0800, Omar Sandoval wrote: > On Wed, Feb 01, 2017 at 07:17:12PM +0530, Amit Shah wrote: > > On (Wed) 01 Feb 2017 [00:02:27], Omar Sandoval wrote: > > > From: Omar Sandoval > > > > > > put_chars() stuffs the buffer it gets into an sg, but that buffer may be > >

Re: [PATCH] virtio-console: avoid DMA from stack

2017-03-01 Thread Omar Sandoval
On Wed, Feb 01, 2017 at 07:17:12PM +0530, Amit Shah wrote: > On (Wed) 01 Feb 2017 [00:02:27], Omar Sandoval wrote: > > From: Omar Sandoval > > > > put_chars() stuffs the buffer it gets into an sg, but that buffer may be > > on the stack. This breaks with CONFIG_VMAP_STACK=y (for me, it > > manife

Re: [PATCH] virtio-console: avoid DMA from stack

2017-02-01 Thread Amit Shah
On (Wed) 01 Feb 2017 [00:02:27], Omar Sandoval wrote: > From: Omar Sandoval > > put_chars() stuffs the buffer it gets into an sg, but that buffer may be > on the stack. This breaks with CONFIG_VMAP_STACK=y (for me, it > manifested as printks getting turned into NUL bytes). Seems reasonable. I w

[PATCH] virtio-console: avoid DMA from stack

2017-02-01 Thread Omar Sandoval
From: Omar Sandoval put_chars() stuffs the buffer it gets into an sg, but that buffer may be on the stack. This breaks with CONFIG_VMAP_STACK=y (for me, it manifested as printks getting turned into NUL bytes). Signed-off-by: Omar Sandoval --- Patch based on v4.10-rc6. drivers/char/virtio_cons