From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB570C47DD9 for ; Sun, 25 Feb 2024 11:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Im/z5PNTpppI80x38F/r/+e8bGg50nOE122V1FzR3K8=; b=f9zTo8Z9SWP+Lb HZNY06OVFGNfpvD6/Yj7ynLCk8nx/dZmYYyJcClA+yrvU+OzIZSdVS8mun2gHpVaimGHi/dyxhIjD rx4v8EXgb9gOJdeGdFABbRUlNlz2Pasz2WVS/D3FjlLMltYokmOVFdXYxMo1Pu0WNntmsE+U3kLpY OTtjuL4q4Z68MuPQyJij+fPuGnTfWM8YEs2FaB8eeXQuXkCG84LzeWJaP+gIbEQoOuj1MCFQIU1AS +hVqirH1RD6Zxzf123CIHVrHtadCsZ1xisIuPmecrv4H4gcnlFsXUxhKU9G+ohjX7tgsD9uGlQBgk Rh926dRerIoVKVa1BKxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1reCiE-0000000EqsB-2f1a; Sun, 25 Feb 2024 11:30:31 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1reCiB-0000000EqpZ-3mH1 for linux-arm-kernel@lists.infradead.org; Sun, 25 Feb 2024 11:30:29 +0000 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240225060450.53044-1-duoming@zju.edu.cn> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240225_033028_030802_724B4987 X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel