Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1448453lqp; Fri, 22 Mar 2024 15:43:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1nRKuBlW8al2GQemNJD/6c4+/HitIuJ07nXEGWEKO3tzfIXMFVpvE4V2yMsWKkl66fcSOTzCpNT4eeXGaKPQgnL6h/N8yST5lFqmZHw== X-Google-Smtp-Source: AGHT+IG77gw8lsFqbRrpgh9vI9WgeWBJQNUIZeafrxvsGvD/uSZrF6KsuobMf0MAzyiicyRaxj7u X-Received: by 2002:a50:d484:0:b0:568:c6a2:f411 with SMTP id s4-20020a50d484000000b00568c6a2f411mr540056edi.32.1711147438189; Fri, 22 Mar 2024 15:43:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711147438; cv=pass; d=google.com; s=arc-20160816; b=b9/VgMLx9easH9abj7Z6tysxPPvYhkqD5T0cOdFaXXWqS99rSTIuVdSKT358i1jl+m PHcY5Is70ZZ2acZSvGgir8MDOfHo+LerpsFjaa/QuBZOwTL4LyfK1ulGAi3R+6FHuNlU EluokASo6noTHw7xrFBDqepL+sAgZhVELxdLsPoznfn2w0O1m8AbHoypgEW5yP/w42Lb DBN1Xr5yWw3y9Z1G98H6q6p9UA5072KVBAkkucl6QQPRX9TXmFE0BriZP+Cr0Gm2GLsg K4V05Qntn3RFYPETymip3XyZqfhE97GX6AIIBORvubAtKeisFqVvHa/ho4dbJ8DBjhfK 3+kg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Lpw6oj86qfKyzn9E6Hgij+R38h3qBea13W4Q1PgSFZg=; fh=lU//oAjJkIxW3UrUk2aiyJJ8YE4EGtRpQAsA877V3o8=; b=eGq0/NqoU46FST62nU/MYPOM/ypoxxXhhtOSzIzSz04g72u0XW3pA5wbjgYnjWWG4X 1QF/uAxbprUuzhEzwFQeZ70Zk3cfiG7oY90GmOhVTn7fJWxws6OxRKUcfswD9W1wvorq W4C6xkdw3B7S/oArezr/6HJOCu/KzoI1rxt/kZ01KClkXFsvlI4d8Xx7kpxLsbU+1CUE Thq1qnYkdOpjmuaGFg2dYkFlBPBBYixa3GlEteWPOUYlQtkpjpasbkWu6NPQ78WW5Qpd dRAIBkP4EAgddB4933iNjZ9sEShBcEH1CzOH2/UyVIQP7kSypZP2RFrTaCxtVBVkSJFJ maVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ROSxjC4G; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112076-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112076-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g21-20020a056402091500b0056bf321455esi271616edz.143.2024.03.22.15.43.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 15:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112076-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ROSxjC4G; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112076-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112076-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E66071F2429F for ; Fri, 22 Mar 2024 22:43:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04FC882897; Fri, 22 Mar 2024 22:43:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ROSxjC4G" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AB7881740; Fri, 22 Mar 2024 22:43:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711147419; cv=none; b=YqXVxquRofCS2/D5cDG0DNQLoD1Fmpx0tu9/ynetO5lJEeXGbiR21k09wx8kDXLGmQGlmaq1mfSNAtnM2nlhSLjV/SMm2A9x5ykGfgKgcrcVXyT05W5mrXr7726nYqXYbpgbEQcz0D5O16t4HMyYdcQYzaOxtLhaYJsS2TwxYiQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711147419; c=relaxed/simple; bh=aN/sBseW/A42djcc7C5Ic5yAvi5gLg7pYn4+yQh8174=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RrS5kyS0Wxco4YShG0BLZxaX7oXhI2aMB/7zDUE2MsdLRcIiv6nRaHQ/6mHpXJaembxnuBTC3Dfi/o974i0WO4zSY+iRAoOHadT81degfCtIxe9bDyVYNrkaEFST/u7o4SAterLPH8GQLbMjWCPK8aVb+IS65ChpqgzTkKFkNkc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ROSxjC4G; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E3DBC433C7; Fri, 22 Mar 2024 22:43:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711147418; bh=aN/sBseW/A42djcc7C5Ic5yAvi5gLg7pYn4+yQh8174=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ROSxjC4GSYNreV1Fl54PtXf0zi8Y7Km8p6pIlE8+RGOvXHTaWFDKPO75Ipmrd23nM 3UPKezPW93eUTC093iowNoZb9vGYcKxDlRy9MipM0Dq5BzJmY+OHICt0ayBEJ/q5Vc ppP/Bf4i6CLJbLrx49r+JyEUB32NwFCP5KC1qc1npEnLHNZQ4lAFITesi0btb9oE2C +QhnYIUYFf/id5ZmHBo+sCcmuevd1R36I3mPt9rQPWLazBuFdxrQCGXTsLYkAIvBjB hbxO8MISgN5hv4MHz47XsQio5GeGXLbcuZ5r4M7qOQ8wxwCMQ12b1aujIN7GFpuHqS BguX/FXG9DXDw== Date: Fri, 22 Mar 2024 15:43:37 -0700 From: Jakub Kicinski To: Aleksandr Mishin Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Kees Cook , Justin Stitt , Felix Manlunas , Satanand Burla , Raghu Vatsavayi , Vijaya Mohan Guvva , , , Subject: Re: [PATCH net v2] liquidio: Fix potential null pointer dereference Message-ID: <20240322154337.4f78858c@kernel.org> In-Reply-To: <20240322195744.9050-1-amishin@t-argos.ru> References: <20240322195744.9050-1-amishin@t-argos.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 22 Mar 2024 22:57:44 +0300 Aleksandr Mishin wrote: > In lio_vf_rep_copy_packet() pg_info->page is compared to a NULL value, > but then it is unconditionally passed to skb_add_rx_frag() which could > lead to null pointer dereference. > Fix this bug by moving skb_add_rx_frag() into conditional scope. The explanation should tell us how the bug can happen, i.e. what sequence of events leads to null-deref. Not what logic your tool matched on, perhaps the NULL check is unnecessary. -- pw-bot: cr