Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754015AbcCHJer (ORCPT ); Tue, 8 Mar 2016 04:34:47 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:48696 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753755AbcCHJel (ORCPT ); Tue, 8 Mar 2016 04:34:41 -0500 Message-ID: <56DE9C4D.8000709@oracle.com> Date: Tue, 08 Mar 2016 20:33:01 +1100 From: James Morris User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andy Lutomirski , Khalid Aziz CC: David Miller , Jonathan Corbet , Andrew Morton , dingel@linux.vnet.ibm.com, bob.picco@oracle.com, "Kirill A. Shutemov" , "Aneesh Kumar K.V" , Andrea Arcangeli , Arnd Bergmann , sparclinux@vger.kernel.org, Rob Gardner , Michal Hocko , chris.hyser@oracle.com, Richard Weinberger , Vlastimil Babka , Konstantin Khlebnikov , Oleg Nesterov , Greg Thelen , Jan Kara , xiexiuqi@huawei.com, Vineet.Gupta1@synopsys.com, Andrew Lutomirski , "Eric W. Biederman" , Benjamin Segall , Geert Uytterhoeven , Davidlohr Bueso , Alexey Dobriyan , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , linux-arch , Linux API Subject: Re: [PATCH v2] sparc64: Add support for Application Data Integrity (ADI) References: <1456951177-23579-1-git-send-email-khalid.aziz@oracle.com> <20160305.230702.1325379875282120281.davem@davemloft.net> <56DD9949.1000106@oracle.com> <20160307.115626.807716799249471744.davem@davemloft.net> <56DDC2B6.6020009@oracle.com> <56DDC6E0.4000907@oracle.com> <56DDDA31.9090105@oracle.com> <56DE1341.4080206@oracle.com> In-Reply-To: <56DE1341.4080206@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1187 Lines: 30 On 03/08/2016 10:48 AM, James Morris wrote: > On 03/08/2016 06:54 AM, Andy Lutomirski wrote: >> >> This makes sense, but I still think the design is poor. If the hacker >> gets code execution, then they can trivially brute force the ADI bits. >> > > ADI in this scenario is intended to prevent the attacker from gaining > code execution in the first place. Here's some more background from Enrico Perla (who literally wrote the book on kernel exploitation): https://blogs.oracle.com/enrico/entry/hardening_allocators_with_adi Probably the most significant advantage from a security point of view is the ability to eliminate an entire class of vulnerability: adjacent heap overflows, as discussed above, where, for example, adjacent heap objects are tagged differently. Classic linear buffer overflows can be eliminated. As Kees Cook outlined at the 2015 kernel summit, it's best to mitigate classes of vulnerabilities rather than patch each instance: https://outflux.net/slides/2011/defcon/kernel-exploitation.pdf The Linux ADI implementation is currently very rudimentary, and we definitely welcome continued feedback from the community and ideas as it evolves. - James