From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 5CE7730DD11 for ; Mon, 2 Feb 2026 07:13:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770016400; cv=none; b=ZC3XgT2WV+LJLlJF/EXYdciS7l4pto3uDAezCK+6EDINgIF+psQuPdXoEwraWs3e3BXQ+X5zC2CddeHjg7ky5ANiyvcUt5/4mZzdfCazySq7JkpyUaz+MT7k79BSSp4TWHuktUstt5vuj4h5uvFxz5suKSgjxMGYnzG57LlXkBo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770016400; c=relaxed/simple; bh=MsWpOsGmt7a7s3594oaHh57A1NdI0v8AGDkRbX3mjrA=; h=Message-ID:Date:MIME-Version:Subject:To:References:Cc:From: In-Reply-To:Content-Type; b=ZR8avalu8ft8sjyPsWRsrYlT7uHCeVIuKosN1a0XeiiMcfo9z+i5ApiIqX++ac9+RafZ6Jx45PKcyrbHEHcnrB7WWjRWzA2Pzd4AbRn+/QzyJw5NYo32q18Ff7YoKVaReNOA0kcRyinqQST5Gq+UlLlZ2M4ourhU96QzZuGqtZ4= 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=WyDiOQBG; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PMSqEZlI; arc=none smtp.client-ip=205.220.168.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="WyDiOQBG"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PMSqEZlI" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 611NgM8C1583312 for ; Mon, 2 Feb 2026 07:13:18 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= TOn8WxpAI+xLLi6hCoSt1O1PWlTIigMOrNKcnGiwBLM=; b=WyDiOQBGklyIBbfQ vckFi6VMSWQ/GrRlVpCivkJ0jub6gyYKNe+rhs7uSzcj8t5UaeZcuRygNSNcKpHR inVRxvT+HzRG13peJkvpFWrPgPxf47twqyKkfd1hFHdene1Jb6T+glhphwz/ORuy 9FuOGmZRZ8MKo/oRrFbM5NrMEUh0axILn4C6M7RSP/DrsaaUUc+jepp2FPkCOutW +7nENTzL4kI9I7I81pHrJ+66Nv4hCJLs39lCJ09OAhe+8z1u+m6oG+b5oP4LbFDQ ES5RhFi+tm1x/5+Z4HbiiPNui/LXD0Z1pQb/4v/jDS3Mf+ySDTosswSQjmtelR3x 0RcP2A== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c1au2mbwe-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 02 Feb 2026 07:13:18 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-81f2481ab87so3915753b3a.0 for ; Sun, 01 Feb 2026 23:13:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770016398; x=1770621198; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:cc:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=TOn8WxpAI+xLLi6hCoSt1O1PWlTIigMOrNKcnGiwBLM=; b=PMSqEZlImO7p6oBHixGj3D24VXaoNjL8srA9bXn8tlCzOpLzWjF1dTlYQrY5j7fSOi Jz4v5f1zmiZ02b9rjUxeZS4mC0ZyXYCt2ukL744rx3BPM3MB84wVBPMI9HKjkNaQ5yLV /NOA/GgXN/imc6wDy1nw9XPto9D6IoAYPE9pwX0zpSXWWSr5FgEkpV+I/Tt28PjjYa7J w72qv4PkH9lOHLMwTgxyU51cKF3YEZPwSo0q7vuLmfqgiy0yfbZpkwMsqiqbcUSFRDdV uawein/fFJ6hJfUKwX/K94wQX7GUrWDrzIPaK5ISbOxiL4fGI0kR9d9K+YTW4EgIbBSj MqzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770016398; x=1770621198; h=content-transfer-encoding:in-reply-to:from:cc:content-language :references: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; bh=TOn8WxpAI+xLLi6hCoSt1O1PWlTIigMOrNKcnGiwBLM=; b=ZlFBpeU3BkOuCvTmcmIfQGC4gcSwZKCO8SIW10F3gXaJAMDTdfHOeQqeC0hS+yphhA A6+99LRt+Sa6aXELgJacn1wn8Gh3g6IbJrba22i5e6jiVYpxyUYrhvmq+B60UpIhVKRs 5zeactue84E6riqBImB/JbomuZB8Lcbv2g8LMjM1ZoPmLR03aY3ZnoezDfU4Fpp6PTXg OMH1eiYcZV0n1OwbZz/xQM9HPft01vBhq6fxBtAEyka3Dp3RhLZKGDP/BVl003tpApez IZquQJA1pqTSDnKc/dS/7zzovn0VC50IFIePdst5Nmu+qLRLHhxfRtyfFUxk+fyezmfS wYsg== X-Forwarded-Encrypted: i=1; AJvYcCWuqxzUv3n7ArnvyTlws+OWVUZANwph3X5Rn1UJW6xp7A1WS59kEl/zaXniy6h3kqhvKPU4Qc0TC7INUyQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzeAx+pw8tH15V/+qDQIbyG+H3p8kA1ZY2HlSPN3aGN5eqC8/r0 O8rqkCrbnKbkLQx8tt29N1vrSrOwbb3CfrJq4UcmrQ54lYomHDvqBYRbZlvKoWMam73+g5yaNYk 7LyhRItzJe9owCRap+vHq35l0NZt0SpWbp4yFGb+2po8xLVLvgu2FevSwAuz7XJHwv7Y= X-Gm-Gg: AZuq6aIIY4z1kflCVWPLQ5KD0TRj1rkke+W7qRwdwokTE0Z/VPJayrbzuluIg0KEdXB Bu0HcQnvKRQCYRuLWs0/FDkE4QmonJxPli3JeqQWjjqyBOH3xHcVqp5KjVLYMZ+FmfkgiUYvLEM zxozsOzTY8DLlFFiF21jlosVZyxvQ1HfktlBfmIl4Y66KJg6e4d95llczrxKE3NydDmxTPxVHWW IwriEZv7SG1RnTHfCEAfMakVUs5Lj9RN98bYhFB1c+ob3dWvzviaKyu38FOxb8pxXdskFg2YaIx 56Pc4NB9g9qJDGcODNec+0yglrnATOJOo0EdyubM8jUvbV81FtuOvlMpdWWBnB/fVptxvWIigon nECn5QdVbdS/KsYGqbnOej3V/8apuJJ44HuYog1uJZLNW6qrMSSD0AnYDfQCwG+vwDZPBp7Lqcp vDVM00 X-Received: by 2002:a05:6a21:4cc5:b0:38d:ebdc:353f with SMTP id adf61e73a8af0-392e015cd70mr8972277637.68.1770016397813; Sun, 01 Feb 2026 23:13:17 -0800 (PST) X-Received: by 2002:a05:6a21:4cc5:b0:38d:ebdc:353f with SMTP id adf61e73a8af0-392e015cd70mr8972255637.68.1770016397328; Sun, 01 Feb 2026 23:13:17 -0800 (PST) Received: from [10.133.33.100] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c642add5199sm12734854a12.31.2026.02.01.23.13.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Feb 2026 23:13:16 -0800 (PST) Message-ID: <2255b500-f4fd-4d7a-a5d9-5b4fb55c78b2@oss.qualcomm.com> Date: Mon, 2 Feb 2026 15:13:10 +0800 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 1/4] misc: fastrpc: Add NULL check to fastrpc_buf_free to prevent crash To: Greg KH References: <20260115082851.570-1-jianping.li@oss.qualcomm.com> <20260115082851.570-2-jianping.li@oss.qualcomm.com> <2026011621-fang-moneywise-d6b2@gregkh> Content-Language: en-US Cc: srini@kernel.org, amahesh@qti.qualcomm.com, arnd@arndb.de, gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org, Ekansh Gupta , thierry.escande@linaro.org, abelvesa@kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, stable@kernel.org From: Jianping In-Reply-To: <2026011621-fang-moneywise-d6b2@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: YLHCSxWmBSvnwp8QPyLpI4VodHWOCPgd X-Authority-Analysis: v=2.4 cv=TtfrRTXh c=1 sm=1 tr=0 ts=69804e8e cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=A4WIMml1adry92zxVK8A:9 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv:22 X-Proofpoint-GUID: YLHCSxWmBSvnwp8QPyLpI4VodHWOCPgd X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjAyMDA2MCBTYWx0ZWRfX/gYYO378sbfC THUu3KsMfS7FQIo0EppTNemrnU5A/RCH5zo5eJ+Ed0vcFL4cKlY+mFhsNdoVSz0YA8f+auk8noj hSDmDrWaLQRlZO5UH59lVcuv4ls//WQ29HuSJC+00gFp9VTKGkUIS1XMdfKeCT8IhaFRURZ07jv p2tSJnplzp23T57bA5InbyQJzJJ1x3kOb0dNWIKRg40rqFtW7yJZno0P+Y2BTnR7GboajXLRIRH 6GmrekRPrCDU+9uLdvUTQKjykdsWT44aSvSJ9iDZI0f010UhhTiaGO8z0m+JKhSmlN1nHnshXeF 1NrhLeRTOG2sEiHDc4Hd7qepEiqPfGxvBUqGA5j428tU/tL8bjjUONmFxkzWaGdJNPkVXx2FWje LU9lktZR4VATgA6g3hh0ONw8mA8c1e6KqB7bHIjoMILZKS+mKMotujhgPSt1tRE1Eymgw3mzz9+ 8T/pHLISZ1OnR9ETHbQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-02_02,2026-01-30_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 phishscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 adultscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602020060 On 1/16/2026 10:49 PM, Greg KH wrote: > On Thu, Jan 15, 2026 at 04:28:48PM +0800, Jianping Li wrote: >> From: Ekansh Gupta >> >> The fastrpc_buf_free function currently does not handle the case where >> the input buffer pointer (buf) is NULL. This can lead to a null pointer >> dereference, causing a crash or undefined behavior when the function >> attempts to access members of the buf structure. Add a NULL check to >> ensure safe handling of NULL pointers and prevent potential crashes. > > What caller passes in NULL here? I did a quick look, and see where the > callers check this properly if it could be NULL, otherwise it all looks > sane to me. What in-kernel user is causing a crash here? Why not fix > the caller up instead? > > thanks, > > greg k-h It's a saftety coding: to eliminate NULL checks on the caller side, as we do in a lot of other kernel API. And it was pointed out in the v1 patch discussion that this change was needed: https://lore.kernel.org/all/c80c48a1-f1b6-4520-9d7c-3a83915c7717@oss.qualcomm.com/ Thanks, Jianping.