Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4126982pxb; Tue, 2 Nov 2021 04:42:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCD3a3sj0K/RAUX9iwIakCcdUj7nRejl8xcJs6Khq7+2RF/h+8jXmedXTbekUy9INu1s0H X-Received: by 2002:a50:fe0b:: with SMTP id f11mr40642591edt.231.1635853373256; Tue, 02 Nov 2021 04:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635853373; cv=none; d=google.com; s=arc-20160816; b=bOKPzBQcfIMeGATDSWkn9Tf9jZN5iN5fNrLO6p9uIRjOdZEHEiRn1A1t4Rn+ruBWPj rKv3MhrTMaJ2lzV8mZLhMw6DApaGw+X2F9tYervUdIPicscoqU0oUU2XXaz5BK0zXei1 QfSwGlSTx2zCQk0oMFqHiYmSiiTq1RAnXhIHfw7LCO7hdA04+dcsJJIDtuh8EzFK9BIJ +91dK4YuWILWzIlmKxIsLs8AqKsI3Zpl9UBkwn8Jd5uO4ZKSj1m23I0RJbiG6V3zbqTI HT5ku3SdHSmBr5ZpPlbBw54wHubx3noINI8FvYuF+8X0Ano9OtbiuN8iYaOmWRRz51bg egDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :message-id:subject:references:in-reply-to:cc:to:from; bh=2UI4a6DEmDoK4qhEvpkOqcckJnZY0iss1z/TKcWIYpo=; b=CDMkhE+57B9mlDQ2590aXR9XmXL3VnXCFJuR/dAKfkG2U/pBfCfQqvd2qJcpZN5Kec T/7PBPfCs8+5i0lMvjvK6f2OPrIDJI9m/nqkkrlLwCyayM0eq/oJk1qCUpWx+kGShHTw hTujeVtQN4tbUt90KFSrtY49vLjG7XZmg+NbddRqTi+OYh60dQlQ+YWbyV+MwHlwKHn4 Zt77MLaSKTamwJvV8Gi67NBRz5d6dhdvv+xEZ1VdXlGhcs3qWgTN+B0SVPyNQiObH0ug AI9v+Z97dG5SXQOAKhpk1lCDg4vEACIXcJJUcUp3wXQakPo/Ouq3rnGLCuGz/AeeXyBT bO6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h18si5065842edb.621.2021.11.02.04.42.29; Tue, 02 Nov 2021 04:42:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231854AbhKBLlu (ORCPT + 99 others); Tue, 2 Nov 2021 07:41:50 -0400 Received: from gandalf.ozlabs.org ([150.107.74.76]:53263 "EHLO gandalf.ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbhKBLlQ (ORCPT ); Tue, 2 Nov 2021 07:41:16 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Hk7Fr6kfZz4xdF; Tue, 2 Nov 2021 22:38:40 +1100 (AEDT) From: Michael Ellerman To: Michael Ellerman , Paul Mackerras , Haren Myneni , Nicholas Piggin , "Gustavo A. R. Silva" , Benjamin Herrenschmidt Cc: linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, linuxppc-dev@lists.ozlabs.org In-Reply-To: <20211015050345.GA1161918@embeddedor> References: <20211015050345.GA1161918@embeddedor> Subject: Re: [PATCH][next] powerpc/vas: Fix potential NULL pointer dereference Message-Id: <163584790218.1845480.3122470991665187851.b4-ty@ellerman.id.au> Date: Tue, 02 Nov 2021 21:11:42 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Oct 2021 00:03:45 -0500, Gustavo A. R. Silva wrote: > (!ptr && !ptr->foo) strikes again. :) > > The expression (!ptr && !ptr->foo) is bogus and in case ptr is NULL, > it leads to a NULL pointer dereference: ptr->foo. > > Fix this by converting && to || > > [...] Applied to powerpc/next. [1/1] powerpc/vas: Fix potential NULL pointer dereference https://git.kernel.org/powerpc/c/61cb9ac66b30374c7fd8a8b2a3c4f8f432c72e36 cheers