Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp587196rdg; Tue, 10 Oct 2023 22:12:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFK+W2VGuP4C6nkPlfI16wZVYZQSP7kZ2vhUVvMZ4Ba4gNqPkS5/vs9B0PM6zQ2w50Rzzy X-Received: by 2002:a17:902:8649:b0:1b8:ae24:c207 with SMTP id y9-20020a170902864900b001b8ae24c207mr14421494plt.68.1697001175911; Tue, 10 Oct 2023 22:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697001175; cv=none; d=google.com; s=arc-20160816; b=ej/9YvAyZ+HZjVZ93OJb9Q/DWdj4WaG3pU9YrZObSRi39aMeBik9FO1vpQRDpQwGdF ONcTC4kmAMsY6bP20NvhUK7tdsw5E6e99Lehq8Dzgm7RCo7L/hsuAAokhAxrzPtAyI3d eLw3/19ArhcDvbTW3y/WDoxKmBB4Il2QQ8ORDdoAlildCn0VP4CwWuI8Q52eFfnLWU9c wnB0VBDe3uLhCrs/VXJVv9eda4e5cd5QbDX+FLvjAKCDjbRXUIekV4FNprD+z6vM9+CS pir3VxgKhluJGeQ+glsfQF4sCSL335sZLPL1o9qiBSYp2a0HHWnCHYkgVQDM1cfJlR1h uWwg== 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=mF3Vt9Zpfj/YFdxqizp/kX/D6C+yZJy3bxN+IekzmK0=; fh=SmMFfIiw5u1Kc5IU5zdXKC1khvJz2X8uNIGcoJJ9P5U=; b=fhLp7iDJx0D/DoIWPdEQ2Osi/C63EjvtdcwCohDwBAq+zjsUW9iUoyRZfFj17AUxU1 ce84Pe3nl0kDqaPgWGl03mFoOnDRmREMLt9ORtMM0xbho+8iti8Raa9rgRAeybdTbs8U 27/HBp8wKItGKbEyZ5InQJobDoJPXN+gXkMPPJYjh7GyeGMKLi6NJizKIIN5s2U4z1Jh hV38d3DhNsrJGLR2I7sPSHeKYtDlOp4CnLHry5BbAfreBr0ZKDslhHiiDUmK0b4HMXcC +t1twcurxHzl4YjAhrEHTHcrSvW2mlVwvF9VrtJB4x4pHekxMWrJRU+/qwkMffxsB51O SF5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=Q95GMkXI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id kk12-20020a170903070c00b001c4621ac000si12745268plb.246.2023.10.10.22.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 22:12:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=Q95GMkXI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D8C6C826EC78; Tue, 10 Oct 2023 22:12:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229806AbjJKFMj (ORCPT + 99 others); Wed, 11 Oct 2023 01:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbjJKFMh (ORCPT ); Wed, 11 Oct 2023 01:12:37 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 380BA8E; Tue, 10 Oct 2023 22:12:34 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39AJiKqY011857; Wed, 11 Oct 2023 05:12:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2023-03-30; bh=mF3Vt9Zpfj/YFdxqizp/kX/D6C+yZJy3bxN+IekzmK0=; b=Q95GMkXIwn3yewwnbhg2g6SnMk/3/uMPa52ZBZJkyiLMD12znZqqNpewycSWDIFrlupe hojB18K7HLe9FHaGd8sdMDF7Uj6LSYTrfWY88/JO/VCxt83LkBpg/Cmwgwv41AOdhH0i KTIYql7YJHa8DkhRksuOGRl9Wu6diV8gCLezX+harqtssGiqjWZ3tdkyNbgAZ7qgHjDl HT2DiRM+B/YlkUeZXYQv36gaq5qteejPNSch8xoZFwzfIoRJ59+62VMjpoHa6V1JVoSb ckFP03EoN60wDlhEeABLH4zxP6d9ejMfTCXyBBy1QMonO7qQpjc1V8pOvuo6o0YebR4J Cw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tjwx26ypm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 05:12:32 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39B2Kllh013616; Wed, 11 Oct 2023 05:12:31 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3tjws7rqyr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 05:12:31 +0000 Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39B586FM037251; Wed, 11 Oct 2023 05:12:30 GMT Received: from ca-dev112.us.oracle.com (ca-dev112.us.oracle.com [10.129.136.47]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3tjws7rqw7-1; Wed, 11 Oct 2023 05:12:30 +0000 From: Anjali Kulkarni To: linux-kernel@vger.kernel.org Cc: davem@davemloft.net, Liam.Howlett@oracle.com, netdev@vger.kernel.org, oliver.sang@intel.com, anjali.k.kulkarni@oracle.com Subject: [PATCH v2] Fix NULL pointer deref due to filtering on fork Date: Tue, 10 Oct 2023 22:12:25 -0700 Message-ID: <20231011051225.3674436-1-anjali.k.kulkarni@oracle.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-11_02,2023-10-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310110046 X-Proofpoint-GUID: OT-Co-kg_-3ysWNwYZ1uMVenEajsw74U X-Proofpoint-ORIG-GUID: OT-Co-kg_-3ysWNwYZ1uMVenEajsw74U X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 22:12:54 -0700 (PDT) X-Spam-Level: ** cn_netlink_send_mult() should be called with filter & filter_data only for EXIT case. For all other events, filter & filter_data should be NULL. Fixes: 2aa1f7a1f47c ("connector/cn_proc: Add filtering to fix some bugs") Reported-by: kernel test robot Closes: https://urldefense.com/v3/__https://lore.kernel.org/oe-lkp/202309201456.84c19e27-oliver.sang@intel.com__;!!ACWV5N9M2RV99hQ!PgqlHq_nOe_KlyKkB9Mm_S8QstTJvicjuENwskatuuQK05KPuFw-KvRZeOH8iuEAMjRhkxEMPKJJnLcaT8zrPf9aqNs$ Signed-off-by: Anjali Kulkarni --- drivers/connector/cn_proc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index 05d562e9c8b1..01e17f18d187 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c @@ -104,13 +104,13 @@ static inline void send_msg(struct cn_msg *msg) if (filter_data[0] == PROC_EVENT_EXIT) { filter_data[1] = ((struct proc_event *)msg->data)->event_data.exit.exit_code; + cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT, + cn_filter, (void *)filter_data); } else { - filter_data[1] = 0; + cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT, + NULL, NULL); } - cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT, - cn_filter, (void *)filter_data); - local_unlock(&local_event.lock); } -- 2.42.0