lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190308195302.popw53eqeoozg53r@treble>
Date:   Fri, 8 Mar 2019 13:53:02 -0600
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     torvalds@...ux-foundation.org, tglx@...utronix.de, hpa@...or.com,
        julien.thierry@....com, will.deacon@....com, luto@...capital.net,
        mingo@...nel.org, catalin.marinas@....com, james.morse@....com,
        valentin.schneider@....com, brgerst@...il.com, luto@...nel.org,
        bp@...en8.de, dvlasenk@...hat.com, linux-kernel@...r.kernel.org,
        dvyukov@...gle.com, rostedt@...dmis.org
Subject: Re: [PATCH 03/20] x86/uaccess: Move copy_user_handle_tail into asm

On Fri, Mar 08, 2019 at 08:48:35PM +0100, Peter Zijlstra wrote:
> On Fri, Mar 08, 2019 at 12:53:21PM -0600, Josh Poimboeuf wrote:
> > On Thu, Mar 07, 2019 at 12:45:14PM +0100, Peter Zijlstra wrote:
> > >  /*
> > > + * Try to copy last bytes and clear the rest if needed.
> > > + * Since protection fault in copy_from/to_user is not a normal situation,
> > > + * it is not necessary to optimize tail handling.
> > > + *
> > > + * Input:
> > > + * rdi destination
> > > + * rsi source
> > > + * rdx count
> > > + *
> > > + * Output:
> > > + * eax uncopied bytes or 0 if successful.
> > > + */
> > > +ALIGN;
> > > +copy_user_handle_tail:
> > > +	movl %edx,%ecx
> > > +1:	rep movsb
> > > +2:	mov %ecx,%eax
> > > +	ASM_CLAC
> > > +	ret
> > > +
> > > +	_ASM_EXTABLE_UA(1b, 2b)
> > > +ENDPROC(copy_user_handle_tail)
> > 
> > This is an unstructured piece of code rather than a callable function,
> > END would probably be more appropriate.  Or maybe it should just be a
> > local label (.Lcopy_user_handle_tail) because I don't think the
> > alignment and ELF symbol size are even needed.
> 
> ENDPROC makes it STT_FUNC and gets us stricter AC tests.

How so?  I would have thought the opposite.  Doesn't objtool only follow
a jump if its destination is to a non-function?  Otherwise it's
considered a sibling call.

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ