From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C42E5CFD2F6 for ; Sat, 29 Nov 2025 04:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NoGgYCD49mxEcy5U/zXcoMvWiWdPjcqwWl6NwL9nQZM=; b=vy4yHtcu+FBpaA2U27EzZZgDlE 7E12VtyB76C1vc3sq1w7hdWM0OMZVktbv5rqMWfVa4kPQJzYfYj4Y+Nef/T54nfyqlpfcdaMDH7p6 ghazv7JrHOdN8Iid6jXHUyOPghjCG4GBqStSYogDOgi+u7qPu8wsjUER30xtCrTkH1Z1zJFUumFB0 T9q8o6s+ZxFUOMlV0/BLOUZKg/agCjDNJ4I8IcVgiXMd9vZhBWzlKixXkynKx4qFOA6P9D8gOXR/c NomSiUUh2t2ZxTt5q5wVCg7QIqd9kMYPMdkt5emJTEkPf9bj9zUkvgjWdpUVjCnYDOab5VJmOaVOj jrfR5jaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vPCGD-00000001G2J-16nF; Sat, 29 Nov 2025 04:08:37 +0000 Received: from canpmsgout07.his.huawei.com ([113.46.200.222]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vPCGB-00000001G1j-083p for linux-arm-kernel@lists.infradead.org; Sat, 29 Nov 2025 04:08:36 +0000 dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=NoGgYCD49mxEcy5U/zXcoMvWiWdPjcqwWl6NwL9nQZM=; b=QnpmFAd6TlrubU6aXhvwZbdddGjGP4Ir8Af9ucYd6Zwz37RmBOpmDnZOmZTg4klJYnlqYdyFe fzGUlPqKZa3gf1KhWg22d0n8/OtAkZ4T2XC19qTBcxWe12ivLLL+jYD3wtzkhSVmuprFXGhUvWQ GxP75zEiFjRrAgZT3wq7nc0= Received: from mail.maildlp.com (unknown [172.19.163.17]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4dJGnT2Ln5zLlTZ; Sat, 29 Nov 2025 12:06:37 +0800 (CST) Received: from kwepemj100009.china.huawei.com (unknown [7.202.194.3]) by mail.maildlp.com (Postfix) with ESMTPS id 950921A0191; Sat, 29 Nov 2025 12:08:26 +0800 (CST) Received: from DESKTOP-A37P9LK.huawei.com (10.67.109.17) by kwepemj100009.china.huawei.com (7.202.194.3) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 29 Nov 2025 12:08:25 +0800 From: Xie Yuanbin To: , , , , , CC: , , , , , , , , , , , , , , , Subject: Re: [Bug report] hash_name() may cross page boundary and trigger Date: Sat, 29 Nov 2025 12:08:17 +0800 Message-ID: <20251129040817.65356-1-xieyuanbin1@huawei.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.67.109.17] X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemj100009.china.huawei.com (7.202.194.3) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251128_200835_557907_25C5B20D X-CRM114-Status: GOOD ( 19.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 28 Nov 2025 17:35:37 -0800, Linus Torvalds wrote: > On Fri, 28 Nov 2025 at 17:01, Zizhi Wo wrote: >> It has an additional check to determine reg: >> >> if (unlikely(addr > TASK_SIZE) && !user_mode(regs)) >> goto no_context; >> >> I'd like to ask if this "regs" examination also needs to be brought >> along? > > That seems unnecessary. > > Yes, in this case the original problem you reported with sleeping in > an RCU region was triggered by a kernel access, and a user-space > access would never have caused any such issues. > > So checking for !user_mode(regs) isn't exactly *wrong*. > > But while it isn't wrong, I think it's also kind of pointless. > > Because regardless of whether it's a kernel or user space access, an > access outside TASK_SIZE shouldn't be associated with a valid user > space context, so the code might as well just go to the "no_context" > label directly. > > That said, somebody should definitely double-check me - because I > think arm also did the vdso trick at high addresses that i386 used to > do, so there is the fake VDSO thing up there. > > But if you get a page fault on that, it's not going to be fixed up, so > even if user space can access it, there's no point in looking that > fake vm area up for page faults. I think the `user_mode(regs)` check is necessary because the label no_context actually jumps to __do_kernel_fault(), whereas page fault from user mode should jump to `__do_user_fault()`. Alternatively, we would need to change `goto no_context` to `goto bad_area`. Or perhaps I misunderstood something, please point it out. Thanks very much! Xie Yuanbin