linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Blackfin: strncpy: fix handling of zero lengths
@ 2011-06-03 15:09 Mike Frysinger
  2011-06-03 22:32 ` [stable] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2011-06-03 15:09 UTC (permalink / raw)
  To: uclinux-dist-devel; +Cc: linux-kernel, stable, Steven Miao

From: Steven Miao <realmz6@gmail.com>

The jump to 4f will cause the NUL padding loop to run at least one time,
so if string length is zero just jump to the end.  Otherwise we wrongly
write one NUL byte when size==0.

Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/blackfin/lib/strncpy.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/lib/strncpy.S b/arch/blackfin/lib/strncpy.S
index f3931d5..2c07ddd 100644
--- a/arch/blackfin/lib/strncpy.S
+++ b/arch/blackfin/lib/strncpy.S
@@ -25,7 +25,7 @@
 
 ENTRY(_strncpy)
 	CC = R2 == 0;
-	if CC JUMP 4f;
+	if CC JUMP 6f;
 
 	P2 = R2 ;       /* size */
 	P0 = R0 ;       /* dst*/
-- 
1.7.5.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [stable] [PATCH] Blackfin: strncpy: fix handling of zero lengths
  2011-06-03 15:09 [PATCH] Blackfin: strncpy: fix handling of zero lengths Mike Frysinger
@ 2011-06-03 22:32 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2011-06-03 22:32 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: uclinux-dist-devel, Steven Miao, linux-kernel, stable

On Fri, Jun 03, 2011 at 11:09:22AM -0400, Mike Frysinger wrote:
> From: Steven Miao <realmz6@gmail.com>
> 
> The jump to 4f will cause the NUL padding loop to run at least one time,
> so if string length is zero just jump to the end.  Otherwise we wrongly
> write one NUL byte when size==0.
> 
> Signed-off-by: Steven Miao <realmz6@gmail.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  arch/blackfin/lib/strncpy.S |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>


<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-03 22:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-03 15:09 [PATCH] Blackfin: strncpy: fix handling of zero lengths Mike Frysinger
2011-06-03 22:32 ` [stable] " Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).