lkml.org 
[lkml]   [2008]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: KVM overflows the stack
From
Date
On Wed, 2008-07-16 at 23:08 -0700, Roland Dreier wrote:
> > Yes, things like kvm_lapic_state are way too big to be on the
> stack.
>
> I had a quick look at the code, and my worry about dynamic allocation
> would be that handling allocation failure seems like it might get
> tricky. Eg for handling struct kvm_pv_mmu_op_buffer (which is 528 bytes
> on the stack in kvm_pv_mmu_op()) can you deal with an mmu op failing?

Well, you *better* be able to deal with it. :)

This code is also doing a *ton* of copy_to/from_user(). If userspace
had one of its input buffers swapped out (or one of its output buffers
not faulted in yet) and we're out of memory enough to be failing
kmallocs() then we're sure as heck also going to failing the user
copies.

I think it's a non-issue.

-- Dave



\
 
 \ /
  Last update: 2008-07-17 16:09    [W:0.353 / U:1.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site