Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2101105rdf; Mon, 6 Nov 2023 04:59:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpgEEvzNS0rEa/k6l98aq9PawBLtPYFhD13gQSk5R5Tp5Dxj3Mgq+qNIBum7xhV3w12oLu X-Received: by 2002:a05:6870:12c3:b0:1e9:da6f:a161 with SMTP id 3-20020a05687012c300b001e9da6fa161mr27435345oam.3.1699275559909; Mon, 06 Nov 2023 04:59:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699275559; cv=pass; d=google.com; s=arc-20160816; b=cUMtfwJUaru4+KMv1NpMcH8+h6jbZey4/k5Oire/4xPmZgTAh3C69PbBl3zu/CWgnx hfKgWF9hzvB/HYw2S0HLfczwG5v6adpBCDu7vr7Z55lTEWsBhv5bQc9Xmssc9mC/RefE LguoFGWv4rOKwZfrummmAuvCrhwD2HaII0qOWcQXojETbqJDtAC5+9K0zX0EGnfTUo/U 5/cTjA1kGXQcoJ9qJhvEPGqofjTxOs8YQfbiF81XymmdHGRYu+TsujOHZWjaBLsJdS7H 4Khnb/I+VMEQMTK34Ske0pLzZHP1xGFMvUzx1IHibIgJGMNXxgfKkwHaGg0XMuLHyXEz 0V6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=7+h5j8HFh3uNxiySGZ5pBdYly6P9hBm3G+RgevQqKns=; fh=FGrQqC77eavuT9ijOAKeaeiTaQQyEQq7spA1J95vH7k=; b=mwpcN+mPT3svPEsiWgSu5WjhHIvlPD20rTIqL1ydAC3cuIa+a8hgkmExGze96QBXcG whPMyf0Qg1ejkAuydM+NKYHojgPSkJYRAb8fJSx0F4FGUpsY6TKmTVw5Aq9G9trOCDpd PVDGidotAGwQeKmmw1rEQtYHTow7WlW6rS5hoYL3mz5WfcdW6i/vNl0IzpkqgjpKz/Pm FFFhr4p28GrcMObOYvCExrRiLnvX1ASnHCu+vnrL4A/V90awZl7F4dOq63xA68mUEi4z jY//2a8aMkec7sNvPw4kg0Jy4wNl2p/UZB/WwnR7+QHuNvg2O8ctqN3PmZcuG6/TUv9H YtEw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=kdh7SkR2; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a1-20020a636601000000b00578d0d070f4si7516298pgc.844.2023.11.06.04.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 04:59:19 -0800 (PST) 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; dkim=pass header.i=@suse.com header.s=selector1 header.b=kdh7SkR2; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D6619803E7A7; Mon, 6 Nov 2023 04:59:18 -0800 (PST) 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 S231641AbjKFM7S (ORCPT + 99 others); Mon, 6 Nov 2023 07:59:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231590AbjKFM7Q (ORCPT ); Mon, 6 Nov 2023 07:59:16 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2084.outbound.protection.outlook.com [40.107.8.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 944D6A9; Mon, 6 Nov 2023 04:59:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IOqZXYVMzAbQSIb1CkJhCjPLLOqiyVDEpBuW1AJb+8C0PCnrzeF+xJwG75vDCFYTXn7iezpTR2XLl9htwzaJWUzd700fGcJvuzkI+k7RF/YH4DfMn8K9I+bmaDTB7G1f87NMOv635NDFjXz46S4uAri4wbNJoWR7ZTqUfmRSCX3mN/Rsykl4YOQDKYhWvYTncegIKCvO7zNxLcinB5ygsr8IbWwvlfIob9zBm020eBCBe/LIUsEtJyDQtpFSiK+eT9gDyM2mm8C9kGGTjAP2+Fy7KuUxfMqePwhMfJUD6x7haK5JfXVc6jTeYXZhxPonONUL8qyeSW0Z8dJYl84UZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7+h5j8HFh3uNxiySGZ5pBdYly6P9hBm3G+RgevQqKns=; b=HryeZp16gwlLUpf0IUBEHZfNAXU/cCW/geIOrRMRk7HWrk7MscKMemAoljZvG1mh+grBGqGkEDaQTWCxTW1QbRWbqTbeKpCWKQrO6B0ggfqqOSVpeqhVfiWTdXL3QTVubFAfihJxQg6hDOYEkyGLeqB8Y0q500FqmbL9e+1deyYgSCBpBtuZ8BoA+JuMAbXyWDaefgciR+IJNMI5z4mOGiKHCtqeigTvTNuWR682hhYEsxOzADoEvptYuqpFA+0QFhnAt/Wf5AQ5FwIiGVtzR3kdcl2Q6dEHS19O10HohZHmDJ7K4A0R2O1H/Lj0DzND9YQ7vTfu+LZyaekKwdBjcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7+h5j8HFh3uNxiySGZ5pBdYly6P9hBm3G+RgevQqKns=; b=kdh7SkR2bqfLiJOLY+BF9onN2ZrIBQKij0k84PpxkkEgQsk0JBwYUW2woBIC9tZ9JPtLZkdBdtMLS6dlkFlJs++9lyAdsS+Qs/KvxSAJpIlwU8Yv1LaVSl+lA5mr4Na5mazpKP968u8jO+P0/zJ5EdGAuhLOWJnCiopZXAosVZAotHx351cn5ApkjvFjIM4lh4koBxrcA1JuXjb2nEgGQgUVZGlb3DJt6n1hYcgpQ3BdInTncRBHYwMNJP09ZxUd5igb1tUeLtHYPkMqJP/rAm/CM6qZhRUk/nATR/Zm53hTMXO70jzAkHT68btfhGZ8LPoqWtYcLgviGPOss5jyUw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from AM0PR04MB6467.eurprd04.prod.outlook.com (2603:10a6:208:16c::20) by AS8PR04MB9190.eurprd04.prod.outlook.com (2603:10a6:20b:44d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.10; Mon, 6 Nov 2023 12:59:10 +0000 Received: from AM0PR04MB6467.eurprd04.prod.outlook.com ([fe80::5c46:ada1:fcf3:68e6]) by AM0PR04MB6467.eurprd04.prod.outlook.com ([fe80::5c46:ada1:fcf3:68e6%6]) with mapi id 15.20.6977.013; Mon, 6 Nov 2023 12:59:10 +0000 Message-ID: Date: Mon, 6 Nov 2023 13:59:08 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: usbnet: Fix potential NULL pointer dereference Content-Language: en-US To: Ren Mingshuai , kuba@kernel.org, =?UTF-8?Q?Bj=C3=B8rn_Mork?= Cc: caowangbao@huawei.com, davem@davemloft.net, khlebnikov@openvz.org, liaichun@huawei.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, oneukum@suse.com, yanan@huawei.com References: <20231101213832.77bd657b@kernel.org> <20231102090630.938759-1-renmingshuai@huawei.com> From: Oliver Neukum In-Reply-To: <20231102090630.938759-1-renmingshuai@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR4P281CA0328.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:eb::7) To AM0PR04MB6467.eurprd04.prod.outlook.com (2603:10a6:208:16c::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6467:EE_|AS8PR04MB9190:EE_ X-MS-Office365-Filtering-Correlation-Id: 0397ad27-0b9c-49a5-9461-08dbdec82b21 X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xn6BdmvmFe7sZYDy5N/4DJXdnvhk4CpcftiDnu6yYOjSsHkjS696yI8mx8Cz74M9ueHjReQRzZFUlQH9A6VihalgEfQbj1iXMYNjeAHpBQRVIcVertEP15dwjTcX6MzHiYDFdtcuWK4uFE02aMEG/boFwsJiBBiqnKAv0LAfZOHvRFnT+9ADPudXH+Qz/G2MmWp2WyONfTO/PUVTUJrrOEAhjTq3Bz1+yyPBnqWxnWc4sT4jXPlxyvQX/Ko8y9xGTWzdyNi5fZJym6o6/f/muGkQzktHX1OBYJQXO6sFT2+nho8JwVXvKiTguXDIztIkbLMt8i8CUd20ArzG7lJ2uGgyRWyxoq4JKryaIbgpfUXprHVMTmhIOMCQqbrkbv4G0JC/a4+whZXKQREX1jGtWK1hLXwO7Bs6s6oBaOqvZjdFwFYXEBvI6pzVAAHvqmfQLV0LG8J1sAxybXLoUStORIxBUxn3BqJA9zNiPURGw3csqgmCcXuhnWySm3wmt2p+IT98EXhqxlQVF94ewPooUIWTtO9gngevDEgNg2H04z8K6iapyYy80UNl5VEHWvkdpj2jjvtjgQUmS3Vx9503FDSRRQKCOUo5HIuDa3AEldH1I7/cA8MoAdJauTOkEeSmbiUZNVcK910TnDscy42iKQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6467.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(396003)(136003)(366004)(39860400002)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(5660300002)(7416002)(66946007)(38100700002)(110136005)(66476007)(66556008)(8676002)(8936002)(41300700001)(4744005)(316002)(53546011)(478600001)(6486002)(2906002)(2616005)(6506007)(4326008)(6512007)(36756003)(86362001)(31686004)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Zk5zUDJ3c2F6bFZjazRMcUx2RFJacnlOQ29wSFBoSW5kbzJ2bzBqbHE4ZzEy?= =?utf-8?B?ZWhjZ3hhL2M3R0ZwM3I4U2tyWkZubDFhRWFVRVIzbDBJRnRJRzNOVDI2ZTJN?= =?utf-8?B?YU5zWjNUTVlnQUR5Yk9XRFpaUWVXalBXUVNKNncydG5UMENZUC9RLzgySDR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1YrTkw4VmZ3YkZJWXA5QmluYS9KdXdNRndESDVu?= =?utf-8?B?eEtCbjZJZzhBdGVHcUJtaWo0ZTJqaDkrSDBjaWFlRjlYMU13KzlvU3pOMVBx?= =?utf-8?B?VWhLbkt1d0V2QTFpcG15L01JTXYwMUZQQ2NRRVE5M2RrbXdHWmw2SmY3bDNG?= =?utf-8?B?WjdrQ2ptdHBCWGhvdmViQWg3U0VtcG5KdmhTcXhiNkM5emdpZVlJa2VLSW1n?= =?utf-8?Q?857UEHUHLDw9f+ZoNzfjt6RMt7t4mHcSmG5TaH8vt3CP?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0397ad27-0b9c-49a5-9461-08dbdec82b21 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6467.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 12:59:10.2566 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: G9X42B0zUI8agHMsLB5K14LnYmHKO+S/qY+NTdB1Y6vaaFZR4fTGLTE+4kdmM9c/J8T2TOsI24kddNV/me6aHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9190 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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]); Mon, 06 Nov 2023 04:59:19 -0800 (PST) On 02.11.23 10:06, Ren Mingshuai wrote: >> What do you mean? Grepping the function name shows call sites with NULL getting passed as skb. You may see that we do check skb != NULL before we timestamp it. But later in the process we depend skb == NULL implying that tx_fixup != NULL That is the combination that must not happen. If it happens, though simply bailing out seems to the wrong answer. > Yes And I just learned that during the cdc_ncm_driver.probe, it is possible to pass a NULL SKB to usbnet_start_xmit(). How can that happen? And if it happens is tx_fixup set? Regards Oliver