From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: Enhance the coalesced_mmio_write() parameter to avoid stack buffer overflow Date: Mon, 12 Apr 2010 13:28:32 +0300 Message-ID: <4BC2F5D0.4090902@redhat.com> References: <20100412015714.GA2815@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org To: wzt.wzt@gmail.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:28224 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752824Ab0DLK2h (ORCPT ); Mon, 12 Apr 2010 06:28:37 -0400 In-Reply-To: <20100412015714.GA2815@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On 04/12/2010 04:57 AM, wzt.wzt@gmail.com wrote: > coalesced_mmio_write() is not check the len value, if len is negative, > memcpy(ring->coalesced_mmio[ring->last].data, val, len); will cause > stack buffer overflow. > > How can len be negative? It can only be between 1 and 8. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.