All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Dave Jones <davej@redhat.com>, Michal Hocko <mhocko@suse.cz>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: Hang on large copy_from_user with PREEMPT_NONE
Date: Mon, 6 Apr 2015 18:52:36 +0200	[thread overview]
Message-ID: <20150406165236.GE4078@pd.tnic> (raw)
In-Reply-To: <55229D7E.6080309@oracle.com>

On Mon, Apr 06, 2015 at 10:51:42AM -0400, Sasha Levin wrote:
> > Btw, what's happening to that user pointer in %rdi, is it kosher?
> 
> Probably not. Trinity passes random addresses into that syscall, so it's probably one of it's magic
> values.

So what is the expectation? If that pointer goes away from under us,
userspace is supposed to get some signal instead of hanging?

> I've attached dmesg with debug-alternative, and my .config. vmlinux is pretty
> large (1GB compressed) so hopefully the config would be enough - let me know
> if it isn't.

Thanks, I'll give it a try and do some staring tomorrow. Still a holiday
today here :-)

> > Btw, that zerorest is being tested on every loop iteration! AFAICT,
> > 
> > 	if (!zerorest) {
> > 		clac();
> > 		return len;
> > 	}
> > 
> > before the loop should be nicer. Or am I missing something?
> 
> Looks good to me. I suspect the compiler optimizes that anyway though.

Yeah, doesn't look like it. See the

	e:   85 c9                   test   %ecx,%ecx

?

That's:

---
	testl	%esi, %esi	# __pu_err
	je	.L34	#,
.L21:
	testl	%ecx, %ecx	# zerorest		<---
	je	.L33	#,
	movl	%edx, %eax	# len, len
	xorl	%r8d, %r8d	# tmp194
	jmp	.L27	#
	.p2align 4,,7
	.p2align 3
.L35:
	decl	%eax	# len
	movq	%rsi, %rdi	# to, to
	je	.L33	#,
.L27:
	leaq	1(%rdi), %rsi	#, to
---

and my asm is not so different from yours so that I can match your asm
with the .s output here.

Anyway, that's a different story, I'll do a fix for it.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

  reply	other threads:[~2015-04-06 16:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06  3:59 Hang on large copy_from_user with PREEMPT_NONE Sasha Levin
2015-04-06 11:24 ` Borislav Petkov
2015-04-06 14:51   ` Sasha Levin
2015-04-06 16:52     ` Borislav Petkov [this message]
2015-04-06 17:26 ` Linus Torvalds
2015-04-06 19:08   ` Sasha Levin
2015-04-06 19:36     ` Borislav Petkov
2015-04-06 23:45       ` Sasha Levin
2015-04-06 20:42     ` Linus Torvalds
2015-04-07  1:49       ` Rusty Russell
2015-04-07  9:31       ` Ingo Molnar
2015-04-07 10:39         ` Borislav Petkov
2015-04-07 11:05           ` Ingo Molnar
2015-04-07 14:30             ` Michal Hocko
2015-04-07 14:37               ` Ingo Molnar
2015-04-07 17:00                 ` Sasha Levin
2015-04-07 17:33                   ` Linus Torvalds
2015-04-07 17:58                     ` Dave Jones
     [not found]                       ` <CA+55aFyxCb9aDfh0L4gyvHMSefOFoD7zftRpWbnvf5j9iZVaMw@mail.gmail.com>
2015-04-07 21:09                         ` Dave Jones

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=20150406165236.GE4078@pd.tnic \
    --to=bp@alien8.de \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=rusty@rustcorp.com.au \
    --cc=sasha.levin@oracle.com \
    --cc=torvalds@linux-foundation.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.