From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Subject: Re: [PATCH v2 2/2] KVM: s390: Use memdup_user() rather than duplicating code Date: Mon, 3 Oct 2016 14:28:24 +0200 Message-ID: <73d5a586-2178-a311-f19c-c16c6e8cbb22@users.sourceforge.net> References: <82b84c9c-38a4-4d17-910f-312668dbae01@users.sourceforge.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: kernel-janitors-owner@vger.kernel.org List-Archive: List-Post: To: Geert Uytterhoeven Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org, =?UTF-8?Q?Christian_Borntr=c3=a4ger?= , Cornelia Huck , David Hildenbrand , Heiko Carstens , Martin Schwidefsky , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , LKML , kernel-janitors@vger.kernel.org, Julia Lawall , Walter Harms List-ID: >> - if (!bp_data) { >> - ret = -ENOMEM; >> - goto error; >> - } >> - >> - if (copy_from_user(bp_data, >> - dbg->arch.hw_bp, >> - sizeof(*bp_data) * dbg->arch.nr_hw_bp)) { >> - ret = -EFAULT; >> - goto error; >> - } >> + bp_data = memdup_user(dbg->arch.hw_bp, >> + sizeof(*bp_data) * dbg->arch.nr_hw_bp); > > ... while this would continue silently, How do you think about to explain this information a bit more? > and corrupt memory. I wonder about this conclusion at the moment. Did you notice the check "IS_ERR(bp_data)" and the corresponding reaction in this update suggestion? How does your feedback fit to the tag "Acked-by: Cornelia Huck" from 2016-08-25? Regards, Markus