From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 393114FF6D; Mon, 18 Dec 2023 16:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="baaNSpTm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAFEBC433CA; Mon, 18 Dec 2023 16:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1702918640; bh=HMfDRbbKf/Z1qSYNpK7m51Uxc5432zh6p5Jh4TaL/Fo=; h=Date:To:From:Subject:From; b=baaNSpTmsV5i9VjBQB9d4ghPwFzr2StFZWkteKA79p2S3yCurCjO9ELJCGw1mgBDC OSgk/BhsmZJm8Mx//7Gci6DltuQ0xb6+wEOm8+4fL1G5BavUq3OjL0Oy2A0YuzLcHM 5rCcjCyREuOs758juLvovI7sVNfDxMZLJO1EZZnI= Date: Mon, 18 Dec 2023 08:57:19 -0800 To: mm-commits@vger.kernel.org,stable@vger.kernel.org,n-horiguchi@ah.jp.nec.com,dan.j.williams@intel.com,willy@infradead.org,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-memory-failure-cast-index-to-loff_t-before-shifting-it.patch added to mm-hotfixes-unstable branch Message-Id: <20231218165720.BAFEBC433CA@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm/memory-failure: cast index to loff_t before shifting it has been added to the -mm mm-hotfixes-unstable branch. Its filename is mm-memory-failure-cast-index-to-loff_t-before-shifting-it.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-memory-failure-cast-index-to-loff_t-before-shifting-it.patch This patch will later appear in the mm-hotfixes-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Matthew Wilcox (Oracle)" Subject: mm/memory-failure: cast index to loff_t before shifting it Date: Mon, 18 Dec 2023 13:58:37 +0000 On 32-bit systems, we'll lose the top bits of index because arithmetic will be performed in unsigned long instead of unsigned long long. This affects files over 4GB in size. Link: https://lkml.kernel.org/r/20231218135837.3310403-4-willy@infradead.org Fixes: 6100e34b2526 ("mm, memory_failure: Teach memory_failure() about dev_pagemap pages") Signed-off-by: Matthew Wilcox (Oracle) Cc: Dan Williams Cc: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton --- mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/memory-failure.c~mm-memory-failure-cast-index-to-loff_t-before-shifting-it +++ a/mm/memory-failure.c @@ -1704,7 +1704,7 @@ static void unmap_and_kill(struct list_h * mapping being torn down is communicated in siginfo, see * kill_proc() */ - loff_t start = (index << PAGE_SHIFT) & ~(size - 1); + loff_t start = ((loff_t)index << PAGE_SHIFT) & ~(size - 1); unmap_mapping_range(mapping, start, size, 0); } _ Patches currently in -mm which might be from willy@infradead.org are mm-memory-failure-pass-the-folio-and-the-page-to-collect_procs.patch mm-memory-failure-check-the-mapcount-of-the-precise-page.patch mm-memory-failure-cast-index-to-loff_t-before-shifting-it.patch mailmap-add-an-old-address-for-naoya-horiguchi.patch buffer-return-bool-from-grow_dev_folio.patch buffer-calculate-block-number-inside-folio_init_buffers.patch buffer-fix-grow_buffers-for-block-size-page_size.patch buffer-cast-block-to-loff_t-before-shifting-it.patch buffer-fix-various-functions-for-block-size-page_size.patch buffer-handle-large-folios-in-__block_write_begin_int.patch buffer-fix-more-functions-for-block-size-page_size.patch mm-convert-ksm_might_need_to_copy-to-work-on-folios.patch mm-convert-ksm_might_need_to_copy-to-work-on-folios-fix.patch mm-remove-pageanonexclusive-assertions-in-unuse_pte.patch mm-convert-unuse_pte-to-use-a-folio-throughout.patch mm-remove-some-calls-to-page_add_new_anon_rmap.patch mm-remove-stale-example-from-comment.patch mm-remove-references-to-page_add_new_anon_rmap-in-comments.patch mm-convert-migrate_vma_insert_page-to-use-a-folio.patch mm-convert-collapse_huge_page-to-use-a-folio.patch mm-remove-page_add_new_anon_rmap-and-lru_cache_add_inactive_or_unevictable.patch mm-return-the-folio-from-__read_swap_cache_async.patch mm-pass-a-folio-to-__swap_writepage.patch mm-pass-a-folio-to-swap_writepage_fs.patch mm-pass-a-folio-to-swap_writepage_bdev_sync.patch mm-pass-a-folio-to-swap_writepage_bdev_async.patch mm-pass-a-folio-to-swap_readpage_fs.patch mm-pass-a-folio-to-swap_readpage_bdev_sync.patch mm-pass-a-folio-to-swap_readpage_bdev_async.patch mm-convert-swap_page_sector-to-swap_folio_sector.patch mm-convert-swap_readpage-to-swap_read_folio.patch mm-remove-page_swap_info.patch mm-return-a-folio-from-read_swap_cache_async.patch mm-convert-swap_cluster_readahead-and-swap_vma_readahead-to-return-a-folio.patch