Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031803AbcCQRO0 (ORCPT ); Thu, 17 Mar 2016 13:14:26 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52470 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031768AbcCQROU (ORCPT ); Thu, 17 Mar 2016 13:14:20 -0400 Subject: Re: [PATCH v4] irqchip/gicv3-its: Don't allow devices whose ID is outside range To: Marc Zyngier , linux-arm-kernel , linux-kernel References: <1458227925-21952-1-git-send-email-shankerd@codeaurora.org> <56EACE85.4090603@arm.com> Cc: Thomas Gleixner , Jason Cooper , Vikram Sethi , Eric Auger From: Shanker Donthineni Message-ID: <56EAE5EA.2060300@codeaurora.org> Date: Thu, 17 Mar 2016 12:14:18 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56EACE85.4090603@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1279 Lines: 32 Hi Marc, Sorry, absolutely It was my mistake sending the same patch second time. On 03/17/2016 10:34 AM, Marc Zyngier wrote: > On 17/03/16 15:18, Shanker Donthineni wrote: >> We are not checking whether the requested device identifier fits into >> the device table memory or not. The function its_create_device() >> assumes that enough memory has been allocated for whole DevID space >> (reported by ITS_TYPER.Devbits) during the ITS probe() and continues >> to initialize ITS hardware. >> >> This assumption is not perfect, sometimes we reduce memory size either >> because of its size crossing MAX_ORDER-1 or BASERn max size limit. The >> MAPD command fails if 'Device ID' is outside of device table range. >> >> Add a simple validation check to avoid MAPD failures since we are >> not handling ITS command errors. This change also helps to return an >> error -ENOMEM instead of success to caller. >> >> Signed-off-by: Shanker Donthineni > Is there any difference between this patch and the one you posted on > March 10th? > > Thanks, > > M. -- Shanker Donthineni Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project