Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp550940rdb; Fri, 17 Nov 2023 06:27:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPl89ge4zQmmOSbZ2TbbNMuVO47jrSrn0gRR6onn7lBD/qWxOtdmcJh7DNE0VbjVDVj9yZ X-Received: by 2002:aca:1907:0:b0:3b5:65ad:1f66 with SMTP id l7-20020aca1907000000b003b565ad1f66mr20055769oii.37.1700231267622; Fri, 17 Nov 2023 06:27:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700231267; cv=pass; d=google.com; s=arc-20160816; b=v/+rJxsUSv5bh8zckupDu6P7h54KmC8xiCaaoHswsM2mJ/JshxdL6JSB4YO4qR3tfF hJ+EEpewyHbSLE74ecSBiLkE1fPoBdovVtBC4qXYP5dOzXiw55Htx3gthiJfGeTCQMno Ck3lcZNHUHLueP82dP5BDl1w4Z6enSGecYHewev+cRgURxg7taFtsXM+kgD6YUAzP6BR KzaUSMGUCDAiFxkWi95PUUMX7H+oc4gtZ3Ln5/HX6LuDOMiRcWKLqYg2k83hHqBg76pJ auDRX030Lo79cfu5DZ5Qa3bRIM0gNvjLhqKWkBeLnzCK/OFsU9x8IYCymc9RehLalNih ymcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fh1+oW13LsJeGHg8h14RNlZl2PzXat/l8RPBJmr1IdY=; fh=d0+79POCnAUfUrT/YaCkre2ZAUzID7UcVSQJB+Cane4=; b=wQsN7M9/9fn34xj5i7d+Y5NKjvZyRI/mH7vTRlnGsd4XmiAG2SclvI5KFkj6+5i0uC z2knAbaFLOsuRoZ9J1crvZo9QKL/9dqfIoK0ORV0VvKyXpvRW/yzR7BnupjWfwBc3QDb xKGFC02QmiPd5exciuH5lBwo2jpZepnaSk8rhgr7S7KVnTbVvQUW/33i89dZiHxAjpeM k4QHW+c28VcrVdYFNG2eR4Vz3yQbJO/Rp1dQBcTibK1vcVHvxQAmUNaSl6XGIF7St3c3 V4Q4pWDQ5apJRnSzRyrH8niyTda+l8LRfEULeyFllJROGqzTtcsPpYkeMhu5DmtHWfha CbJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=jzmYDxNt; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u24-20020a63df18000000b005aee0914b6csi2110797pgg.8.2023.11.17.06.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 06:27:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=jzmYDxNt; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 124078227401; Fri, 17 Nov 2023 06:27:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231691AbjKQO1i (ORCPT + 99 others); Fri, 17 Nov 2023 09:27:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbjKQO1g (ORCPT ); Fri, 17 Nov 2023 09:27:36 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2111.outbound.protection.outlook.com [40.107.223.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADB0AD4E; Fri, 17 Nov 2023 06:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DCr3X/+Gprp6MP9s/6X8sWDM6YOI2DqSzZ0ekC6t7TkH7hrLU/fkxRQiFuqZ/mRdu70BHxaqy/bNu5a3fb7E3DkQ6pvkhRdbFWl+Nmy9/qOAsmSMSAE/ZIBhUkZzcegJzwP39DkxVhzWhjSsb1Hp/DS5ducDJ98iF6bQQbDmfHF3oIz1B1c2BG0TnhYNp7UoLGuzlAEO4YoOXZCGwTAfEqglIhhSgoIW333QU9Jz9+oNhOCL8GDqh1UFeIv0RFluf+QuLiChqUH6WRhWinSJK8+KO8YsSJnhbSF9uNmrIymtJtQgk1iCMOBlNTYzmaFSdUlG8IZUXj20FYmVxUu8bQ== 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=fh1+oW13LsJeGHg8h14RNlZl2PzXat/l8RPBJmr1IdY=; b=lFSDoRy79Gj4qMXZgrgKYeQ2TRbxBeuVzt0Sdy+TF4mHiEnPMRtHadqrgXLwIzw/azScBQuKOKjshRJ+dJAQ1rFz5bDfF7dsENQUbuCug56Jq/zCLUQnE9X9gytJJyVc+N3IGFP6MUpgJmN7TRkcVgH4KflErPafoQYP+vumKyy71ceN0l6V4s++KBtFI07kwfJXOpTDCnOYFS6250Qo0VoShmbGol3Cul4yZqZWhULvp7W1jJyAHpPwOND/6DM5bwVQdBuriDLlI5AVpHwBjKxepk8OB3sVACQIatVXRpLwoUj3PVAYnX9pIg/7ZNnA2JqCBjXjfxiUu6bkpqOGDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fh1+oW13LsJeGHg8h14RNlZl2PzXat/l8RPBJmr1IdY=; b=jzmYDxNtkj1GB+6ND37899u0QknGu8GmG35HzpAygX81YJR9Wsw4h+hWFyTeLIPITNrV4HiqlOFD6NVfm0dQPK5pAaD+7cpahkd98FfnyZcz8l5xUDQ/YL09hIl+Ps6q2FQEsktQbx0FK/hKX5bwlhaaDLG1eh3kM1RG7A4nG1I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from BL0PR13MB4403.namprd13.prod.outlook.com (2603:10b6:208:1c4::8) by BY3PR13MB4994.namprd13.prod.outlook.com (2603:10b6:a03:357::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.17; Fri, 17 Nov 2023 14:27:28 +0000 Received: from BL0PR13MB4403.namprd13.prod.outlook.com ([fe80::d3c0:fa39:cb9e:a536]) by BL0PR13MB4403.namprd13.prod.outlook.com ([fe80::d3c0:fa39:cb9e:a536%7]) with mapi id 15.20.7002.022; Fri, 17 Nov 2023 14:27:28 +0000 Date: Fri, 17 Nov 2023 16:27:17 +0200 From: Louis Peens To: Denis Arefev Cc: Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , oss-drivers@corigine.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH] nfp: flower: Added pointer check and continue. Message-ID: References: <20231117125701.58927-1-arefev@swemel.ru> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231117125701.58927-1-arefev@swemel.ru> X-ClientProxiedBy: JNAP275CA0022.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4d::8) To BL0PR13MB4403.namprd13.prod.outlook.com (2603:10b6:208:1c4::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR13MB4403:EE_|BY3PR13MB4994:EE_ X-MS-Office365-Filtering-Correlation-Id: a94540e7-97fb-4e99-05b8-08dbe779539b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5Z0bFYqzBmDpX81cNK3LDe5DeY65r1oWfWovmSqju5gPHQsl+T8AKGLXpqP3Waj3intWW+zFeXV8f5F1YHtvoRq/XwUoIhLu4qDevcimT6RCcbeYC6b3RMceVpcN7YcZUw8+SHBwpWUx+t5E9B1RI8y3Xd+Qbu6EB0IvdlGSJh2cIeVrlNi5kNnaJngUSOck4JxWb2lCk1RMghgu/dzsc0p7Ur3afqTiPwX4Y6lTrpGLzBQ6wwKgTTeNHA8vjdmEgGYtEKs6tgoVHRmLWqX7NNHou2FRfVq78fJr5Bv2YwjNUwzbjkO9WQkdfGyn2ICgk77Vg/NXqbjLC3pDnC8/ceIL5XaxK0Jgigs4JwGI/uXgpV1NFUMeEinQHH02TLUhokO4XjQ7m1q3smw2a1sy9Aq/IqDKMIth0h37b9dC1Jm01ZnMd1e/sIUOYJX7Bt0KQzWywLrAzxq+Ca4P1zY2I0EPiCsPcoihMDDU3RXY+Ie/BgQGUbXUPcLIYHbHrMIUze8u7At6wE6p9pVCKYhgeAlAFcPoEujuGLLneZDsIvlra8qathIM2qhIWdcGwYf4VVH571mj07xj0gfNWB5F6DI4Nb+NUh4AFd8vWFDRrN+fVhBeIEoLPpyvM5KCYLJG+eSbL4UPmsDCNr5YZCRehbaAiIYBme1PsZleGBvX7Rs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR13MB4403.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(39840400004)(366004)(376002)(136003)(396003)(346002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(66946007)(6486002)(54906003)(66556008)(6916009)(66476007)(316002)(478600001)(8936002)(4326008)(8676002)(6666004)(6506007)(6512007)(44832011)(9686003)(41300700001)(86362001)(83380400001)(33716001)(5660300002)(38100700002)(26005)(2906002)(67856001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?y8O1pscKI5GbfD8zs9upvFQyezXHeASKH0LWjoTUHEU+NbM9Xa57fEu7b+aj?= =?us-ascii?Q?Sx4PsPdazRB0wmTKCiAcUgtEyIylnFLctu8sf7gdsGj1mE+r6Cran/8FeEsx?= =?us-ascii?Q?QhLC1Bf350ihH+hH2WrD4qbx8QIvjgdCnxtzkYqw+Us3Wqc+fhlGQiu414Vd?= =?us-ascii?Q?zvBxtpRXCM28SmZW61EkZ8QRJ9uRDyEcuUJT5NNrlA+6qZ12NmWSoyegqBlk?= =?us-ascii?Q?LiwEYyFkLW8GqsK7cCT4bpVqsjCU11nsOMr9gpc0z0m2Yq/PHQ0jDWnZIM2f?= =?us-ascii?Q?Qw9MnUWWrdQtcT5zqbbVmILl778ivHQWwyKZbnhMaX82thU6ApeTD+TYvJF2?= =?us-ascii?Q?c15E+digZA7kOEnpXwVd6t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sXuw?= =?us-ascii?Q?gvByu0lyLTgGsyTIfrtE6jmL7wtrke5E/wCGiwqeWNBYjGhjLN6mir3lsFup?= =?us-ascii?Q?3LbHe6lq6moHb7mQX+1SWvg4tgF6WUB5fbMnmbwA4nIAb+AHznAnDJhCEOfq?= =?us-ascii?Q?sQWGqDBk8QHa3cNZmBPv2FBKXbLlvbyKow0zDY9NdzNq8G1GFFUUmuQAtdBf?= =?us-ascii?Q?RABSm5vKJ0L0ecBaOCc0Hbeavt+FhFA90U3PRQa9vi5aw7JLXPZ9fR2hIk8q?= =?us-ascii?Q?J2j+CzVUWoYPJj5+gnAWTtCzCzy16ivUfuQ+sUfBZf9BlrtGcuXuFIlxbvr2?= =?us-ascii?Q?aiLQPEPB0zsQTaP9i2tWu1YCqyZR/r2Mbu+V6K8kpPGxpo5Zm6C3FO6Ylt+B?= =?us-ascii?Q?vA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: a94540e7-97fb-4e99-05b8-08dbe779539b X-MS-Exchange-CrossTenant-AuthSource: BL0PR13MB4403.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2023 14:27:28.4215 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5ATifGmkNhDgQUytDuiiRKS0XmyZOZIOgl4sPrWs5rJG834TuyoLG9Q+oWmu1nsy18pGikqHOfJd4zViJZucPAH/pS8v/8eelerGVelGTiM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR13MB4994 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 17 Nov 2023 06:27:45 -0800 (PST) On Fri, Nov 17, 2023 at 03:57:01PM +0300, Denis Arefev wrote: > > Return value of a function 'kmalloc_array' is dereferenced at > lag_conf.c without checking for null, but it is usually > checked for this function. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Denis Arefev > --- > drivers/net/ethernet/netronome/nfp/flower/lag_conf.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c > index 88d6d992e7d0..8cc6cce73283 100644 > --- a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c > +++ b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c > @@ -339,6 +339,11 @@ static void nfp_fl_lag_do_work(struct work_struct *work) > acti_netdevs = kmalloc_array(entry->slave_cnt, > sizeof(*acti_netdevs), GFP_KERNEL); > > + if (!acti_netdevs) { > + schedule_delayed_work(&lag->work, NFP_FL_LAG_DELAY); > + continue; > + } > + Thanks for reporting this Denis, it definitely seems to be an oversight. Would you mind adding a 'nfp_flower_cmsg_warn' here as well, so that this case does not go undetected? Maybe something like "cannot allocate memory for group processing" can work. > /* Include sanity check in the loop. It may be that a bond has > * changed between processing the last notification and the > * work queue triggering. If the number of slaves has changed > -- > 2.25.1 >