From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF8BC3B634C; Thu, 25 Jun 2026 09:49:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782381001; cv=none; b=idLxAylOE2PD/05ZnYRtVf2J879CMYsKgCxD9wM2rZjzhlGVhX5v8WARXR2XXwQoF20yqi1Hc20YlwMOx1jelgr01uh8OAWvZ/MQAfvE0xH66toftRMiO/B2hiyFmQj0qnxX74usHCdqyUM/dxSAI9CpBkzEtfv6lZdEzxXffiM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782381001; c=relaxed/simple; bh=j5qZMBFdHZn+dDkZ+mR8PUpdvAby6rWqJ0vvZkBGF5Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KczU3FwS8bL2Gu34svj6Ng0Zmcm1dzcwHsEdM4phkT+78dx7JWLfojCpAyE2B5AqQFpnpocCc0OEkMXjlUZRXX4021hQ03mlWfXaNx6QdSZC81xn6vrcqIOAdobNPQeoCEpbfn2D0gePl+ajbNLzlibVNJT2RbGOrSzjY+Mvnoo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=x9zAFidS; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="x9zAFidS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CA151F000E9; Thu, 25 Jun 2026 09:49:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1782380999; bh=UYYq+KoBekpGqtmApm0mDvu1qJsMHG5Kl14VoGf11Fg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=x9zAFidSX67wqXQoP/ZDpcQjer5o4KaCIZzPrQyCI1oGax9GhWrxmkErsD2ggGxai +T1QKLbNJNhVVY5d5P6/Y/x6mLeD1NTKeKTpNz3atKKbRtyMcqBvh+nzy92VUAYGcC /Fgg/uI2vjNP+60CMWgz+URRD/wjrLu3IWdf6PFY= Date: Thu, 25 Jun 2026 10:48:00 +0100 From: Greg Kroah-Hartman To: Yousef Alhouseen Cc: Srinivas Kandagatla , Amol Maheshwari , Konrad Dybcio , Arnd Bergmann , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] misc: fastrpc: reject oversized DMA allocations Message-ID: <2026062536-protrude-cufflink-9026@gregkh> References: <20260625085659.4469-1-alhouseenyousef@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260625085659.4469-1-alhouseenyousef@gmail.com> On Thu, Jun 25, 2026 at 10:56:57AM +0200, Yousef Alhouseen wrote: > FastRPC keeps invoke and mmap buffer sizes in u64 fields, but coherent > DMA allocation takes a size_t. On 32-bit builds, a size above SIZE_MAX > can be truncated before allocation while the larger value is still used > in the message sent to the DSP. > > Reject sizes that cannot fit in size_t before allocating the DMA buffer. > Also make the inline payload alignment step overflow-aware so a > near-U64_MAX accumulator cannot wrap before the later bounds checks. > > Signed-off-by: Yousef Alhouseen > --- > drivers/misc/fastrpc.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > Are you forgetting to include the tool information that you used to find/fix all of these issues? And how are they being tested? thanks, greg k-h