From patchwork Fri Jul 21 18:32:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffrey Hugo X-Patchwork-Id: 124058 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp401623vqg; Fri, 21 Jul 2023 11:51:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlHyctR/W2YEjKiYEUYRS4yo/D/adZVuGYPeEymABQFU5/ggUJGzHe+Imha0jk4W8OOjqQhX X-Received: by 2002:a05:6402:50d0:b0:51e:4218:b91b with SMTP id h16-20020a05640250d000b0051e4218b91bmr9712707edb.1.1689965491727; Fri, 21 Jul 2023 11:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689965491; cv=none; d=google.com; s=arc-20160816; b=IUDJe+Rl98rM7vFoLNwDG25U2rNrvgMEGKWTJIlMe1UlaTqZ3ohRqMT6/RDcE01iIJ YnHjTNzUd30gP59X3v9qdKbqJVZ8qkMnERmMT574amYLp2d2xgqXdfFdCJUGZf4RH/Lp 9PEqPHEdq+ivUg7/mdzoG3Al7K9snidX0mlKHdnztULSBg+8TYbyIXs1zYubgvCFUuF7 UW5FZI1ZEgIxLaUFdGFeAYKp4v1HxLxs/bTfuRWtHHjndjAp6HdUbhjnWoFYQzM+xBfy 8Ae9H4AvVWnYW0RuobkwWk914d+7+szANxuT3nCndWQXIw8cq+Nmc0qooLJhSVFCYDYj C1jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Dyjhnp1h/Yy8khQjX4JZ9P0lfXo0r8U3Drgt6bQPJgs=; fh=z4Bkm/PN/zQSVSaT7l1KtKvAS59xsMKvveN9wfjMrTc=; b=ljvpeYmAfdNx4y8u1onrmDCiUYjwIiWoziNyqQ2vU0mmaKPf7VUabNDzPwY9cTj8Fx 1kRIvH3bWxzIdb/NxgFieM1EZE5ZPyG2S5zeLqwrQqCgteDdayDnGW9JE8t668iEEd7B 1T0taoT7sPRtBAJ5SVBU2LI+wfDuw4LW/3ia9lX5DcyknLiXib7cMIaVLVkh4ozj9X5P rg8v2+ySoF/2S6klFr52Be1bg0PmzRiK6NZBOPX8+ietS7nFI4wNNdnnTM1NTvuLRa6r w1FjXnSYc9dSLgScNgr4ChgKE13YzAV2dhlUABgcZ0nTMRZRLahRfSj2hMptgCTYtmk7 twIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mYNa38TV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020aa7d6c4000000b00521ab0a9513si1360061edr.261.2023.07.21.11.51.07; Fri, 21 Jul 2023 11:51:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mYNa38TV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbjGUScc (ORCPT + 99 others); Fri, 21 Jul 2023 14:32:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbjGUSca (ORCPT ); Fri, 21 Jul 2023 14:32:30 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 768063586; Fri, 21 Jul 2023 11:32:28 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36LDeMA2026210; Fri, 21 Jul 2023 18:32:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=Dyjhnp1h/Yy8khQjX4JZ9P0lfXo0r8U3Drgt6bQPJgs=; b=mYNa38TVl1taz5r6Yh0i0OZZnMuYc4/m7XA/apOLVSSdskdrMhFldfO9GpYbdvEzWBwJ IOeoIb+bv906po63Y9jyIerHmsEaoEBqWOBuC6xUkdAkvDIy6JIJQ4GYSSqb1rAfsXt8 Sla9ITKvmv19kLFrY4HtbFKdZC/v3hQfS3tav1WkbVqqKqELJqH9ZrOaVrTNr91XiHk2 zXlOTUO4J+cBR9h5vAdBtBoUksQFj5jn1XJJr3CDvl/tGZaRccJL2De8KAj80DUPX+Ck 6mcwZ4jNx6wU6KLPd9tdATEYBrtNm1hgDztK0YC/pRZkBPI67wmh6cftuQOS2uPX2w/G ug== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ryn5ysfuq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 18:32:21 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36LIWKnV012162 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 18:32:20 GMT Received: from jhugo-lnx.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 21 Jul 2023 11:32:19 -0700 From: Jeffrey Hugo To: CC: , , , , , , , Pranjal Ramajor Asha Kanojiya , Jeffrey Hugo Subject: [PATCH] accel/qaic: Fix slicing memory leak Date: Fri, 21 Jul 2023 12:32:01 -0600 Message-ID: <20230721183201.11001-1-quic_jhugo@quicinc.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: aKgtYbZ806sIHK2tvMLhp6CJ_qd6QNYc X-Proofpoint-GUID: aKgtYbZ806sIHK2tvMLhp6CJ_qd6QNYc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-21_10,2023-07-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 impostorscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 lowpriorityscore=0 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307210162 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772057255175538555 X-GMAIL-MSGID: 1772057255175538555 From: Pranjal Ramajor Asha Kanojiya Slicing configuration data from user is stored in a temporary buffer which should be freed unconditionally. Fixes: ff13be830333 ("accel/qaic: Add datapath") Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Carl Vanderlip Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo --- drivers/accel/qaic/qaic_data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c index e9a1cb779b30..6b6d981a71be 100644 --- a/drivers/accel/qaic/qaic_data.c +++ b/drivers/accel/qaic/qaic_data.c @@ -1021,6 +1021,7 @@ int qaic_attach_slice_bo_ioctl(struct drm_device *dev, void *data, struct drm_fi bo->dbc = dbc; srcu_read_unlock(&dbc->ch_lock, rcu_id); drm_gem_object_put(obj); + kfree(slice_ent); srcu_read_unlock(&qdev->dev_lock, qdev_rcu_id); srcu_read_unlock(&usr->qddev_lock, usr_rcu_id);