Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1574871pxm; Thu, 24 Feb 2022 05:48:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7chFkVBl1qad8uIYl8fN1kYI4LPe4ZJfv3fH4HRnQqzBpdI2T6tFja7WCWODGjS5d3tfs X-Received: by 2002:a17:907:20d2:b0:6b5:1bad:89f2 with SMTP id qq18-20020a17090720d200b006b51bad89f2mr2304020ejb.331.1645710538845; Thu, 24 Feb 2022 05:48:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645710538; cv=none; d=google.com; s=arc-20160816; b=Mn2GI1KvlWielLgU+jHW05gtQ2aZSFQBfMNPuIHqGwol2qMm/RsKCGJ1df7dm+QJUj VMVNkATVqqLju6F6uzXB0/aLHt4lT8U5DuWJ5mD42VwhQU/AF2lw9NcF6uRNxf3jsIPv nXvqF/Qu+kfaDw+WI2x66Qqf3kzqHUxDfV1SsX/qUnNkT8f0AYhvZMBjinJ/L0UpJpAV msad80/SDIvCdZdJTs2Q4mdprenMiDgGF7tUtp9HBMlj0v//ukSw6xNHNvdjVXUEu9yi wAuENBpCyAC29fsn9Fzp/GKBu+uP4dbX6N1joo7kTMo55CTMH8Ew888q/m09FwOe0/n7 jIgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ClKSToBqueVFilIpbe2DHEQU7dVy9VDlaqNSq5MfQd4=; b=GMY1qY82IgKOglU1LZkRiviR1xnvx+WDIlvLp2D7nxGTLBXwQiJ9dkmeAXOYl2DSr5 eFCB7NP1sSQrWHZ5+uEpq3Q0zjZwy75Whs4n7bkvndVEnL2avwUiNyEtMtjyAJK5iKPO jcqA3vXVagA+Kbcg2+UBERYf4sgpv7/G9gfAwRQMsMvG3Ns8E36+2z/9HSGHX2rXFKUI dch373KxGkZhe/47qgrfvEz7dl1ZfNTFC8chFeWdQftdpc7MNJyJku9uJZQWv2rOspcl gqUUgX0VfXLHziLhN/Y0RzXBgfo7ZQlpLtGSM9OfPDuf9UQZfl48cfYe/8xHpxv4+J9D lUlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=XyEQjTb0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20si1563713edw.366.2022.02.24.05.48.34; Thu, 24 Feb 2022 05:48:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=XyEQjTb0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235295AbiBXNna (ORCPT + 99 others); Thu, 24 Feb 2022 08:43:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234542AbiBXNn3 (ORCPT ); Thu, 24 Feb 2022 08:43:29 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E50B189AAE for ; Thu, 24 Feb 2022 05:42:58 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id CE4D21EC0528; Thu, 24 Feb 2022 14:42:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1645710173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=ClKSToBqueVFilIpbe2DHEQU7dVy9VDlaqNSq5MfQd4=; b=XyEQjTb0sUr0uaUsGPdD6PdqNBHd4r59PJfkKWWyZ6Xd8FfbT1zZKXu99dWRc1IY6UTNgg zcft490dIeHjvPdEOFsdctq0tpodcuK0QDAH7tYtHn8sjxKt3gM+k2Ck2KOcOBn1L9kb17 SgaAOcbHTeNB5DRGu9DCCWsw90OO3d4= Date: Thu, 24 Feb 2022 14:42:56 +0100 From: Borislav Petkov To: Ross Philipson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, daniel.kiper@oracle.com, dpsmith@apertussolutions.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, luto@amacapital.net, kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com Subject: Re: [PATCH 1/2] x86/boot: Fix memremap of setup_indirect structures Message-ID: References: <1643303056-22272-1-git-send-email-ross.philipson@oracle.com> <1643303056-22272-2-git-send-email-ross.philipson@oracle.com> <2e584fc4-163a-0af4-abe0-9c14996918f2@oracle.com> <6e5763be-3e9c-0199-24ea-e4f5b226d990@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6e5763be-3e9c-0199-24ea-e4f5b226d990@oracle.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 22, 2022 at 04:01:32PM -0500, Ross Philipson wrote: > In the ioremap.c module, the check for NULL is only missing in the > functions we updated but the lack of a check was already there before > these changes went in. > > In the setup.c and e820.c modules, the check for NULL is missing in the > functions we updated but the lack of a check was already there before > these changes went in in those functions. The lack of early_memremap() > NULL checks can also be found in other functions in those modules. I don't know how to understand this statement: are you saying that, because there are other cases where - for whatever reason - the retval check is not taking place - you should not do it either? Because I can see other places where the return value is checked. I mean, if the return value check doesn't matter, why not make this function simply void and not bother at all? > Fixing it in other functions and possibly elsewhere in the arch/x86 code > seems to be out of scope for this patch set. We could send separate > patches and hunt down other places this check is missing. That would be appreciated. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette