From patchwork Fri Oct 6 11:17:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 115049 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1668055qgn; Fri, 6 Oct 2017 04:19:26 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAdcEiS/SQZkRc2opL/G3eTZob65aoaS8K1mb0EJuCGFWcLiWQMGSmtdpkHuk2Hy7+emck6 X-Received: by 10.84.201.6 with SMTP id u6mr1625003pld.289.1507288766783; Fri, 06 Oct 2017 04:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507288766; cv=none; d=google.com; s=arc-20160816; b=DT0VCTduddoGnoCz7B8veG2JEUBd36dLMPCohKF/YGT9JeW1P1yLCrmkckatXdn7D/ BTo+yOC1sAlfBPox5lJIH8YIKOe3EYvaJ8sZqqv2JM45nK93UYJV7S8534GD+xz/KqxK XnnzRqq9bjEN8p0kzgodidJ7KibpbK6zNhU2ZAkBCaN5yN1F6I4yYpGPY8EAhE3ce/1q ySYJ0UhcxURkOYP8xhZdXNnQf7FNRFM4TOEFUaDiLz+GxipdIUO1289OWvFsHAHzN8/f NntEga6+GaQMQIfbLu7mefHN7kLOdGfVLR2j6ziydJ5zOzJDoHroUl0dJYfwBOodfiuU cY+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=G1llDQ5yJHldpvWDf0q5Au5pr5r6ixpbst4ENbCHp6U=; b=U2f5gQ6QK8zQjWt3EIFnoH500YvsP6QH7Re41bzzj0Tz8MCopbHGiprQd2pG6LnnPA mxe/zCbaE9x6F6soPey0a1RElr1vO4/yIWEBm8zHAGoEtDdzdQ2tBPocBXFiJPuWAe1N A3NT+kskeXFO8XbI04ef9kplHdxdDFiGLVDMtIwghwx/CD39tAA7eegM7wf4fNoDTT8i rTiixoS7BZfPf93ENTJMTKJ6XLuZkfi1UZCC24NCmMr8KGG4mnebyoCUV4O0z94sNt4v T84WPuCly1kuJYxmuV79ff0Q9SjZ/VDdzFPQBn0sPnNRNGiNpD46IkN+tZfTru0SWv71 5zgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=hGmy2aVW; dkim=fail header.i=@verizon.com header.s=corp header.b=APQlhXez; dkim=fail header.i=@verizon.com header.s=corp header.b=APQlhXez; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si954507pgu.126.2017.10.06.04.19.26; Fri, 06 Oct 2017 04:19:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=hGmy2aVW; dkim=fail header.i=@verizon.com header.s=corp header.b=APQlhXez; dkim=fail header.i=@verizon.com header.s=corp header.b=APQlhXez; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752100AbdJFLTZ (ORCPT + 8 others); Fri, 6 Oct 2017 07:19:25 -0400 Received: from fldsmtpe03.verizon.com ([140.108.26.142]:24434 "EHLO fldsmtpe03.verizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752103AbdJFLTX (ORCPT ); Fri, 6 Oct 2017 07:19:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288763; x=1538824763; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vCDJCC5+x+5bU9wJLRr8yarZkCU9kxiiThN6wtl0/KA=; b=hGmy2aVWVGqX9OE1OrQNkdUyevA/dEfcMROQBcZbiM/Y8OmKEqEYIZJ9 cBf8nq5spt50CAE1TEEPqEgTSt7RoEO3Y1rlQvNLhQ2tXzVCuIvo9ITjV QZNl47D5p8QkK4eMTZ77eOYMkgqATiCmlrlzFcbWnHHlXS50wLWNJ9G0d 0=; Received: from unknown (HELO fldsmtpi02.verizon.com) ([166.68.71.144]) by fldsmtpe03.verizon.com with ESMTP; 06 Oct 2017 11:19:20 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Mark Rutland , Russell King , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi02.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 11:19:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288756; x=1538824756; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vCDJCC5+x+5bU9wJLRr8yarZkCU9kxiiThN6wtl0/KA=; b=APQlhXezN6A196BkvINVJVIQHB5krZOYXaxHCUkWmGUxP0sT0D6srBvQ J5U9HDKoyL9zWAAby5x5hfFEw+xC9osJc01516oV/cMx3UpVJ5yBrfjWD ahPWxogBFKfmAL+GvxZv9uwZ/5F68IINXLuw1Q4vlThD3WsoJ7XIV9BNg U=; Received: from endeavour.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.163]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 07:19:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288756; x=1538824756; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vCDJCC5+x+5bU9wJLRr8yarZkCU9kxiiThN6wtl0/KA=; b=APQlhXezN6A196BkvINVJVIQHB5krZOYXaxHCUkWmGUxP0sT0D6srBvQ J5U9HDKoyL9zWAAby5x5hfFEw+xC9osJc01516oV/cMx3UpVJ5yBrfjWD ahPWxogBFKfmAL+GvxZv9uwZ/5F68IINXLuw1Q4vlThD3WsoJ7XIV9BNg U=; X-Host: endeavour.tdc.vzwcorp.com Received: from ohtwi1exh001.uswin.ad.vzwcorp.com ([10.144.218.43]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 06 Oct 2017 11:19:15 +0000 Received: from tbwexch12apd.uswin.ad.vzwcorp.com (153.114.162.36) by OHTWI1EXH001.uswin.ad.vzwcorp.com (10.144.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Oct 2017 07:19:15 -0400 Received: from OMZP1LUMXCA20.uswin.ad.vzwcorp.com (144.8.22.198) by tbwexch12apd.uswin.ad.vzwcorp.com (153.114.162.36) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 6 Oct 2017 07:19:15 -0400 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA20.uswin.ad.vzwcorp.com (144.8.22.198) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 6 Oct 2017 06:19:14 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Fri, 6 Oct 2017 06:19:14 -0500 To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" Subject: [added to the v4.1 stable tree] ARM: 8692/1: mm: abort uaccess retries upon fatal signal Thread-Topic: [added to the v4.1 stable tree] ARM: 8692/1: mm: abort uaccess retries upon fatal signal Thread-Index: AQHTPpS50nT5551iQUW/yoc6aXYcxA== Date: Fri, 6 Oct 2017 11:17:41 +0000 Message-ID: <20171006111704.25872-87-alexander.levin@verizon.com> References: <20171006111704.25872-1-alexander.levin@verizon.com> In-Reply-To: <20171006111704.25872-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Rutland This patch has been added to the v4.1 stable tree. If you have any objections, please let us know. -- 2.11.0 =============== [ Upstream commit 746a272e44141af24a02f6c9b0f65f4c4598ed42 ] When there's a fatal signal pending, arm's do_page_fault() implementation returns 0. The intent is that we'll return to the faulting userspace instruction, delivering the signal on the way. However, if we take a fatal signal during fixing up a uaccess, this results in a return to the faulting kernel instruction, which will be instantly retried, resulting in the same fault being taken forever. As the task never reaches userspace, the signal is not delivered, and the task is left unkillable. While the task is stuck in this state, it can inhibit the forward progress of the system. To avoid this, we must ensure that when a fatal signal is pending, we apply any necessary fixup for a faulting kernel instruction. Thus we will return to an error path, and it is up to that code to make forward progress towards delivering the fatal signal. Signed-off-by: Mark Rutland Reviewed-by: Steve Capper Cc: stable@vger.kernel.org Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/mm/fault.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 6333d9c17875..9c521f9959a9 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -314,8 +314,11 @@ retry: * signal first. We do not need to release the mmap_sem because * it would already be released in __lock_page_or_retry in * mm/filemap.c. */ - if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) + if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) { + if (!user_mode(regs)) + goto no_context; return 0; + } /* * Major/minor page fault accounting is only done on the