Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp72555lqc; Thu, 7 Mar 2024 10:36:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV7WD88RNW1uW7whn4j1bmfFAQEAYx4hXI3wBMYAEQbQVqRkmE2Xj7zsXIm2NBwV+yO3/G0SOE8DS5uaF4wEE5Jy3Tyiff/kFcG8Si+TA== X-Google-Smtp-Source: AGHT+IHdHdcwjmyHSgTV+BuDQwdgzfp0Kt7crLrwT8CBi8Smcb/Q0jwfDw6nLxqyXiZqziV2nPeb X-Received: by 2002:a17:903:1205:b0:1dc:b6ef:e233 with SMTP id l5-20020a170903120500b001dcb6efe233mr10124182plh.50.1709836592229; Thu, 07 Mar 2024 10:36:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709836592; cv=pass; d=google.com; s=arc-20160816; b=EtwCk8qOKROUVgKIN1cjDbheYmX8pstOVtWgvbC9ySzxVlH4TAOP5+nrpHHCNOro0U kiNHf4GmxUeRhZ6oqOzNGrNzWHAK/0/EjrkqQImx5rGdFUFn45SkHDvwcGmdSGL1MqTq ayXSDNQpmO/iDI3HOR/e+8DfGxEqmfqNJsf7u1RSIshyUl80pDnavKTQ1zCjJT8q+t2k BxfPMeiSHuuV7zeuH7D8eNt8kXlCj2hd5uG9me8o52qOzsoC/J6/7w9zIx0r+r5GcK9w xWNawiGYHoeFKTQn6Zej4Iv6LYqFsm0DJ44C01DvReyXT3JWF2a5+3XwNS5gNuPVEVxk UnwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:subject:cc:to:from:date; bh=uxhpLJpM4QjVB2xhOWsEj6nsiW5vyCLrzd15VnH7jSY=; fh=Zqdn2EedTZjkm9Q0fT82ZmqmTXt/6MYOH0N+MB5LGyI=; b=mSXTbaniuSAL4DjkXwQFbdajKfV+Y+QxVRD2nWc+15N1XkJYUfuN6eXvQE9y518nWZ 7RHxk0fKVCEAbJFgVnIufQC+gHVO/lA6+XrxytsQ584VgivLCEAkgAC6xV9sen5IbMRp uFAemomKix5EmF20zXnjvNOnGI19cQTrVojsXDWu1BD8M8GlNDaLEbjs8eiXpto2LteF Yntny0R5dh5JtXk8WRZT1ZIwvVgcuf7JEejNQBmPiV0Oj849HS1GF1UUKAYpMlKGm11w gZY7ooh8II/C/kGk5r0Hz/rOEFChD43joUNEILz+cOJPlbcMntkRCPzX0CiS9iw9pYF4 kf7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=bues.ch); spf=pass (google.com: domain of linux-wireless+bounces-4466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4466-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h6-20020a170902ac8600b001dc3c3be4b4si13858557plr.645.2024.03.07.10.36.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 10:36:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=bues.ch); spf=pass (google.com: domain of linux-wireless+bounces-4466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4466-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B257BB20BFF for ; Thu, 7 Mar 2024 18:24:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 141BB131E2E; Thu, 7 Mar 2024 18:24:44 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from bues.ch (bues.ch [80.190.117.144]) (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 AE562130ADF; Thu, 7 Mar 2024 18:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.190.117.144 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709835884; cv=none; b=LqyBvsGm9fwvVDOk5EF39eRCNsBei5r8n/l6uQct+hyJjhyTJACVnC8WJuC9xkSPsXZIlRJnJc3NOC6dZbIF8AKbW+oZ0kAWu1tHM1Jumgl5qwN/cRrZdEAIFFcsqBGQdYxhZ9F9DkusGhJt7TEcjDYBLRta8TDiLE2l3UD0CDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709835884; c=relaxed/simple; bh=bmMfawzjcrQ9urG/fPu4rua8NJxWPKOC1ywnVzCVBZo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PYmsDdbxE8XEJxuuqXTRk3oKxHyl60KPkxPaCC2oYO6/C4jAlcqpNG8Tl11zxeaz7XH8+bbPz3x5ITUXc3Iel+WIjUaECJz8++foXGlB3R0EpdT6givIdbi5T93zL4QKqahNIbaIGmLqailncdmN1VXo49SXzrdaAwTNR53bUYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bues.ch; spf=pass smtp.mailfrom=bues.ch; arc=none smtp.client-ip=80.190.117.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bues.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bues.ch Received: by bues.ch with esmtpsa (Exim 4.96) (envelope-from ) id 1riIPl-000qCZ-2r; Thu, 07 Mar 2024 19:24:20 +0100 Date: Thu, 7 Mar 2024 19:24:05 +0100 From: Michael =?UTF-8?B?QsO8c2No?= To: Rand Deeb Cc: jonas.gorski@gmail.com, deeb.rand@confident.ru, khoroshilov@ispras.ru, kvalo@kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org, voskresenski.stanislav@confident.ru Subject: Re: [PATCH v3] ssb: Fix potential NULL pointer dereference in ssb_device_uevent Message-ID: <20240307192405.34aa9841@barney> In-Reply-To: <20240307134142.169523-1-rand.sec96@gmail.com> References: <20240307134142.169523-1-rand.sec96@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/EICs9rZNMSRHQGfY17PNDw/"; protocol="application/pgp-signature"; micalg=pgp-sha512 --Sig_/EICs9rZNMSRHQGfY17PNDw/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 7 Mar 2024 16:41:42 +0300 Rand Deeb wrote: > Given that null is improbable in this context due to the calls being made= =20 > through uevent, we should eliminate the redundant condition. In light of= =20 > this, would you recommend sending a new version (v4) No. We should _not_ eliminate NULL checks in this code. Ever. There is only one reason to eliminate NULL checks: In extremely performance critical code, if it improves performance significantly and it is clearly documented that the pointer can never be NU= LL. This is not that case here. This is not critical code. Having NULL checks is defensive programming. Removing NULL checks is a hazard. Not having these checks is a big part of why security sucks in today's soft= ware. V3 shall be applied, because it fixes a clear bug. Whether this bug can act= ually be triggered or not in today's kernel doesn't matter. --=20 Michael B=C3=BCsch https://bues.ch/ --Sig_/EICs9rZNMSRHQGfY17PNDw/ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEihRzkKVZOnT2ipsS9TK+HZCNiw4FAmXqBkUACgkQ9TK+HZCN iw7FrQ/+LHJe8g6BkVKrdLKc/L7rLp0XojDoW643xNMWUXyFLCQ8WnsmkFrr2Co0 re2MKcdhCNfJPxj4A2ZMEr9ASFjll6jvqHGotdgsUHFQ0YPa+4ZLXdKNKaPgDlYp CoBs5sMNRGPtMFlh1g1U4R92cAMoSEvuj+nXEx8j+MA3dHT3fy6aPXAofVwOlwOr t9iqAeNMsR+kSf4LLKNnv3r5WmXbuWC3bMe72ESpCtExuvUkQ0RXuBBdInPXPSYC +yu5uITrNjxMzyydYo6Kkr0pksO8yrNjLQaCbIhl1xKz/KO92ye7QivRxlGqyOQZ mRE/RVthmZR1/l2HpVFgkvAlFYIEiWfLU2MJhgPaAWfPNP5gAaxrw3At0nkhx3Tf 8C8asZeKWds4eMu901VOzEO2jqDiAtjSMEhr+i4fP912DhP03HdXXYhI1Stl4wOu yx7dwOkuR19IwlGVSQ1cqKkI0a85i2oY5R7Jtub1Tujm1w23KCde/GlPIB41sepe 2N/7xOaNrJZGuKnuUgeazcdLhOhenO6SUwnC1BZYkTEtxekEGxDMby6GBqnWdwdN H2RNnbwq5BfP3V4N6+gVSOk6Td1hFMubD6rUozgvEz/xaMYMo6GF/T/WxhTpjMQ/ /uuwUDh9HHe/pgcnbyeUYllyKDaW6xAE8CwVpq8WGQurQ3I9+I8= =ZdG7 -----END PGP SIGNATURE----- --Sig_/EICs9rZNMSRHQGfY17PNDw/--