Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp899077imu; Tue, 11 Dec 2018 09:15:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vws3dvZLdUXxd8TFznfvcC7/6RTaZoavQZn5S5wtJX7ue1Ae7BV46T6GMJ9r3z+1bfHABI X-Received: by 2002:a65:49cd:: with SMTP id t13mr15508794pgs.376.1544548513671; Tue, 11 Dec 2018 09:15:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544548513; cv=none; d=google.com; s=arc-20160816; b=r0IegyQRFYITsd5SswaJVLD2oxvCz7VaWqae8RsF/pFZHM9yoAvIn7a/1tMpF3rbWI x9QSCAj/c8NZzqArkIgX8UreabDn0eDNJYUqO7DiljF1tj+HKwcaLcDcWx5+7QSO3mXJ X1xhzuDGokVRv34ie2rg0vWrC3czlOubs2ayUoajw8AGJgeLf2D4UhwTxRDgr9EXTBR7 4mMmxgIrvKMsxTPM2wayQO9lWnxjo0Fw4wHaZILsga3d8JZeVkE4+nXxY91Y8yl9wOkI 5sI+Xi76eH7QvofWmB956kKesuo/tADoPE5E2vzCWwc0Bo1BKLN2L7WY7uoclZHh5/o5 a97Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0BSZe7VcUCt++8bVCme2ixLrwJt9gviMcmeCLmJa0i0=; b=bNnjtRuiP4TYrVkvjd/mN50cGN3Zsl12+5zacoCn37He92pJTsSjZTiKoy3eMsOgSa OySgVk06vRxfY7iU5diqgkL39F1A9qzYtXdT9Yo1niTSvgTpQOMRD5PQCZgvd7St9T5N GNsG+rBfdGdfVI7cko+hcBlAJBrWPHSbx1mGq5e6UWhfNCsfOtdecUWamatns0jtR1dY 0XbXMR6eMockfOd0SDSczV9gFxk9sjNr3h+XP2c8pTyKaxqeHpYdCA4pOBL6MzHbd4Sl jb3VegyU9INYLLqKmAbdCvyvP8XGATQAMTFdqH5r7LNjM6H4b+HztbyaxrBCcq4c3hBD Ycbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n3rhJz18; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si12495249pgh.565.2018.12.11.09.14.58; Tue, 11 Dec 2018 09:15:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n3rhJz18; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728190AbeLKPpu (ORCPT + 99 others); Tue, 11 Dec 2018 10:45:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:34210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727380AbeLKPps (ORCPT ); Tue, 11 Dec 2018 10:45:48 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B8B6D21104; Tue, 11 Dec 2018 15:45:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543148; bh=uM5PvfjiB8ipQtOSWOP++bJLGFsKE31cJTbKQSc6DLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3rhJz18rwSiYVoG8/6ZkNytobKHcXymv9/Kw9QJDpWZr4hZWTTyNG9fETGqrKQNT l6LHSOsf3J1hPRJqQMSCPpNCIuPRz/nAXjCwtjLxFXKMa3EnurDLjzBezhzaEzgKHj AKlCmyDkdBoPSj9uJ3TwitsGAZHxbVbOGZ1G3tVM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jason Wessel Subject: [PATCH 4.4 31/91] kdb: use memmove instead of overlapping memcpy Date: Tue, 11 Dec 2018 16:40:50 +0100 Message-Id: <20181211151608.340731774@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 2cf2f0d5b91fd1b06a6ae260462fc7945ea84add upstream. gcc discovered that the memcpy() arguments in kdbnearsym() overlap, so we should really use memmove(), which is defined to handle that correctly: In function 'memcpy', inlined from 'kdbnearsym' at /git/arm-soc/kernel/debug/kdb/kdb_support.c:132:4: /git/arm-soc/include/linux/string.h:353:9: error: '__builtin_memcpy' accessing 792 bytes at offsets 0 and 8 overlaps 784 bytes at offset 8 [-Werror=restrict] return __builtin_memcpy(p, q, size); Signed-off-by: Arnd Bergmann Signed-off-by: Jason Wessel Signed-off-by: Greg Kroah-Hartman --- kernel/debug/kdb/kdb_support.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/debug/kdb/kdb_support.c +++ b/kernel/debug/kdb/kdb_support.c @@ -129,13 +129,13 @@ int kdbnearsym(unsigned long addr, kdb_s } if (i >= ARRAY_SIZE(kdb_name_table)) { debug_kfree(kdb_name_table[0]); - memcpy(kdb_name_table, kdb_name_table+1, + memmove(kdb_name_table, kdb_name_table+1, sizeof(kdb_name_table[0]) * (ARRAY_SIZE(kdb_name_table)-1)); } else { debug_kfree(knt1); knt1 = kdb_name_table[i]; - memcpy(kdb_name_table+i, kdb_name_table+i+1, + memmove(kdb_name_table+i, kdb_name_table+i+1, sizeof(kdb_name_table[0]) * (ARRAY_SIZE(kdb_name_table)-i-1)); }