Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753343AbbD0Xfj (ORCPT ); Mon, 27 Apr 2015 19:35:39 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:46592 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752574AbbD0Xfh (ORCPT ); Mon, 27 Apr 2015 19:35:37 -0400 Subject: [PATCH] MIPS: R6: memcpy bugfix - zero length overwrites memory From: Leonid Yegoshin To: , , , Date: Mon, 27 Apr 2015 16:35:29 -0700 Message-ID: <20150427233529.4423.20839.stgit@ubuntu-yegoshin> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.20.3.79] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 810 Lines: 27 MIPS R6 version of memcpy has bug - then length to copy is zero and addresses are not aligned then it can overwrite a whole memory. Signed-off-by: Leonid Yegoshin --- arch/mips/lib/memcpy.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S index 9245e1705e69..7e0250f3aec8 100644 --- a/arch/mips/lib/memcpy.S +++ b/arch/mips/lib/memcpy.S @@ -514,6 +514,8 @@ #ifdef CONFIG_CPU_MIPSR6 .Lcopy_unaligned_bytes\@: + beqz len, .Ldone\@ + nop 1: COPY_BYTE(0) COPY_BYTE(1) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/