From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-f196.google.com ([209.85.219.196]:33270 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbeKNJPB (ORCPT ); Wed, 14 Nov 2018 04:15:01 -0500 Received: by mail-yb1-f196.google.com with SMTP id i78-v6so6168512ybg.0 for ; Tue, 13 Nov 2018 15:14:32 -0800 (PST) Received: from mail-yw1-f48.google.com (mail-yw1-f48.google.com. [209.85.161.48]) by smtp.gmail.com with ESMTPSA id 205-v6sm5647326ywd.1.2018.11.13.15.14.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 15:14:31 -0800 (PST) Received: by mail-yw1-f48.google.com with SMTP id t13so2345054ywe.13 for ; Tue, 13 Nov 2018 15:14:31 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20181005084754.20950-1-kristina.martsenko@arm.com> From: Kees Cook Date: Tue, 13 Nov 2018 17:09:00 -0600 Message-ID: Subject: Re: [PATCH 00/17] ARMv8.3 pointer authentication support Content-Type: text/plain; charset="UTF-8" Sender: linux-arch-owner@vger.kernel.org List-ID: To: Kristina Martsenko Cc: linux-arm-kernel , Adam Wallis , Amit Kachhap , Andrew Jones , Ard Biesheuvel , Arnd Bergmann , Catalin Marinas , Christoffer Dall , Dave P Martin , Jacob Bramley , Marc Zyngier , Mark Rutland , Ramana Radhakrishnan , "Suzuki K . Poulose" , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arch , LKML Message-ID: <20181113230900.oRq5kmJkkeJuN4z2OLF4kXgUIIga7F9nPmCo3zJUBiw@z> On Tue, Nov 13, 2018 at 10:17 AM, Kristina Martsenko wrote: > When the PAC authentication fails, it doesn't actually generate an > exception, it just flips a bit in the high-order bits of the pointer, > making the pointer invalid. Then when the pointer is dereferenced (e.g. > as a function return address), it generates the usual type of exception > for an invalid address. Ah! Okay, thanks. I missed that detail. :) What area of memory ends up being addressable with such bit flips? (i.e. is the kernel making sure nothing executable ends up there?) > So when a function return fails in user mode, the exception is handled > in __do_user_fault and a forced SIGSEGV is delivered to the task. When a > function return fails in kernel mode, the exception is handled in > __do_kernel_fault and the task is killed. > > This is different from stack protector as we don't panic the kernel, we > just kill the task. It would be difficult to panic as we don't have a > reliable way of knowing that the exception was caused by a PAC > authentication failure (we just have an invalid pointer with a specific > bit flipped). We also don't print out any PAC-related warning. There are other "guesses" in __do_kernel_fault(), I think? Could a "PAC mismatch?" warning be included in the Oops if execution fails in the address range that PAC failures would resolve into? -Kees -- Kees Cook