Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp167934rdb; Wed, 14 Feb 2024 17:02:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUFUyjJqbrdlfPyXerXtWD79sk7RsCFrlIO1WDXjy8N8o2Y5dzdSQs8liizXCi2qbjJTqEMaSMoB+Vg8ywEXxIjKIL8336rJqSXE0oejg== X-Google-Smtp-Source: AGHT+IH2S/PyJ0lmk4uE936WBpC0K6Rmgivg+NEw8g+eq0DiUCRNKZPPbif/RWeLTkAn8PQGvVfl X-Received: by 2002:a05:6a00:1e19:b0:6e0:6c0d:f55a with SMTP id gx25-20020a056a001e1900b006e06c0df55amr523347pfb.8.1707958952992; Wed, 14 Feb 2024 17:02:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958952; cv=pass; d=google.com; s=arc-20160816; b=x5bSODIwB6oCIavU+/gfF8cVB3L/7LFdmy5JEkVdwTrPQee5mqpqcYCKZ2hu43ui9e Q2tHi8FRxM6+wpD1jf0qNU4Qe+XY43D2cxr+Gxr5fFxC3VOYq5iXAN3EuqOXd0tX/Ch+ PlRHl+1iywtzt463A1BsGOr5SHCRAf18ovl61qCh4k3ihvcKFq4Df0FNutsPD4fEKiGX 1vWHoSK15RsfMHbRt6ngfTkQjOCzzFNxLctTu5h0Gi2/GkURH2pm+n/9NDKtkC+Vjn8D v4ALMBnUj3oOzlcj6BXf/kp9xlEes5HlV0VBFYL/uuX9OOApdbBUN3SH2hxhLJXNfDta RtEQ== 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=RJkFsauJL810yT0iHgRnHLR377X5iUusl/j7xh7lZIU=; fh=vXMggOb5zMHKNRUPMCdsNY7x8g9GQGdrC0TjnDfede4=; b=IiUgcgZLtuI5HSIihhnFDInRciHBdPIhh0LXS4dLVsegkMdEw1pnt5i8cHc+k9+0jh 0uYhHZ1UHsW4fSzbG8iHNso6WU5qDeF2vQUxMTutQHZuR4VFDheAbgRZTIxL6ILza8K0 J2C8eI3jBMZ/R5h8BWM6E6oy//F7tUgF2oYNTtiuWmxfA511wv/fh2kA5DKhy9pG8iPG ZNDOFtA3S3dYQdzX+8U2pQ90xrAYkabpumBkseU/egiDLgX91DKBH6ks/P8p13FYj32O 9pLWom/vB5FjEybN0+67hLNNb2+d/yw0eXTGc83C+481LyhhootTlBm9Pqijy/lWDIVK UVhA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CVQoZunP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66210-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t22-20020a63b256000000b005dc36279d97si116210pgo.133.2024.02.14.17.02.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 17:02:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CVQoZunP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66210-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 310BF28CBE4 for ; Thu, 15 Feb 2024 01:02:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED7BC137E; Thu, 15 Feb 2024 01:02:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CVQoZunP" 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 21F2E184E; Thu, 15 Feb 2024 01:02:04 +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=1707958925; cv=none; b=JLOL08xUOyIlEqQGraj+QMJDwvZ5q9zMlzzBiKHci7APQ59K/lQ3cRHQH41GPDoNegLzjr/6D1wsnjV+SIMB+r7Bxoo+pj25FjGQmaT3G+m5kY8Y0Ey8v40xID8I/7owxZgcQ0Wfws3ia9oXt+wv6WKg9G0pvufYR62AmBQ7hHU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958925; c=relaxed/simple; bh=Z7IBwlxEVPqGxWdYiyD7ZJELI6QCwfFBuGkNDpX6rrQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=feoUdIAoGgGs7bWRHQBIzuu5jZ52ZiHTWTnS1ilPYn/43VUcAuK6CCzPdmx9GKrWb1qpu394bssadpK6XaXWIwh2AAuwgFHoKKa1Yn9R9Kzgh19aXlX4YJ78uIl/WhNeAN1vH8Xr9464Z+TY8iaGOR2PsT2dOpsB3r9H/eLC5MI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CVQoZunP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C5F4C433C7; Thu, 15 Feb 2024 01:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958924; bh=Z7IBwlxEVPqGxWdYiyD7ZJELI6QCwfFBuGkNDpX6rrQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CVQoZunPb8jvNkG6H2BcauSGZlEDjo4hi1jrW8wc9BkZx7jvJgL0H0piu0fejtxSq H+nksj2s+5vH9/AhV0nGy3BAZYnvh2fB+4zmb+2nqYPMeXrPWl1rD/FoUC4kKAfeop uc1IubG66AtffHzHRNx89IWicLY06hu73DDhLO4SqArrcVuCo2utRFZc2BdR72ZCpu y0aTMDVKk4+zBeNgHmnjkvK695Jawn000dSgPz45HpzD798WcWPvlf4LPCSADvHikE XlOLdfMpECewgAIyWmoAllgeLxNxA2htBM57hNbxih4SmluDuS4FnwjQuVyn2WDS5h 8FsXb/9CSH/VQ== Date: Wed, 14 Feb 2024 17:02:03 -0800 From: Jakub Kicinski To: Rand Deeb Cc: "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, deeb.rand@confident.ru, lvc-project@linuxtesting.org, voskresenski.stanislav@confident.ru Subject: Re: [PATCH] dl2k: Fix potential NULL pointer dereference in receive_packet() Message-ID: <20240214170203.5bf20e2d@kernel.org> In-Reply-To: <20240213200900.41722-1-rand.sec96@gmail.com> References: <20240213200900.41722-1-rand.sec96@gmail.com> 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 Tue, 13 Feb 2024 23:09:00 +0300 Rand Deeb wrote: > + if (skb == NULL) { if (!skb) is more common > + np->rx_ring[entry].fraginfo = 0; > + printk (KERN_INFO > + "%s: receive_packet: " > + "Unable to re-allocate Rx skbuff.#%d\n", > + dev->name, entry); no prints on allocation failure, please, there logs will include OOM splats already. A counter as suggested by Jake would be better. -- pw-bot: cr