From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 8AD42352004 for ; Thu, 20 Aug 2026 14:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787237084; cv=none; b=VyySFI0IrAYg1cMIEAwV6Rf2BJVoYw9EPl4FPiZ1cG2xT4rmCKjSPyVsqwT00Ff6rP2N8atZWvGset6ULjIqVplISuYPziRUX/4tapLOFGDttN4RbWJ4HrCIv92MLb1Xe9Ge2ljsYorquuhIehbd9IzxvxGrh79kQQ1vzrhbtL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787237084; c=relaxed/simple; bh=bFyzUNP2+qqip0ybP0JabGsLTTkvJs2TedU/hVOrIdw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BWxt+mukxfm7P3/3ND2pQ6g8jYuhm9BmIypQD144ThGPKgb43tIQS+xTCqGxphxFL99RLvvHD2PSwkY5AvEWJ40OMGqCaBe+wXI6SZJ6trtGmtRSUqyUuDPtpPIRCkAtiFk4KQq5o/6FHJd/DhFdrSgp59dm1s8150xndunDJzo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=a0+LwQqK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ZlciOE7c; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="a0+LwQqK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ZlciOE7c" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67KE7gpQ3234825 for ; Thu, 20 Aug 2026 14:44:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= QFLX4eJFo+iOg9km4uc26Mxwlt5r5Wih37H1Gy0pU1Y=; b=a0+LwQqKqe8RCJ/f v7jsV6foFdAO9+T0IC1RS44Su8psSnn00t7FBsrLS5zAeZxRKHOi2KNE/SMQUf5f D3sR97vC19zv4xAdlPwHUeEFYQ535HVkUlR4V6HMlpMNd+a5rkTxnHI5/c81AcIZ eU78pXDoUh81Ce8VDCKRDzlF2l0olhLfuPr5N2Zj74UYjUPflY9NRAjh2SwxoOCe YhJvFqVD3Wfvs4qHrwtqpJajSOwvN2K0p3oUDzX/SxxV4o4NzJ6U6gVORrnwlr0C Knd6hAjxKdNKMJVGeUtdkqp5HGzJgYikQ2kXcU7QsGGQWe3LOzy3WToNJqJI6Pwn hNIfZQ== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g5xbv9e0w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 20 Aug 2026 14:44:41 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-93494b1e35cso46587185a.0 for ; Thu, 20 Aug 2026 07:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787237081; x=1787841881; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=QFLX4eJFo+iOg9km4uc26Mxwlt5r5Wih37H1Gy0pU1Y=; b=ZlciOE7clJ/dtLlIL5t+S48Wg48DtqL+bsSYKiYJKb77iLwF7Y6GOr2nyvpJlHsvo4 /5UJPcupjsr1RmYKUhFc2PG/aVXhZv3ztR8bWoI6cMDjMAHuAwdVIqO/SIA/pJzJ6TLt 8vMUSqJPpIYIFNVWehz8QZC6n7jDdq4lykRpIYMSl10ZjFt9HXrgku9XvZPFAIvhhpcD 9EyYEinto8SXPoWGAnXzUR5m+bc3YDYCEPhtbtueMTAVZd45nvwQNSP6ltJ16xecodfS RR/vjeaxrYdxpWRkdXQv80YxXHvyxPMkmxScUrdrDWyq5Z/2ixbga+b15DyAdslJVwLJ i9ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787237081; x=1787841881; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=QFLX4eJFo+iOg9km4uc26Mxwlt5r5Wih37H1Gy0pU1Y=; b=gAHZllGb7H+J2YsIUqyN1n5fVMeLIpikuGnq5FDG3ANQLh4DJy7pu07xv4X1T0+Ryt 8n5zsYwAJqdVEQPx/gH1cU4vDO4HurIx+GkTYlBjiQgwVpoXi+xkU6gCbRp7XMB8tuPB F6zxP2Mt3AZM0KMWj2+/ncJhc2fP6Xhdwc01bAWtKxH16jrVZ6BkLSbQs7v44bkVw/PB zHBsSzup0HTv8gPZkLoDnWMr2hvE5oPL14sM60sAcndVbsH19M0vgMXuYyLvmYgBKCD+ fTI/u87P20DdqXU/ZWjKJ5WRkfp5tbJU0np17EAGtxns4CLQ4DjFLbWkTpKJUbGf0Wgx m1YA== X-Forwarded-Encrypted: i=1; AHgh+RqwlCkGj0RGjG//Z3n/bz5VB3R2KEov8lHZ8R95vKbMBsW8VtjQt7d/r5yjwQxRs4/nhwSz4DB0T6D28SY=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3z8obpuEuNI0gV8tCp9CsXpGSAQWXsEtBegpAAYvbR4zNLeBR nurjBef/93rX8k7ehm17GuL2HEZ2xsBBgkgVUNsSyHXHGZ5L1Stj7U0l8hMEZOpmO5tgobuomO5 4HYsouzZn8/UIl60gibhJ1iSZ4zCbvrleTxLv0mkCsgr0r16lOnfCDQoGONW7KtNbhSs= X-Gm-Gg: AR+sD12o8MEM5FKsymEpTaXO+JR7rXmRjN6xQ61ElVfHxlEZ8qwogd76+U2pDObItvh tu3fxTf5e3FYfenG/ECN2khANSuLFCCluTvjHGYKORUnVp/FR5r8oQYLCIsSiqpIt7SXP05nXrn 9gLzq3cQmAG61q8LckptYuqOr0mJAFoOnlYvS6kUQenSDmT3BR5ZixVpO0r055SCHi9hczJqhkf c5Eny+Hk4Uh12DVP4+cAOeCsOMkHRMJljMEMBN3Fbg0AscNjmOyUXu3rJoWpU1QpgSLSsRj4gBn Zi/Kkjkv5OCRHM5OljL1+xEkwWdrAfOh6r7MSMNjgzjzWsKiB+eHv0NuLQ/s72jCxMkrCnd4euF u7cjEkNq7RgukuPnG2OEGEAsl X-Received: by 2002:a05:620a:4055:b0:92b:7420:bd58 with SMTP id af79cd13be357-9371e1aa1f0mr903833685a.0.1787237080710; Thu, 20 Aug 2026 07:44:40 -0700 (PDT) X-Received: by 2002:a05:620a:4055:b0:92b:7420:bd58 with SMTP id af79cd13be357-9371e1aa1f0mr903829585a.0.1787237080284; Thu, 20 Aug 2026 07:44:40 -0700 (PDT) Received: from [192.168.120.193] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3a189dfc6desm15504331fa.23.2026.08.20.07.44.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Aug 2026 07:44:39 -0700 (PDT) Message-ID: <044a5e3f-287a-4a6b-9f15-c6f13241885f@oss.qualcomm.com> Date: Thu, 20 Aug 2026 16:44:37 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/4] soc: qcom: geni-se: Fix fw_end computed before round-up; propagate size to caller To: Viken Dadhaniya , Bjorn Andersson , Konrad Dybcio , Mukesh Kumar Savaliya Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260820-fix-write-to-read-only-firmware-buffer-v2-0-7badcdc455fe@oss.qualcomm.com> <20260820-fix-write-to-read-only-firmware-buffer-v2-3-7badcdc455fe@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20260820-fix-write-to-read-only-firmware-buffer-v2-3-7badcdc455fe@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=AMKAkK6n c=1 sm=1 tr=0 ts=6a8712d9 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=J4qJpuNgrJFWkHdbzQwA:9 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODIwMDExMCBTYWx0ZWRfX169ToRS46hHe wFsmHY3P9gAZbGibrrSLq7J0S1wLnbkhaH45juCt7+DdGp/0wCHVfHclfzsPiYWwMXb828ASno/ GfJGUWp241RIkL8vQB9+3JqR04wnEBVOaZiGkfuKt7cpsRlcL64LczME3S6YsvYHwE3L/mAIEkX FH2zeUFHVyb2VeNvX5/jTCBddBdKJfzsqzEZb7yo0J+AMxeUS1tFD7kx/GQL49Gx8lI9k2p899W CwuCLRAcwVzlogiXUyoBZx4hGC5OZvz6rcaYixXgOrqXmnQv08Uuu7PGUBMLHSSANJPfnuY4Qde /DtKWgjx/ZNn/X1chxqzu6BSEzqS9lyiPBImyGC2UdCScCEkjbLGX4lfRmSo1iAnRwjV/ffcGpY 9RswKZBRekHUcxFGhwUgfF1moz7b//epsBMp+To8B40HnwI3oLJM5UPdA9iTgcaD8A33ToQ7UrG QTdF8RSrD0/E9BVoVvQ== X-Proofpoint-GUID: ZXwX0S65DjQJN5AtnQoRE1h77Ju6ZLbt X-Proofpoint-Spam-Info: AW1haW4tMjYwODIwMDExMCBTYWx0ZWRfX3xZq5kFmDrgq qJC6gKTb+1moDclRyBgm+RgQ44sD78hsoirNJvFLNi5+edqbBL9tGPSfnksAxJ6rVbQkqq10Nas MHw1KOQ+MLw4dI3nq2ZI4if7acNHv/Q= X-Proofpoint-ORIG-GUID: ZXwX0S65DjQJN5AtnQoRE1h77Ju6ZLbt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-19_06,2026-08-20_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 impostorscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608200110 On 8/20/26 4:31 PM, Viken Dadhaniya wrote: > fw_end was computed from the raw fw_size_in_items, before the odd-word > round-up. A segment with an odd word count could pass the bounds check > at the unrounded value but then be copied one word past the validated > limit. Move fw_end (and the cfg_{idx,val}_end) calculations to after > the round-up so they always reflect the true copy extent. > > The caller geni_load_se_fw() re-read hdr->fw_size_in_items for the > memcpy_toio() length, bypassing the validated and rounded value > established by geni_find_protocol_fw(). Add a fw_size_out output > parameter and use it in the caller. > > Fixes: d4bf06592ad6 ("soc: qcom: geni-se: Add support to load QUP SE Firmware via Linux subsystem") > Cc: stable@vger.kernel.org > Signed-off-by: Viken Dadhaniya > --- Reviewed-by: Konrad Dybcio Konrad