Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1344988rdb; Fri, 20 Oct 2023 16:41:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPxdMEWMRvxEjEaoTDmgT3XN8aVaWflu9tmqp8aLIsUMMcE761A6SEE9vmP7fSqGVRys3Z X-Received: by 2002:a92:d8cf:0:b0:34f:739d:9bec with SMTP id l15-20020a92d8cf000000b0034f739d9becmr3150491ilo.31.1697845281283; Fri, 20 Oct 2023 16:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697845281; cv=none; d=google.com; s=arc-20160816; b=OhPAhOPBEvEznEPlt5ED+jaiR34jX2hvtVSFCFZru6TmkroytVk7IGzLHao10ozHvi AC4ZwRX45w1Xqeu5knbp3j+codUkqDQWIlD6NJTZFe859ASaBriX65VeKF0seQgmvokC jAwnxvoRqKy0lHKDHKgheVGd6vwguSXLSJEVcEokF9HECLL+C5OigTWrf11hN4l02gAE 6pVK0unULTL08V36t5/iRQPKvdF3HqhNuRcT0AFUsH+1JlsrmdUNaMzGu+TDm5mspq0h nsfWqaAFC9dRzAu4qUdXLNsRDIM0z2yqFdgorC9d93hx3Hn88mXUwckhtl6EkgyfQJbu b5IQ== 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=bKFZg/LBpXWZUAVfLFf4lWiUNapQ7Gl7Xv4yj0bgCu4=; fh=ITY154T5DdACbZ7QC3DriEUZnyFjuYVbuY+ukterbLk=; b=KcDIKlQUnrPjawH16wrTOV62Sfo++jpgDFGUBSu0x3ZQk3O+sEG/hOPKW1cHcYfvwV Ol1p9TMyfnJPAbg2lbXSm9Zl3YOIfPLdg38pnZRdYLDkVimtLVWv9dDVlEo3nVIhNR8X wZSobt6/VnKQLmfKp7xl4/Gki1CJGhuvgwuOTcwDMerOrri9Ol4nG5XfH3fgn/GcSpd0 UNE2DNxGaYT05LmNjMAzoUUg5FxG6ydAhGJ3eblYvF7g79+YP4HAjOlR0AiQK//apP9J sN0EtozZbgooL5zyM2GT0ViFGcN+n3ZjQdVhV/TWlN9rIQExKy4mvSbvm9xE/T6Qn8z9 8oEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=wpWTTgpC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id f22-20020a637556000000b00573ffd25b44si2797682pgn.182.2023.10.20.16.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 16:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=wpWTTgpC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id B975983383D4; Fri, 20 Oct 2023 16:41:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229641AbjJTXlL (ORCPT + 99 others); Fri, 20 Oct 2023 19:41:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbjJTXlJ (ORCPT ); Fri, 20 Oct 2023 19:41:09 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55FEBD51; Fri, 20 Oct 2023 16:41:08 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KLZUkP018479; Fri, 20 Oct 2023 23:41:01 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=bKFZg/LBpXWZUAVfLFf4lWiUNapQ7Gl7Xv4yj0bgCu4=; b=wpWTTgpCHWQmuFke7ehdHYwwbIGEEV+vloZwin7o6xyre/7+L7dBa4Hz8FREDi4/fm9S 7doWa5mYErpYPW3SF2ObUbt/wYlGqaMFqEjFMLGTPgYuE2ho+kaGnyrigTwVFNn6AeQD DV0V3S01/PQPzD+RZX5rRGDuvmEtbpKnNBJkEKOoy9nwLh8qs68KHmdeCoT5tQNRV9CB b9om/PkdcDb3s0F8Gw17gpthqeaqCTtkra0wgDDxIo70frod0+/aj5SiglSL8ES/Vuex +A4nTqT5FlUFhHBjLegM8ZWuRFnuZKVnPDjKnRI5KYtbCMk+i4FxUCO6WvoU0qSe2kCZ ug== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tubw82vgv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 23:41:01 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39KLWMsq014110; Fri, 20 Oct 2023 23:41:00 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tubwfw1gu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 23:41:00 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KNf06m002147; Fri, 20 Oct 2023 23:41:00 GMT Received: from ca-dev112.us.oracle.com (ca-dev112.us.oracle.com [10.129.136.47]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3tubwfw1gd-1; Fri, 20 Oct 2023 23:40:59 +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, kuba@kernel.org, horms@kernel.org, anjali.k.kulkarni@oracle.com Subject: [PATCH v2] Fix NULL pointer dereference in cn_filter() Date: Fri, 20 Oct 2023 16:40:58 -0700 Message-ID: <20231020234058.2232347-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.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200202 X-Proofpoint-GUID: CFmDnzAWFB6owU8ti8ggAm50QlMlrWJi X-Proofpoint-ORIG-GUID: CFmDnzAWFB6owU8ti8ggAm50QlMlrWJi X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Fri, 20 Oct 2023 16:41:18 -0700 (PDT) Check that sk_user_data is not NULL, else return from cn_filter(). Could not reproduce this issue, but Oliver Sang verified it has fixed the "Closes" problem below. Fixes: 2aa1f7a1f47c ("connector/cn_proc: Add filtering to fix some bugs") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202309201456.84c19e27-oliver.sang@intel.com/ Signed-off-by: Anjali Kulkarni --- drivers/connector/cn_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index 05d562e9c8b1..44b19e696176 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c @@ -54,7 +54,7 @@ static int cn_filter(struct sock *dsk, struct sk_buff *skb, void *data) enum proc_cn_mcast_op mc_op; uintptr_t val; - if (!dsk || !data) + if (!dsk || !dsk->sk_user_data || !data) return 0; ptr = (__u32 *)data; -- 2.42.0