Thread (21 messages) flat view 21 messages, 6 authors, 2021-08-10

Re: [syzbot] BUG: sleeping function called from invalid context in _copy_to_iter

From: Al Viro <viro@zeniv.linux.org.uk>
Date: 2021-08-09 20:04:51
Also in: bpf, linux-kselftest, lkml

On Mon, Aug 09, 2021 at 12:40:03PM -0700, Shoaib Rao wrote:
Page faults occur all the time, the page may not even be in the cache or the
mapping is not there (mmap), so I would not consider this a bug. The code
should complain about all other calls as they are also copying  to user
pages. I must not be following some semantics for the code to be triggered
but I can not figure that out. What is the recommended interface to do user
copy from kernel?
	What are you talking about?  Yes, page faults happen.  No, they
must not be triggered in contexts when you cannot afford going to sleep.
In particular, you can't do that while holding a spinlock.

	There are things that can't be done under a spinlock.  If your
commit is attempting that, it's simply broken.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help