From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bartlomiej Zolnierkiewicz Subject: Re: [PATCH] ide: don't call memcpy with the same source and destination Date: Tue, 18 Apr 2017 12:58:27 +0200 Message-ID: <3967489.2j6es1sVNT@amdc3058> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Return-path: In-reply-to: Sender: linux-parisc-owner@vger.kernel.org To: Mikulas Patocka Cc: "David S. Miller" , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , Helge Deller , John David Anglin , linux-parisc@vger.kernel.org List-Id: linux-ide@vger.kernel.org On Friday, April 14, 2017 02:35:33 PM Mikulas Patocka wrote: > 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 Reviewed-by: Bartlomiej Zolnierkiewicz Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics