Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp775481rbb; Sun, 25 Feb 2024 03:30:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX7ukq8Fq5iNLefEjZowP3HgEKw5x1d8BjfQOTGY4/TvX/FRc+r6eRdw+kBvCr0kbfc6hrcFp3Sn7BB5d+mJGPwWlejdBw+YKUJNIfq0g== X-Google-Smtp-Source: AGHT+IENwxjOO/EtXig7ZvapwOt9ov/y5mNjft9axANulRh7sdyPSLaDmBk/szanQwcWXwjGDrRR X-Received: by 2002:a05:6a21:2d8c:b0:1a0:ef48:3349 with SMTP id ty12-20020a056a212d8c00b001a0ef483349mr1952783pzb.15.1708860636131; Sun, 25 Feb 2024 03:30:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708860636; cv=pass; d=google.com; s=arc-20160816; b=h4w0ZkE2BdUuPtMmLvFv6NJ0AThF5fGAgkYgI81FjQE+UQfYNua4yXMJhF/SXVf0QG vXKdAq7jOb14gl+ZH3U+adN5rV2XgAWZnJncKctHs8zg/b6xaJf1s7Nk589JULlSy5yG 557X05sdQPvIrh5GaCWZqjS3WWRog4nZstLPSeAF8PMbWYba0uGu220o9MlnyrjHjJzC zC09YrjSb0pCPRpGgDSjeCRcOLqZZ427kTljL243N9O5zpAdjcFHSfpJlTfHVMaQVTVu vzEeiNcr5d6ixEHzalmJjkOMfDSbL+Oq5G9V6CoN7B6T3MMQkDkJx2YXDkgfaQihdOok gonw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=bYxMMiE4FxpR5QIfmjWAFYNoP9WedyUYCLwwFOmpEME=; fh=TBKLiHwodyriwh9kaSZ8EnErIt37psxsLeP0YasS4HQ=; b=ELXhEX4ca3l4wH1dmlJKGaZO0E5t3xOWvGCdwx4XeVPumK4wJ1kAnxtMI+Xaiurauo seUkBnAYf46ZsYlDNa/qaF4qTw+WrSBgcNuwtGbwHCx8n9FXCydMSIHpOCrtAfRD5+j9 qBwIloQmRIO8/b+mgtmE11J4WBDaLGzaCGiXQTm4CeIgOVP4SULC4Y/E9pZw2oQj5xSO wYEmcOIv/wUkNzB3FqgbVOEhqmPdkWeItRhh34zkY9hzR0pQKY4oSLT1n1mXqSbY5lPv uV5/zlan6K3yZL/4GezX/MqyTsQddvwcv70Y90pA4ygqOrlai99y+u4CxoVYOlds8HnO zi9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=l+2cG0eC; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-80044-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80044-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z9-20020a633309000000b005d988899a5csi2044870pgz.504.2024.02.25.03.30.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 03:30:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80044-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; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=l+2cG0eC; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-80044-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80044-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk 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 1D81BB2107D for ; Sun, 25 Feb 2024 11:30:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A461125BA; Sun, 25 Feb 2024 11:30:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="l+2cG0eC" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 47C23111A5 for ; Sun, 25 Feb 2024 11:30:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708860626; cv=none; b=LW+Of0xwdjABB9lsaLpwZQFdvy1wLVnc7O/1Zpa5EBj/f5yGiD+MJ+DpX9zUjmtCBhn74OJH/iIMozUyGs4MpJnheDIG3ZrfFqF0DMmZTgYCy/0MtA0/10Rd8iNq6F9wFur8RGS0SOluON1Rc6qvcyAfaCRv7qsyLmlK2P3oUTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708860626; c=relaxed/simple; bh=/xhhzunZeW2E/b9YwIG08hTdPnhqX7PSbgEphPPhxRc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NQ5EUt0NwB+zeQPEvh5ErT4nmQ4sJOn6YIlbtoSgBuoraweQrKOtkwJWH2BL4UJPySS5gOREBkAvM46ykcRdEu0hqd7T4PooLHTEdoUa1NEdFka8hGUDuaDUKshku9MROGLy5YR7jg5lyLvp4oIaD4dYVc/BXyHz691cKb+QGU8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=l+2cG0eC; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bYxMMiE4FxpR5QIfmjWAFYNoP9WedyUYCLwwFOmpEME=; b=l+2cG0eCh6zUb//f9bSuB7XWKp FMtEOZDvDMUn5afSp6ZYOHIk87le8gqqe9t0aZLyka2iq9uaiN5/b0cNzQVOZsZQVJdWsPRvFgsOr CUt1byhq3c4c8fvxEwQr/jojnkJSUl0tRmowfhYeozrh08ahy17NLC/ZNdHYjrLcDaPPLVd12H84N VfkcLDnJdF7HP6kLOrvgzwLQ2Bf2O0EZg3lzmWd28pJNeIydFDVjc5VOluvTX+scjwIuTxJIpeRbP 4rigVFnJCJVvfLInVQEkSHs3D56cAty8t2aRLkATGD+bhRN5JSOU4aMOznP3tHb+wNJFUFhDt2wBQ cQ0jtPjg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:57072) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1reCi4-0007N0-1y; Sun, 25 Feb 2024 11:30:20 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1reCi3-0005TI-9L; Sun, 25 Feb 2024 11:30:19 +0000 Date: Sun, 25 Feb 2024 11:30:19 +0000 From: "Russell King (Oracle)" To: Duoming Zhou Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com Subject: Re: [PATCH] ARM: mvebu: Add check in coherency.c to prevent null pointer dereference Message-ID: References: <20240225060450.53044-1-duoming@zju.edu.cn> 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-Disposition: inline In-Reply-To: <20240225060450.53044-1-duoming@zju.edu.cn> Sender: Russell King (Oracle) On Sun, Feb 25, 2024 at 02:04:50PM +0800, Duoming Zhou wrote: > The kzalloc() in armada_375_380_coherency_init() will return > null if the physical memory has run out. As a result, if we > dereference the property pointer, the null pointer dereference > bug will happen. > > This patch adds a check to avoid null pointer dereference. Again, what if kstrdup() fails? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!