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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF26AC48BDF for ; Thu, 24 Jun 2021 11:17:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8884B6124C for ; Thu, 24 Jun 2021 11:17:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8884B6124C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=700Hrunf2R01K/4hNjkyv9Squh9NizUP+IQzeRwFfbI=; b=zQGUapFAG3Lk73 bQtFadKSeNpDog9L8XRC+2sf8ykDlSIpwdyjPswKuZI9yU2RMETLWryyq7vjJkE/YDWGFBbBd8KlU GdvQe3GyjPDnVMJPBiSsLxnk9yu1lIevjFLB/S00A9csQ+Po42QU/xoFIkLHfhc0qJsfwXjGlF0Uh Ic2lhGyz9a8Uk2yVYV/9ZrM/Cf8HNZuwZL4xcJpY9WQ2LI+FQd8OjBpqF9CKdP+OU2YV5Cb8KH1nu ZvwSHvz7h1h6K2A2cpx0HC6gy07Isqv/h+f0UhhFKBTcz1H4Ys32GMRyESeY0tDnZ1OtneNXPk/Ra 993LDC6tT6RxrFyMkDCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwNLc-00ELwv-29; Thu, 24 Jun 2021 11:16:40 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwNLZ-00ELvv-Jy; Thu, 24 Jun 2021 11:16:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=cfReeu0dJKzIeg2BgFYSOkZyK6s3mc3KPP/KhBuenyY=; b=lO3x15aO+H8qwI+t//6WYC7WHl RiKchv9n3r6OLd5/pgJ7D1tuZ6EQApIuH0qxL3ElTsS81IwkLNx4341XVBmK43GYpKP7whoRHJ+SS VDW2/x4doJcJ9mfCRUAeo4scbtDPzG907T41Vt6iegiLQXukyblzsQV8giGHeMCDDL3hZBtuzbhgy dguiNavnzYMI1cLmqywlC9+t5nN3m3Y7iuXVWkLofYfv033zhDCA0zbqTTF/ysSBEpySjbCfysbtV HOZXC1NkeT8x/38WqchMcFMR7Q7WUuN/cAtcDy6ZxxA27aUsymihPDj9ICe65lumVAl/fjAsB/wEf uQbf292w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwNKl-00GVCu-09; Thu, 24 Jun 2021 11:15:59 +0000 Date: Thu, 24 Jun 2021 12:15:46 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: Chen Huang , Mark Rutland , Andrew Morton , Stephen Rothwell , Al Viro , Randy Dunlap , Catalin Marinas , Will Deacon , Linux ARM , linux-mm , open list Subject: Re: [BUG] arm64: an infinite loop in generic_perform_write() Message-ID: References: <20210623132223.GA96264@C02TD0UTHF1T.local> <1c635945-fb25-8871-7b34-f475f75b2caf@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 24, 2021 at 08:04:07AM +0100, Christoph Hellwig wrote: > On Thu, Jun 24, 2021 at 04:24:46AM +0100, Matthew Wilcox wrote: > > On Thu, Jun 24, 2021 at 11:10:41AM +0800, Chen Huang wrote: > > > In userspace, I perform such operation: > > > > > > fd = open("/tmp/test", O_RDWR | O_SYNC); > > > access_address = (char *)mmap(NULL, uio_size, PROT_READ, MAP_SHARED, uio_fd, 0); > > > ret = write(fd, access_address + 2, sizeof(long)); > > > > ... you know that accessing this at unaligned offsets isn't going to > > work. It's completely meaningless. Why are you trying to do it? > > We still should not cause an infinite loop in kernel space due to a > a userspace programmer error. They're running as root and they've mapped some device memory. We can't save them from themself. Imagine if they'd done this to the NVMe BAR. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel