From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753102AbdEHVh0 (ORCPT ); Mon, 8 May 2017 17:37:26 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:41622 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbdEHVhX (ORCPT ); Mon, 8 May 2017 17:37:23 -0400 Date: Mon, 08 May 2017 17:37:21 -0400 (EDT) Message-Id: <20170508.173721.1587256787895455007.davem@davemloft.net> To: mpatocka@redhat.com Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, jejb@parisc-linux.org, deller@gmx.de, dave.anglin@bell.net, linux-parisc@vger.kernel.org Subject: Re: [PATCH] ide: don't call memcpy with the same source and destination From: David Miller In-Reply-To: References: X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 08 May 2017 13:55:54 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikulas Patocka Date: Fri, 14 Apr 2017 14:35:33 -0400 (EDT) > The parisc architecture recently reimplemented the memcpy function and > their reimplementation crashed when source and destination overlapped. > > The crash happened in the function ide_complete_cmd where memcpy is called > with the same source and destination pointer. According to the C > specification, memcpy behavior is undefined if the source and destination > range overlaps. This patches fixes the undefined behavior. > > Signed-off-by: Mikulas Patocka Applied.