Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp511293imm; Thu, 30 Aug 2018 04:43:38 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbRrVyu/+sucmtuwuthu7MHHgnjfzXPbuLlf7bJkTTx6EPwSIMxzjogdTMX5wGHhvQn8Amd X-Received: by 2002:a63:7f08:: with SMTP id a8-v6mr9474575pgd.296.1535629418135; Thu, 30 Aug 2018 04:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535629418; cv=none; d=google.com; s=arc-20160816; b=NMzmJSkFRF5aIZ5EBYqNHJytrRHFnGVUYzCPaGcbeDTMj3M0zhHgis9dJnD8OwzNS8 q3RNcPKGuJjIffu8Jsd9NOopdKblyTe/HTHwVM0sm2sihejVQ95gG3jwjz+6mxxnEjcG Qt4dZhvfYDcaXHweQficKJ1cNzbLa9eQjZVhLjBnJxlAiU6JS/VvgXIrToPw4mtaoUx9 Sxwfm3Hs+k0NHlI3LdYog6B7LrEYzVAnxkzU9TqncDG8I6tS7z4e5sgVWKq6mT4r70fX 0iJH4nun7xQRS1S2YKBiKJjBTA1Bps/TxhHvLgWguEZ15XaxuJifXKvGj2/PU5a3V1Qd q/aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=QaAF7azGCBxdq6iEEzNBoAuvrmN85mP7cm3lHvX0lL0=; b=vO3r6qEmLHgmr+Jgho6u7YvVM+zAR+HMak+eLSYtleWEWWPHkL6MSbVWBUlJSvq+EV zjAIoOCs4Cr3jpvTwi63DRkTAGLHH3iyH3qvtAP3+lIXqalACx+x8jwXtXB+QpK4R2oY jEUX4fBkg4OlGkwoLYdBmW01q+J943xg40KUlPik9Rm4Dkp32A/970hYLZI3PF4kuRBp Cx+vBoYS3rWwhGyx/mOEF7aFpbG4gkpM1U3AmY2qxaeFoLpV9RZ9tJVqb1/x6/yBJ4EY O4Uth1uIaMeYcOkoN3Wvj2JIFXqadEdM+DgwlPtFunbWTEcF/mZumHTkZ7VmGssJRJTA 8mtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=akbNH9Dh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o13-v6si6525462pll.86.2018.08.30.04.43.23; Thu, 30 Aug 2018 04:43:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@google.com header.s=20161025 header.b=akbNH9Dh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728605AbeH3PnO (ORCPT + 99 others); Thu, 30 Aug 2018 11:43:14 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37761 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728476AbeH3PnN (ORCPT ); Thu, 30 Aug 2018 11:43:13 -0400 Received: by mail-wr1-f66.google.com with SMTP id u12-v6so7743081wrr.4 for ; Thu, 30 Aug 2018 04:41:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QaAF7azGCBxdq6iEEzNBoAuvrmN85mP7cm3lHvX0lL0=; b=akbNH9Dh33OFp1Yfxft1/iAWWvJdMIyZlPJJ1bI0TCj69lznWK3PI54Ty8g0gacvcP VTI4KEwgIwjURL8e5z8lVSK5LXhpqWNEr9yq465J29bgrU8yZ1vOIjdWB8SBL55Ktaw+ 8Adr/XBoiIXlbE4KMMggbcpFWiFvuTQu8b/9+ZEy2JKekcqtBUZQUbpHiHx/F7cdzpHc SCsOWLH9Oo7s3BL0RMzwMg6Pyb7eImoM78fpbnUZafChxGJqjAGAblnQ35NEWyWvHgzx Tucj0Yxt1kjv9ZOtZ2XgP81Y13NrW0z+E5TMYVyvGsqMLpUxSwRAqIkbptaHRxFhZXd9 qdow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QaAF7azGCBxdq6iEEzNBoAuvrmN85mP7cm3lHvX0lL0=; b=FVXKmOpiscDkvak/IH8VjfUIseG8NLq/XNV+LF2LSzJcNnrY50zGFHYy4wk4ejB+Ln TsHQsH7sPmPws5KYL54rmRUP2vb1dq11mPwH4odUrWBlFiXBI/plflg77NbPhoDm0ywg yE3xpWkRq5uPsdhuxsdUNxv3DRUt87Ulis5cGPN4WgZhjrUHqEyJ4379ABZYo/J5PlcT 84SlA3cavrSrXZtRGi5jThFbidPbuwKdf6qtF6gy3pbYWjMf2k64i1SVKzcdfVJJ87xC eJOtwYAAFpzZAgn+D0lQZ8akvG/pEZF46UenDELPES4T25Ub9x3kSWTzcbFcpimezo9O 6fuQ== X-Gm-Message-State: APzg51DYOlozVIGg6AX+lxsCd6aniLP0bDGMy0vYbO3UxKfuOBgIYn+r IgDVSJOlXZAfqylplaKNzScyRA== X-Received: by 2002:adf:d20a:: with SMTP id g10-v6mr7876598wri.66.1535629289628; Thu, 30 Aug 2018 04:41:29 -0700 (PDT) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id z184-v6sm2175218wmz.0.2018.08.30.04.41.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 04:41:28 -0700 (PDT) From: Andrey Konovalov To: Catalin Marinas , Will Deacon , Mark Rutland , Robin Murphy , Al Viro , Andrey Konovalov , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Vyukov , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Chintan Pandya Subject: [PATCH v6 06/11] arm64: untag user address in __do_user_fault Date: Thu, 30 Aug 2018 13:41:11 +0200 Message-Id: X-Mailer: git-send-email 2.19.0.rc0.228.g281dcd1b4d0-goog In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In __do_user_fault the fault address is being compared to TASK_SIZE to find out whether the address lies in the kernel or in user space. Since the fault address is coming from a user it can be tagged. Untag the pointer before comparing. Signed-off-by: Andrey Konovalov --- arch/arm64/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 50b30ff30de4..871fb3c38b23 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -313,7 +313,7 @@ static void __do_user_fault(struct siginfo *info, unsigned int esr) * type", so we ignore this wrinkle and just return the translation * fault.) */ - if (current->thread.fault_address >= TASK_SIZE) { + if (untagged_addr(current->thread.fault_address) >= TASK_SIZE) { switch (ESR_ELx_EC(esr)) { case ESR_ELx_EC_DABT_LOW: /* -- 2.19.0.rc0.228.g281dcd1b4d0-goog