Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp246514rdb; Thu, 2 Nov 2023 02:25:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWZmm95Ye8n12I/XltJeVcdoDNlF5TdMca6jpEix+URBWD8aQB7k55WDuQhkRyJQHidISf X-Received: by 2002:a05:6a00:9385:b0:68c:69c8:e0f0 with SMTP id ka5-20020a056a00938500b0068c69c8e0f0mr20196013pfb.18.1698917134958; Thu, 02 Nov 2023 02:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698917134; cv=none; d=google.com; s=arc-20160816; b=mzi0refonMHDqo8WFbl/W3PN3KOP72jWyV5Vl69A31hTOZqy+PMRxjYN11MKroGZPm /GCll8kbEZLvSFsZx2WK7dcyjyoAn+44LO01bTsZYv1FqDdEF8uidQjhZBvQ7pmbJnN3 efdNtzfr+VudwiNG5HMX0pryRYRIDYHsqbBNfL/l7VkvkN73zVCM89ZUpipwjGAgUJ/2 4emfIgrZnpfcTodFXVm+1HTTGwSH7A71maOAShJ7vo545c7Z7ZMFb+FKrj6U8Zo6OJ2t QI/7bc3IaZboVICMul9rz3qJ6JV4oR+52BRYVAWZhFcAJhCAIwJzPJquDP+R5QkP62fs LfWQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=46b/rjjSfAe9alvUuh/gcYm0ar9dL19mUyO2V2/swhw=; fh=G3aJyOSn53cyPTkt3+SRG3bGw+RlqHK9mDqKaD8k8gM=; b=pL+bBX8EqOt86JPp281dNfDTuUwgQZiPjwbq2wsS87hyDtZKOO4dDh+MIJc5Hjhaub LvgFCRT3aNPRRs9sRfsGS3TiQ0bKJeYhnqVttKknn+OnuM4i3HEVCPTdPkOnVO2rTTTI 6coqkFa6U5Ia8klD4cHLPdYaA6vKTPIbb+DVxUFs9oT16i1nhqhNiJdfDCAMmcFdLnDj PtZul8w4I6fv8JSGMkIxRLwChnlEyQYsOPXhtcpoGhVDdgPZl7NJTnQvTMq+/yfSvLe+ lWsJEM5kDQuY+A932TI0qmkRi+VPzOztuoW2YL/gLgSRyRghF9FO6WctdjAW+dsn4VDJ 5ofg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f8-20020a056a00228800b006b2b53de986si3402343pfe.194.2023.11.02.02.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 02:25:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0D0B481E64B9; Thu, 2 Nov 2023 02:25:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345474AbjKBJZd (ORCPT + 99 others); Thu, 2 Nov 2023 05:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjKBJZb (ORCPT ); Thu, 2 Nov 2023 05:25:31 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ADB3FB; Thu, 2 Nov 2023 02:25:27 -0700 (PDT) Received: from dggpemm500011.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SLdKN3Nm8zvQ77; Thu, 2 Nov 2023 17:06:32 +0800 (CST) Received: from huawei.com (10.175.104.170) by dggpemm500011.china.huawei.com (7.185.36.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 2 Nov 2023 17:06:34 +0800 From: Ren Mingshuai To: CC: , , , , , , , , Subject: Re: [PATCH] net: usbnet: Fix potential NULL pointer dereference Date: Thu, 2 Nov 2023 17:06:30 +0800 Message-ID: <20231102090630.938759-1-renmingshuai@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231101213832.77bd657b@kernel.org> References: <20231101213832.77bd657b@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500011.china.huawei.com (7.185.36.110) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 02:25:34 -0700 (PDT) >> >23ba07991dad said SKB can be NULL without describing the triggering >> >scenario. Always Check it before dereference to void potential NULL >> >pointer dereference. >> I've tried to find out the scenarios where SKB is NULL, but failed. >> It seems impossible for SKB to be NULL. If SKB can be NULL, please >> tell me the reason and I'd be very grateful. > >What do you mean? Grepping the function name shows call sites with NULL getting passed as skb. Yes And I just learned that during the cdc_ncm_driver.probe, it is possible to pass a NULL SKB to usbnet_start_xmit().