Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5083611pxv; Wed, 28 Jul 2021 02:40:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFd2wPkBUAxLWHk6Sc++vWA0iP3gsP9H8DgIKatmfVZudBl+mHz9WyE4zrxT6CO2pXJx67 X-Received: by 2002:a05:6602:2f09:: with SMTP id q9mr22922699iow.196.1627465231282; Wed, 28 Jul 2021 02:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627465231; cv=none; d=google.com; s=arc-20160816; b=ayh7eEYbNSMQ8JM3sibPo7g2fAQ8B7L9vFkGYlfRq8fQRFFJqrsqO0qeTh6VHVGlda bf+OavcU8NaF4fOzR5lcbPWofdymff5qwB003J92HhMgFpXiYpSDmamfrZxUM129sLrr DjyR0isQ0D3CGdj29OeRqZ6GXgTIBGSkpGlyvbVshIVfxlLA2E5ZLXLpFTMcBSsTmF5M 7hHbNnJEb7yA0G7j/ROBmq0bdRXDp0NhQ6JB0pO91Yi9mCBeP15Y7twIMrTCM30gwsz/ WSZEgf7px8LnMbaPRbBwEumwEfxkb1oCWtFVCQSifKulV9Y+Ckiz1W/fX0Is8LVqGKli jQXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1ZYlpvd0wrMNvulsNAlFJD373h3DlBpV9FmzAud/uLI=; b=n2rVEu5ZNjbF2ZHzVEjNrCeB8iQSD7kJXG4pMg2lmB4TEbUoXWKL/voR4E4yyb/Z22 T2/VM7hhQX6vic1fyzWnmokkgks4tZzZUapWdUT6OWAX1ZbPAwCgNlTazYRSb5E+q6B2 77tdPq03lBGOpzC8UfN0HAyyr3vFsUZbn7r2+80VQQbmMLVXdVwNlD25t4GXJTeyhtQL WgUByzkK5wxOcgfFsl3spqO1TLypjshd8HUN/JKoCCiH3FDsnY/R0aPLHkcw6ZuAPZxm Iu0O6hL9ITfGDPKVu4RIdo2ff9tMyoSUsdtkhHDmtCsCwxaqIv2Wron39/xE473QeEp3 7+Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fp4iQm5O; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si7446880ilc.93.2021.07.28.02.40.19; Wed, 28 Jul 2021 02:40:31 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fp4iQm5O; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235444AbhG1Jjj (ORCPT + 99 others); Wed, 28 Jul 2021 05:39:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51539 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235679AbhG1Jjj (ORCPT ); Wed, 28 Jul 2021 05:39:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627465177; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1ZYlpvd0wrMNvulsNAlFJD373h3DlBpV9FmzAud/uLI=; b=fp4iQm5OVMwzimSby6fBdTsntfeoUE4pZKsnA71OJWHjDZBqJeqnl0ymGb5Z7qWkLZUnmn mTUOz0Mnsluv9iEGxvH+XxicjpsJDJsgHwcnIizDPoD7LqcOs8VFM17QIgU54IuEuM6i4c pSr4HxmWG/Ct/jbngGvfgQ3+lYIpOE4= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-230-QLnScPHqOVOWroGzJLdPHQ-1; Wed, 28 Jul 2021 05:39:36 -0400 X-MC-Unique: QLnScPHqOVOWroGzJLdPHQ-1 Received: by mail-il1-f198.google.com with SMTP id d9-20020a056e021c49b02902095727d18dso1191125ilg.17 for ; Wed, 28 Jul 2021 02:39:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1ZYlpvd0wrMNvulsNAlFJD373h3DlBpV9FmzAud/uLI=; b=cXf4jG0VzsVi3EoEoGqXcV5TiuhmWuF7Xd8vEdP/zsPAaB0s+uadLeTK/DnJjw107U +PnNGixGNGpHc58AOsZoomuFvco5Ov0cS8IiHvWmXR4JYpvn6qIwpNctyCB+OYT27Ufc H5iA/T6kNM3SUmBVDKLSPUSm+rDq3qRRuZGIuefNVUbi3RhRKzCkF++XPZB//8+6xRBa v/Icfn9R3m6bo0f+DYh1Ncy8xOtW1wovSNTmFg5X+HCPESdxNkNo2A4qGl2fvtz2EA4T twgsyJ2MF7j/RX8LG97n4oS7gby5f5p0pgvMV7K3Dbuw+pup7nGx2UeejlG21rHLLJJc MF2w== X-Gm-Message-State: AOAM531RGGn/CVgv17mQoQnDLOcSFCA4Kfhi3DQsnzPGBaDxFZsogKCs 2PuhQ2wDsh4i3LFtiYwGdLMSbvs6HYZLpkFg1I50eXpd4ZyUvxmUEk5szXhQ/ZTLvJ2TfsEbfoy 9puRoQqME/r27+TNUkz2/ONMsVXBAcuMtRe2RH+Cp X-Received: by 2002:a92:cec5:: with SMTP id z5mr18759439ilq.226.1627465175920; Wed, 28 Jul 2021 02:39:35 -0700 (PDT) X-Received: by 2002:a92:cec5:: with SMTP id z5mr18759427ilq.226.1627465175742; Wed, 28 Jul 2021 02:39:35 -0700 (PDT) MIME-Version: 1.0 References: <20210727111446.119561-1-mlombard@redhat.com> In-Reply-To: From: Maurizio Lombardi Date: Wed, 28 Jul 2021 11:39:25 +0200 Message-ID: Subject: Re: [PATCH V2] iscsi_ibft: fix crash due to KASLR physical memory remapping To: Mike Rapoport Cc: bp@alien8.de, tglx@linutronix.de, x86@kernel.org, pjones@redhat.com, konrad@kernel.org, George Kennedy , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mike, st 28. 7. 2021 v 8:05 odes=C3=ADlatel Mike Rapoport napsa= l: > > Hi, > > On Tue, Jul 27, 2021 at 01:14:46PM +0200, Maurizio Lombardi wrote: > > Starting with commit a799c2bd29d19c565f37fa038b31a0a1d44d0e4d > > memory reservations have been moved earlier during the boot process, > > before the execution of the Kernel Address Space Layout Randomization c= ode. > > > > setup_arch() calls the iscsi_ibft's find_ibft_region() function > > to find and reserve the memory dedicated to the iBFT; this function > > also saves a (virt) pointer to the iBFT table for later use. > > ^ virtual > > > The problem is that if KALSR is active, the physical memory gets > > remapped somewhere else in the virtual address space and the pointer is > > no longer valid, this will cause a kernel panic when the iscsi driver t= ries > > to dereference it. > > Please drop "this patch" and use imperative language, e.g. "Fix this bug > by..." > > > This patch fixes the bug by saving the address of the physical location > > of the ibft; later the driver will use isa_bus_to_virt() to get > > the correct virtual address. > > > > It will also simplify the code by renaming find_ibft_region() > > to reserve_ibft_region() and removing all the wrappers. > > > > [ 37.764225] iBFT detected. > > It is better to put the crash report close to the problem description as = it > actually shows how the issue is manifested. Thanks for the review, I will submit a V3 soon Maurizio