From: Kyle McMartin <kyle@redhat.com>
To: Will Deacon <will.deacon@arm.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Catalin Marinas <Catalin.Marinas@arm.com>
Subject: Re: [PATCH] arm64: fix strnlen_user when count <= strlen
Date: Fri, 17 Jan 2014 11:22:52 -0500 [thread overview]
Message-ID: <20140117162252.GR18705@redacted.bos.redhat.com> (raw)
In-Reply-To: <20140117105107.GC16003@mudshark.cambridge.arm.com>
On Fri, Jan 17, 2014 at 10:51:07AM +0000, Will Deacon wrote:
> Actually, I have removed strnlen_user for 3.14. Could you try your test case
> with our for-next branch please?
>
> git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
>
This will work fine, I believe (I can't easily test on HW since we're
dependent on $vendor drivers that aren't upstream yet) but in my testing
yesterday I parroted the x86 word-at-a-time.h and lib/strnlen_user.c and
that seemed to work.
> As for the issue you spotted, we probably need a fix for that to go into
> stable kernels. Does the following (smaller patch) work for you?
>
This gets the count == 0 case wrong still, I believe.
=== count = 0 ===
strnlen_user = 0
__strnlen_user = 1
(Where strnlen_user is the lib/strnlen_user.c implementation.)
Testing if (n <= 0) return 0; before __strnlen_user fixes it though.
Given this is called in, I think, only two places in the kernel, maybe
we should just backport the switch to generic for stable? I can't
imagine it conflicting with anything.
regards, Kyle
> Will
>
> --->8
>
> diff --git a/arch/arm64/lib/strnlen_user.S b/arch/arm64/lib/strnlen_user.S
> index 7f7b176a5646..73f3335a2a45 100644
> --- a/arch/arm64/lib/strnlen_user.S
> +++ b/arch/arm64/lib/strnlen_user.S
> @@ -37,6 +37,7 @@ ENTRY(__strnlen_user)
> USER(9f, ldrb w3, [x0], #1 )
> cbnz w3, 1b
> 2: sub x0, x0, x2
> + cinc x0, x0, mi
> ret
> ENDPROC(__strnlen_user)
>
prev parent reply other threads:[~2014-01-17 16:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 23:48 Kyle McMartin
2014-01-17 10:51 ` Will Deacon
2014-01-17 16:22 ` Kyle McMartin [this message]
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=20140117162252.GR18705@redacted.bos.redhat.com \
--to=kyle@redhat.com \
--cc=Catalin.Marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=will.deacon@arm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome