lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <079f7b0b129f4fbc86d5f5ee8795fd1b@h3c.com>
Date: Mon, 1 Jul 2024 01:45:57 +0000
From: Zhangchun <zhang.chunA@....com>
To: "shaohaojize@....com" <shaohaojize@....com>,
        "akpm@...ux-foundation.org"
	<akpm@...ux-foundation.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Jiaoxupo
	<jiaoxupo@....com>, Bailin <berlin@....com>,
        Zhangzhansheng
	<zhang.zhansheng@....com>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>, wangyu
	<wang.yuI@....com>
Subject: [PATCH] mm: fix kmap_high deadlock


From: "zhang.chun" <zhang.chuna@....com>

I work with zhangzhansheng(from h3c) find that some situation may casue deadlock when we use kmap_highand kmap_XXX or kumap_xxx between  differt cores at the same time.kmap_high->map_new_virtual-> flush_all_zero_pkmaps->flush_tlb_kernel_range->on_each_cpu,
On this condition, kmap_high
hold the kmap_lock, wait the other cores ack. But the others may disable irq and wait kmap_lock, this is some deadlock condition.
I think it's necessary to give kmap_lock before call flush_tlb_kernel_range.
Like this:
spin_unlock(&kmap_lock);
flush_tlb_kernel_range(xxx);
spin_lock(&kmap_lock);

Signed-off-by: zhang.chun <zhang.chuna@....com>
---
 mm/highmem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/highmem.c b/mm/highmem.c index bd48ba445dd4..12d20e551579 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -221,7 +221,9 @@ static void flush_all_zero_pkmaps(void)
 need_flush = 1;
 }
 if (need_flush)
+spin_unlock(&kmap_lock);
 flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP));
+spin_lock(&kmap_lock);
 }

 void __kmap_flush_unused(void)
--
2.34.1

-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有新华三集团的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from New H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ