All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Vyukov <dvyukov@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "David Hildenbrand" <david@redhat.com>,
	"Nick Desaulniers" <nick.desaulniers@gmail.com>,
	syzbot
	<bot+eb276410a47365e399ee50d68e73650cac178e0f@syzkaller.appspotmail.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"KVM list" <kvm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Lorenzo Stoakes" <lstoakes@gmail.com>,
	"Michal Hocko" <mhocko@suse.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	syzkaller-bugs@googlegroups.com,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"the arch/x86 maintainers" <x86@kernel.org>
Subject: Re: BUG: sleeping function called from invalid context at ./include/linux/uaccess.h:LINE
Date: Tue, 7 Nov 2017 13:44:43 +0100	[thread overview]
Message-ID: <CACT4Y+aQEkT2TnGbs3VZu42e1EKcM8M_Q=VGZveZH-dLkOXSrg@mail.gmail.com> (raw)
In-Reply-To: <890dcad0-800a-e840-be7f-90c709831741@redhat.com>

On Tue, Nov 7, 2017 at 1:29 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>>> Does it have to be stack allocated?
>>>>
>>>> We can't use kmalloc and friends in emulate.c. We would have to
>>>> introduce new emulator callbacks.
>>>>
>>>> a) for malloc and free. hmmm.
>>>> b) for carrying out the fxrstr/fixup.
>>>>
>>>> Paolo, what do you suggest?
>>>
>>> You can use kmalloc.  Any userspace user of emulate.c would have to
>>> write a wrapper.
>>
>>
>> Can you please tell me more about this? Is it used for testing? Is
>> there an example code that builds and tests this in user-space?
>
> Not quite, there's no user outside KVM yet.  But the emulator code is
> designed to be independent from KVM's memory access primitives; with
> "nm" you can see how there are very few undefined symbols:
>
>                  U ex_handler_default
>                  U find_first_bit
>                  U find_next_bit
>                  U memcpy
>                  U printk
>
> Exceptions are only used for div/idiv, if it gets in the way it's okay
> to just revert commit b8c0b6ae498f ("KVM: x86 emulator: convert DIV/IDIV
> to fastop", 2013-05-21).
>
> On the other hand, dependencies on Linux headers have sneaked in more
> and more, but refactoring those away should not be too hard.


Thanks for the info. We may be potentially interested in fuzzing this
in user-space.

  reply	other threads:[~2017-11-07 12:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 11:34 BUG: sleeping function called from invalid context at ./include/linux/uaccess.h:LINE syzbot
2017-10-31 11:34 ` syzbot
2017-11-06 11:51 ` David Hildenbrand
2017-11-06 11:51   ` David Hildenbrand
     [not found]   ` <CAH7mPvjcQ8esFKY7VobmRt2RcHJLApn+Sd4sigAzeSuZWSzyhg@mail.gmail.com>
2017-11-06 16:01     ` David Hildenbrand
2017-11-06 16:01       ` David Hildenbrand
2017-11-06 16:14       ` Paolo Bonzini
2017-11-06 16:14         ` Paolo Bonzini
2017-11-06 16:19         ` David Hildenbrand
2017-11-06 16:19           ` David Hildenbrand
2017-11-06 16:37           ` Paolo Bonzini
2017-11-06 16:37             ` Paolo Bonzini
2017-11-06 16:46             ` David Hildenbrand
2017-11-06 16:46               ` David Hildenbrand
2017-11-06 19:04         ` Dmitry Vyukov
2017-11-07 12:29           ` Paolo Bonzini
2017-11-07 12:44             ` Dmitry Vyukov [this message]
2018-01-26 21:11   ` Eric Biggers

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='CACT4Y+aQEkT2TnGbs3VZu42e1EKcM8M_Q=VGZveZH-dLkOXSrg@mail.gmail.com' \
    --to=dvyukov@google.com \
    --cc=borntraeger@de.ibm.com \
    --cc=bot+eb276410a47365e399ee50d68e73650cac178e0f@syzkaller.appspotmail.com \
    --cc=david@redhat.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lstoakes@gmail.com \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=nick.desaulniers@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.