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.8 required=3.0 tests=BAYES_00, 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 906E8C2B9F4 for ; Wed, 23 Jun 2021 02:51:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B97066112D for ; Wed, 23 Jun 2021 02:51:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B97066112D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A5CBD6B0011; Tue, 22 Jun 2021 22:51:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A33976B0036; Tue, 22 Jun 2021 22:51:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8FB4E6B006C; Tue, 22 Jun 2021 22:51:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id 4B0B86B0011 for ; Tue, 22 Jun 2021 22:51:23 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8DAFF82D4C42 for ; Wed, 23 Jun 2021 02:51:23 +0000 (UTC) X-FDA: 78283462446.24.E675D63 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [142.44.231.140]) by imf25.hostedemail.com (Postfix) with ESMTP id 3C9306000EEF for ; Wed, 23 Jun 2021 02:51:23 +0000 (UTC) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvsyc-00BNq8-K3; Wed, 23 Jun 2021 02:50:54 +0000 Date: Wed, 23 Jun 2021 02:50:54 +0000 From: Al Viro To: Chen Huang Cc: Andrew Morton , Stephen Rothwell , "Matthew Wilcox (Oracle)" , 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: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf25.hostedemail.com; dkim=none; spf=none (imf25.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 142.44.231.140) smtp.mailfrom=viro@ftp.linux.org.uk; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3C9306000EEF X-Stat-Signature: biyp8dok3q97e3aezzif5cqtasi4bp8e X-HE-Tag: 1624416683-279881 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 Wed, Jun 23, 2021 at 10:39:31AM +0800, Chen Huang wrote: > Then when kernel handles the alignment_fault, it will not panic. As the > arm64 memory model spec said, when the address is not a multiple of the > element size, the access is unaligned. Unaligned accesses are allowed to > addresses marked as Normal, but not to Device regions. An unaligned access > to a Device region will trigger an exception (alignment fault). > > do_alignment_fault > do_bad_area > __do_kernel_fault > fixup_exception > > But that fixup cann't handle the unaligned copy, so the > copy_page_from_iter_atomic returns 0 and traps in loop. Looks like you need to fix your raw_copy_from_user(), then...