From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f198.google.com (mail-qt0-f198.google.com [209.85.216.198]) by kanga.kvack.org (Postfix) with ESMTP id 157E36B000A for ; Fri, 29 Jun 2018 09:43:46 -0400 (EDT) Received: by mail-qt0-f198.google.com with SMTP id f8-v6so8885933qtb.23 for ; Fri, 29 Jun 2018 06:43:46 -0700 (PDT) Received: from aserp2130.oracle.com (aserp2130.oracle.com. [141.146.126.79]) by mx.google.com with ESMTPS id e186-v6si3446555qkd.80.2018.06.29.06.43.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 06:43:44 -0700 (PDT) Date: Fri, 29 Jun 2018 16:42:57 +0300 From: Dan Carpenter Subject: Re: [PATCH v4 00/17] khwasan: kernel hardware assisted address sanitizer Message-ID: <20180629134257.ci5ninozkh2ni6wd@mwanda> References: <20180628105057.GA26019@e103592.cambridge.arm.com> <20180629110419.GC26019@e103592.cambridge.arm.com> <20180629112613.7i4xesjyxolc63gu@ltop.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180629112613.7i4xesjyxolc63gu@ltop.local> Sender: owner-linux-mm@kvack.org List-ID: To: Luc Van Oostenryck Cc: Dave Martin , Andrey Konovalov , Mark Rutland , Kate Stewart , linux-doc@vger.kernel.org, Catalin Marinas , Will Deacon , Paul Lawrence , Linux Memory Management List , Alexander Potapenko , Chintan Pandya , Christoph Lameter , Ingo Molnar , Jacob Bramley , Jann Horn , Mark Brand , kasan-dev , linux-sparse@vger.kernel.org, Geert Uytterhoeven , Linux ARM , Andrey Ryabinin , Evgeniy Stepanov , Arnd Bergmann , Linux Kbuild mailing list , Marc Zyngier , Ramana Radhakrishnan , Ruben Ayrapetyan , Mike Rapoport , Dmitry Vyukov , Kostya Serebryany , Ard Biesheuvel , Greg Kroah-Hartman , Nick Desaulniers , LKML , "Eric W . Biederman" , Lee Smith , Andrew Morton , "Kirill A . Shutemov" , smatch@vger.kernel.org On Fri, Jun 29, 2018 at 01:26:14PM +0200, Luc Van Oostenryck wrote: > On Fri, Jun 29, 2018 at 12:04:22PM +0100, Dave Martin wrote: > > > > Can sparse be hacked to identify pointer subtractions where the pointers > > are cannot be statically proved to point into the same allocation? > > sparse only see the (deatils of) the function it analyses and all > visible declarations, nothing more. > > It would be more a job for smatch which do global analysis. > But to identify such subtractions yu must already have a (good) > pointer alias analysis which I don't think smatch do (but I can > be wrong, Dan & smatch's ml added in CC). That would be hard to manage. Maybe in a year from now... Pointer math errors tend to get caught pretty quick because they're on the success path so I don't imagine there are huge numbers of bugs. regards, dan carpenter