From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [PATCH v10 00/12] arm64: untag user pointers passed to the kernel Date: Fri, 22 Feb 2019 14:54:51 -0800 Message-ID: <2ad5f897-25c0-90cf-f54f-827876873a0a@intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Andrey Konovalov , Catalin Marinas , Will Deacon , Mark Rutland , Robin Murphy , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Vincenzo Frascino , 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 , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy List-Id: linux-arch.vger.kernel.org On 2/22/19 4:53 AM, Andrey Konovalov wrote: > The following testing approaches has been taken to find potential issues > with user pointer untagging: > > 1. Static testing (with sparse [3] and separately with a custom static > analyzer based on Clang) to track casts of __user pointers to integer > types to find places where untagging needs to be done. First of all, it's really cool that you took this approach. Sounds like there was a lot of systematic work to fix up the sites in the existing codebase. But, isn't this a _bit_ fragile going forward? Folks can't just "make sparse" to find issues with missing untags. This seems like something where we would ideally add an __tagged annotation (or something) to the source tree and then have sparse rules that can look for missed untags. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com ([134.134.136.100]:35507 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbfBVWyw (ORCPT ); Fri, 22 Feb 2019 17:54:52 -0500 Subject: Re: [PATCH v10 00/12] arm64: untag user pointers passed to the kernel References: From: Dave Hansen Message-ID: <2ad5f897-25c0-90cf-f54f-827876873a0a@intel.com> Date: Fri, 22 Feb 2019 14:54:51 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andrey Konovalov , Catalin Marinas , Will Deacon , Mark Rutland , Robin Murphy , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Vincenzo Frascino , 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 , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy Message-ID: <20190222225451.nDNJHiXeXcV-HBL9UbCX_kEFVOVg_wFVnftKfKLters@z> On 2/22/19 4:53 AM, Andrey Konovalov wrote: > The following testing approaches has been taken to find potential issues > with user pointer untagging: > > 1. Static testing (with sparse [3] and separately with a custom static > analyzer based on Clang) to track casts of __user pointers to integer > types to find places where untagging needs to be done. First of all, it's really cool that you took this approach. Sounds like there was a lot of systematic work to fix up the sites in the existing codebase. But, isn't this a _bit_ fragile going forward? Folks can't just "make sparse" to find issues with missing untags. This seems like something where we would ideally add an __tagged annotation (or something) to the source tree and then have sparse rules that can look for missed untags.