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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 1C4E7C48BDF for ; Thu, 24 Jun 2021 07:05:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A48C8613E8 for ; Thu, 24 Jun 2021 07:05:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A48C8613E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6A6478D000E; Thu, 24 Jun 2021 03:05:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 67DCC8D0008; Thu, 24 Jun 2021 03:05:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 56C228D000E; Thu, 24 Jun 2021 03:05:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 244F58D0008 for ; Thu, 24 Jun 2021 03:05:01 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4CAB21F377 for ; Thu, 24 Jun 2021 07:05:01 +0000 (UTC) X-FDA: 78287730402.36.1FE1E17 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id D6666A000252 for ; Thu, 24 Jun 2021 07:05:00 +0000 (UTC) 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=FsbMe0UYJrl3p5Jyun5PuLc/wVC9inJZkiV8VlIDno4=; b=otL3DrhgXFR1s1ccV9fei0VdBK 9L9kjUtOnSNzhxyLfCl7aIjOCP5w7DJwBt/OfSIsdm2Bec69K/nSdXpkd1Y+oHrJs4pegNRFmcm+U BYz87OLaIiHUr7fi0fSiUERbOsO3EM7ImdBCQ56tiFsFz8KdOQKnnE/M/3bzeP9yJPhDjMT/w4SdK DXWnrUvuKy5XfCKWRrx3A+bRl9KIYGk3YrTntpj9fu2kcnoRipjxiYTgPwtDHgJbQAsNBcuj8lgSD 2Npis0lLGF+kBn0EX/ATcCN3P5rs6Hlqn2637NVqiRwzST42HlehatdaIR+fH80gIRIZ3jrU8Nx9V mNEYqkXg==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwJPD-00GHgJ-PW; Thu, 24 Jun 2021 07:04:13 +0000 Date: Thu, 24 Jun 2021 08:04:07 +0100 From: Christoph Hellwig To: Matthew Wilcox 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=otL3Drhg; dmarc=none; spf=none (imf23.hostedemail.com: domain of BATV@casper.srs.infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=BATV@casper.srs.infradead.org X-Stat-Signature: j75mt4sm7d1cjndhsuc5kzi8xfsjt531 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D6666A000252 X-HE-Tag: 1624518300-559162 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: 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.