From patchwork Thu Jul 27 04:58:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13328736 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E520EEB64DD for ; Thu, 27 Jul 2023 04:59:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 142DE6B0072; Thu, 27 Jul 2023 00:59:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F1688D0001; Thu, 27 Jul 2023 00:59:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFAC46B0075; Thu, 27 Jul 2023 00:59:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DA8536B0072 for ; Thu, 27 Jul 2023 00:59:09 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A5083C0C84 for ; Thu, 27 Jul 2023 04:59:09 +0000 (UTC) X-FDA: 81056187618.25.B35BCF2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 1871C12000E for ; Thu, 27 Jul 2023 04:59:07 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=js8a6UH9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf29.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690433948; h=from:from:sender: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: references:dkim-signature; bh=13eapLMbdNZ7fvebi6P7UJIcQyxVB+Q/MG0aOqnfxwo=; b=FMzih89HkMcmWLGvv6+RE50pB7KFfIYoBBIJ98w6Ruic1QM4vg+R6YT6i2BONgJmeR7wf7 sng5q//s3ph1dwd+//Ihy35N71JW4afz1uEK7B0moehQJ0HzzosAfW5YACwRvdfitMC0tg 084F20wQrrMkvRGh66l2FzV37W3FWnQ= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=js8a6UH9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf29.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690433948; a=rsa-sha256; cv=none; b=mK2cfl5MIjH7zG011NfmdOf4nNU0LHXbCqpwwf/o6ev6P+k+VoREPK191sNhVeCqn7eKZA JU9A833t15InuWc0EKVeLAdk4Afgl3v4a9QvPX0JgKmGYGr65BAQD5FlPo0ZLwHKboIdog xYeXbLqSEK3o1TSwFkUjJ1IiYQKge5o= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0C50361D30; Thu, 27 Jul 2023 04:59:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CFE3C433C7; Thu, 27 Jul 2023 04:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690433946; bh=nI3Z9E6LOhtjoLvillvTW615wdZhZT9TfqRBESPyb7g=; h=Date:From:To:Cc:Subject:From; b=js8a6UH9dinR7AIi+YwNglSjbd6sFcwWYXFMgJXueedhSrAeN5vww8wXM6VIZzoZe cw+hm2tvfhvHA3BYoLQs5r0N4QaMEHCQnYB4iT0UjeZiRKZ4RIiA/Oy5g0tjDjLgbW 55wyhbb6qXK2G45s7s18Ihczb1IXr+KMbIcg+ZFVd348P5HPtkAYpDKbHYITqS6z08 Wk6bGMfqyRKQUkVirBTYWM83C1VkNKtke21THQs1I3nUw5VX/VGbhuFrWDmhC1CHsx YUJf0xPA0FCEJH8KXmUDTKyF66Nph6dejQgYe90jvwQfrc0HUof3cfVqiB4VnFoQN9 FwyOmxNnnUU5w== Date: Thu, 27 Jul 2023 07:58:31 +0300 From: Mike Rapoport To: Linus Torvalds Cc: Andrew Morton , Mike Rapoport , Rik van Riel , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] memblock fixes for v6.5-rc4 Message-ID: <20230727045831.GB1901145@kernel.org> MIME-Version: 1.0 Content-Disposition: inline X-Rspam-User: X-Stat-Signature: nsowqo5g188c3r4fg6ysx5zmcboogc5f X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 1871C12000E X-HE-Tag: 1690433947-929792 X-HE-Meta: U2FsdGVkX19JBTKSxOVLNozNs57tJinK4PGemkqHxlhj/khad4JLkS8Jt8PZgN/kbVzDarSJ1bjYDUdbydndN/6V/aItqLfwCFNnG6+3wJreq8cG6SFBSf/IySDSzwQXQfbUgyK7zZWeoQXV8Rc6jg1dl4tOpW7XdYDWq8jZWoCiPe5aezWuxfsUQaXYiNNdEzaziDx8b57DYJnX8MqGomw3dH7emb2jTfli64ldRVlwgdp9PWPjMJnpiFMpCiGcKbpPhyhFk5lliTfCN98T3vSKjymmfFMb8kWAseqd+g5SJRfjH6heaVEXWXhZpfBbClUyZ4v3u12+zjwjsPeclazDP5DORDKTsl3uKKclte1MGecAcJ/NkgnAdr30cx4qkQDYfNoAtUThQe7JV/my7JtA3yhaXLFnnfYsVeArLqy8R92UJcMH3L2ps95uxO04opzPSFN9wQkS1zPBB/vIVUETr5wL04Cqb3Or33+w/ZHWPeIrsVrNw6RiaQNA+SfRT7kItnsVzDUSzW96GEEnCSzskEhycJuy2uwghBOMi2LsBYtgZT12TjRJWjoKWFiEpSvyt2xobqqEfYcDeLygtPkxwXthpaWZ74Z0MERbahoCC409NrNPQWN7gZN8xpZZbtbMTMVtAd9VaG5Fj2aAs+KEtVJyaVxlUtLbWFkrXA6w0Ln8n1PwnZMIob4MRrHZnhJnjdFSotwnvRH9Xu2mVbwOY2Qd1jD+iPrvrS7SiWvPp+Y97+zt07wxi5UVv3pURJC1v8ZJaw5159TRjbRObrRSvmQXKcHtOPI1mwvAfgDK/eOQj8GeVz8vLtIOO/upGf64q574C2JUBjvEbOawCbj/+MWVLtBIdbVCAtl3JmXTzZ9Q/PiU3zug/k2uF8t7FPc/r89WmSCZHPSnzwP58cv2Fq9Ko5Cf3JHZkG6yB01mq0zJ1wot2lkvNNgv9wx6gEmO5aQ9FmciEKQ//QE IKFiUKQo CuW7V0YkfEm7fUKiQsFV6JNZhgF425n9AKLMk8p+zQklgRDzYbzEnx/g+fKGVqyPy7DLzww7FKPZzZPWbt4K/jcJf8OTk08dxT3pLIzRCjEVVYGHhDcVeRzVM2Rhm2c2waGi6tkt1Xb1kU+2ooNE7M+EsJuiVhq2jJVF8YD8m184NrzqpMooD3jD9ZkVGmpVO5vRBqOuaV3vJ77I2WX99LGHOKh06uQeuZr5vlkECreRZl88I6jYXeUfFOOn2ZTAWx2KoUk0udwTtU3JDWA/3Vy4MNUJN99Nq9cp3XQ849dytVx9XVLfWKnm/AolUecJVBUHjJBVVLYWDSqrDV4vqQB54yw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Linus, The following changes since commit 6eaae198076080886b9e7d57f4ae06fa782f90ef: Linux 6.5-rc3 (2023-07-23 15:24:10 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git tags/fixes-2023-07-27 for you to fetch changes up to 9e46e4dcd9d6cd88342b028dbfa5f4fb7483d39c: mm,memblock: reset memblock.reserved to system init state to prevent UAF (2023-07-24 08:52:56 +0300) ---------------------------------------------------------------- memblock: reset memblock.reserved to system init state to prevent UAF A call to memblock_free() or memblock_phys_free() issued after memblock data is discarded will result in use after free in memblock_isolate_range(). When CONFIG_KASAN is enabled, this will cause a panic early in boot. Without CONFIG_KASAN, there is a chance that memblock_isolate_range() might scribble on memory that is now in use by somebody else. Avoid those issues by making sure that memblock_discard points memblock.reserved.regions back at the static buffer. If memblock_free() or memblock_phys_free() is called after memblock memory is discarded, that will print a warning in memblock_remove_region(). ---------------------------------------------------------------- Rik van Riel (1): mm,memblock: reset memblock.reserved to system init state to prevent UAF mm/memblock.c | 4 ++++ 1 file changed, 4 insertions(+)