Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418AbdGJK2R (ORCPT ); Mon, 10 Jul 2017 06:28:17 -0400 Received: from mail-eopbgr20112.outbound.protection.outlook.com ([40.107.2.112]:13216 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752457AbdGJK2O (ORCPT ); Mon, 10 Jul 2017 06:28:14 -0400 Authentication-Results: google.com; dkim=none (message not signed) header.d=none;google.com; dmarc=none action=none header.from=virtuozzo.com; Subject: Re: [PATCH 1/4] kasan: support alloca() poisoning To: Greg Hackmann , Alexander Potapenko , Dmitry Vyukov , Masahiro Yamada , Michal Marek Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kbuild@vger.kernel.org, Matthias Kaehlcke , Michael Davidson References: <20170706220114.142438-1-ghackmann@google.com> <20170706220114.142438-2-ghackmann@google.com> From: Andrey Ryabinin Message-ID: <66645c53-de05-8371-ead8-d4e939af60a7@virtuozzo.com> Date: Mon, 10 Jul 2017 13:30:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170706220114.142438-2-ghackmann@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: SIXPR04CA0047.apcprd04.prod.outlook.com (2a01:111:e400:51e5::37) To HE1PR0801MB2730.eurprd08.prod.outlook.com (2a01:111:e400:7baf::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 524add3e-c2c8-4990-a600-08d4c77e5cbe X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:HE1PR0801MB2730; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2730;3:BpQZ+JVI8OCkTh9MGwbATYd9bmiiHQcwqCzCa9lc75/Pieu1fzs1l/4HG55RzPJn0aT4wyIuhtFPXw8Q/EXBHroTW2jz+Vi5D7jmeyAk3cwPaTr3SmRg9JO1pnzwJH8FVQ8lMDapYm8JjLvzcAuSvjSblNvoCzi+KRnIpTbd7eOVb7OxKKC16mjy3w0gSD4zi1KJRmvU3xs7c1OIP1wm2EeD/9qvAb3X6PFZjaaepXDGxvxay0pstU2/30F6lKbSFPXou7ErC79eSKFb1jZg8ioS+kKa3XEfVdq7XJY7rK4h/UGpWZud+QwKRHhWCr1x1WpVgaBtk+AkZ6IXs8r6QwlnsCOu+TTJNJia8Zo19PUxuuVNIH8N8zVCV0fb9XFRHb1j4bkupNi0tdiVwwZxh8x0cEvo4o10ri0qSDu3wicNAcmMgOIqrAJ5f43n8uCUOXmxxU0DRm+waNqHLT20+lyAXPzXn4LeN+Utr10EnBbPyaHkFBmuaVloBMVtZfkd/s8UBA2agCsD6NtXL9vpfrTBBOxxjaQ3bNrwppqz0jDsqXlPcswaXvmqoIr4/tzJ8q6pCBtc3oAHB/OBLWAcwmuU18IkLo4SQLQw8D9Kidz+ODQh7zqXfTLNvRQJfY75HXkW7WxVLdC/o8FJMFSl3aT0Tllpk7iIp3RxFPIoG8cOvu1VQCGif8rBXlVUe9Yp6/6tF8/huhqW86+BKvFWgfAMOciMzhyx9lH3aLw0MIw= X-MS-TrafficTypeDiagnostic: HE1PR0801MB2730: X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2730;25:WbZUiYlh5mFUK6ZPug+thAGK1NMfkv/etqaq6smslYGVvI32pQHD7+hkb9gUKhERIhFF8oAy+P1LUGfD2AbRp5iNNJBCsGIbm3Xm+UIzJtcPRXwlBGDCE84tqIudoNcfDCzk+tItyRxRwPRfR7yRGUIu92hrJUozRNrHvcQoLxOj0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3Fsf2OETphrPg1m2qVaJW7vuci6tV54yucsInCq3Lt6Yl+cLd7Eo9vQCF3TVprigJGkqnRkgD2hrYFO1IH0GLqIoZcpyAr4MyCz79WFBQNZZuKSK6gErZXl0/P1Pp1m9gRnlMpDj9P2HrgeKy+2ejL0B28wttVvKvI8pveWZhtcCOydYPSX7jwm1ViKPbYHfy5W6OKSM0NcvnsUc47h0CjniryrUYtjMsjyjUgAamSBvxgWpulQNJ242SNAFmlZX78vNDHa5FfZNkrjceijTkje8F4PRlNSY2J5IoXjxksqFH/yBOlBlxXwoos4DBXp8JuPOBJ0Oa4HkB0gcmDuxBpJ11VO2riwbGPxHw7LxvmNqbTHoTQRdI4G1SQBS3MuJW48SDA7nSvnKH/Ydz/I8nA4Z6x5VW4U6c0GoiX8eggLP31B+ZuuJyyGG00lAg== X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2730;20:ltupRxupxVQrQNTKgInUEctdElWypsUZJaKYChF6CwVj6bah3qg2m98qNX6ulIjr06mMMowUJPiNe3eosYcHwrAy2GdUAvPVPrBonYByW6ybDimNsC3cBzKgC0hdaiuXJpaX4yNrFRVnjXjF12U8vT9gBRMQmUmaBX60zZFVagqxEo8FsLvM9F8eWLRWZVMfp5YV9O2eJOg1P68ZxebU67B3AOYWI2x1Ln2hqHrF4t4vqX0uvdo73DG5zNkaoOlf1w9CinD2uZoD8Lu7kufDWOkAu0qDAM1fxLRF/M2qOuAwrCJ6zSRz+KUiNqlhQjfUyNWPE1D6BCEFpNFlr6why5VM2/Tw+ye/CdX2So3mkpyora4hx7RVEmQ+Jrcph6WtLZoaVvALaoOHf0c52bpae6fRwtDjCPHBM4TjBsrEbSI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228)(211936372134217)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6041248)(20161123558100)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR0801MB2730;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR0801MB2730; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA4MDFNQjI3MzA7NDpraElmUVNrak1mSnIzVktxQzhzWHA0SnpH?= =?utf-8?B?bm9wbk9RRWE1czFJM1JZSDE3OHBUdW9vT0FJcVBwNVZhd0ZjVUtJYkNSOUtR?= =?utf-8?B?Y0daT2hnRjBhWk9VT2Z0eW5qbVRBQnhPRmY1MVh3ZzNHYkprNmw2eTV6RnVi?= =?utf-8?B?MHFaSzRXd0F2UUxXMjJwVHB6SjRYcXE4cW1yWEc0dDM1QzBWd21jQ2prWWhv?= =?utf-8?B?MkVYd3Q2UnRHMlVlYms4ancxZjRGQUlNMUFvd3p1VEVVNEg5VXJLZjNhb3Q4?= =?utf-8?B?UXBlMnpPbzQyTGhrMndBU1JTbjVBN0k0cmtaNHRnTlJpQ3IwMEdSR3N5eEFZ?= =?utf-8?B?NTh0dGJhd2FFZ1p0UmFsT05LWHdGdTdqRHpNak9ZNmxwTkpoSi9pWUxKdUpY?= =?utf-8?B?TTJrd1VSQ2NjdzN0dlkrZUJLOFFXcHRRWkpoejRUOWNxandFYzdIVElwUVJ1?= =?utf-8?B?YjJBT3FRcWxqQ2J0UHJrVS95eURxOXcwdUhtMlZCS2tJWFd2eG5reXIyWUNt?= =?utf-8?B?UC83OG0wVXp3OE9VWmRITDlybGJZVWJuVlNheXpsa1JYUVJaTnh6RUNEb1Ni?= =?utf-8?B?ZmRIQ2ZqamxRWlVwcGJneFFpa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h2Z3JCZmM1QmsxbkhnQ0VGZjArYzZ5WlBYK2xUdmFSSm85?= =?utf-8?B?R2hQZUtwMGUzQmFFcVlsMTMzeGJhNXVRVW5xRlBTZitzeS9Rd0xnUEZWanVm?= =?utf-8?B?TjdxSUoxRklmWDE0VUJ1cGVLNmRrNXl6azN1cUtHRDByRGlOZ2RiUm96eWdy?= =?utf-8?B?TWJVaGNBSFJNRzkxc1hiR0dYa2VuemRCQmVNVm1aRFJ4K1RqZ2l6ZTFUcnUv?= =?utf-8?B?ay92VHhLQnUzSWIzOTlsQWRkdmhhZ2hXUjgrRGZPMi9tckRPbmlRTkNBK3lw?= =?utf-8?Q?auQLkBH+OtxN48?= X-Forefront-PRVS: 03648EFF89 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6049001)(6009001)(39410400002)(39830400002)(39400400002)(39450400003)(24454002)(377454003)(50466002)(7736002)(42186005)(64126003)(305945005)(478600001)(2906002)(25786009)(54906002)(4326008)(31686004)(230700001)(6116002)(76176999)(3846002)(50986999)(23676002)(54356999)(5660300001)(65826007)(83506001)(7416002)(86362001)(229853002)(6486002)(31696002)(81166006)(77096006)(189998001)(4001350100001)(65956001)(8676002)(66066001)(65806001)(53936002)(7350300001)(38730400002)(53546010)(47776003)(36756003)(6246003)(2950100002)(33646002);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB2730;H:[172.16.25.12];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA4MDFNQjI3MzA7MjM6a2dUODZ1OEdjZFNNdUVZQXhTSzlHdUs1?= =?utf-8?B?R0U0QnNHcS91YlVpUnY4RDllNWhNVHdKQnlwZkVFSDBYVzVuTU5xY0RhcGhk?= =?utf-8?B?VEMvbG5aYmpoQzJYcVFadXdMMWxUTi9aT3VWa2VSM0tLbFQrZ3M2TkZsV1ZJ?= =?utf-8?B?STB1MmhWQ0EwbEFCTlFzeXF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N0U1UGJLam9r?= =?utf-8?B?T0wwNFY0eWtLMFBMMHlVdGoyK09qRk4vVEJNRk4vQXpFTmNsSDlmVzlqYWdn?= =?utf-8?B?aXpUN0I3SzBYSCtCNlhZdmh3NloxenlEVVNFdlAxeTdkcWMxU255MFU4bFRV?= =?utf-8?B?UTZnR3BsTElqOWFzSlJqOWhPU2tmUndaNjhZaVZTU04xNWd0SnN1R2dNV0pH?= =?utf-8?B?WW5Qb2Y1eng4OFlKZ25uNFlBOEdDUVZVT2FiQ01ScUhFSXZzYmx1SVNCMTl1?= =?utf-8?Q?vx97lHrW+CgcpEfEbGF8pWVCU1kEZWcoU=3D?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2730;5:T5HP2+hjF4RfKTkclfWwrR3d5ef42H+hUy37HoPgSGepAD6uunhZMmJk9acp+1H6DNY7Yke9Exd7CjmqdJxy041FOusoxNgUjnb1Dt8FCjyRHPxzCfMZspd38687BDGOR8yyFFvgOBHVxfx8lsYZezLddiE1nAT7zCuaykewS2oXZcz4CtuIihf7rj2hSabndjVK4y5OrLEu+a+fGaAKarONXEvFAxAQDdfCiMj/SEm+JMy+PUd2eVrAG23MScD72+CZp2jmpCl6SWckLrOMUkWsYVJ+Kka/nbTERx+/EfmNrMFWf2LLLpFVIqHQ62qO4uR236GP1/TgvcbzetfJ6FDLXbMv4A/K4PMFN8EJTwaMek1Pz3aU3iEbuciv5X3jz85bk74z3uVxL0YoWABoWgWcuvJr+l/govEUecUuAOchBWaRV2kPvTzk5DKUtEofEzDqV3BCV5cAnVCTUb33kcVrUqinmoIhlHoXAx434f9I/3AA0sZq5p/bEbCDa1jA;24:xo09+jW4EVvkoYaTyXTx4DLOBbtZAZuQ0DgHT0HNGcNJ4IU4m5c7AjrOQZ+lAP18wBMMfAFUjel2Dn2VZp1up81Iz2Z5KY30E0tANiDJe5Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801M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riginalArrivalTime: 10 Jul 2017 10:28:03.7510 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2730 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3434 Lines: 103 On 07/07/2017 01:01 AM, Greg Hackmann wrote: > clang's AddressSanitizer implementation adds redzones on either side of > alloca()ed buffers. These redzones are 32-byte aligned and at least 32 > bytes long. gcc now supports this too. So I think this patch should enable it. It's off by default so you'll have to add --param asan-instrument-allocas=1 into cflags to make it work > > __asan_alloca_poison() is passed the size and address of the allocated > buffer, *excluding* the redzones on either side. The left redzone will > always be to the immediate left of this buffer; but AddressSanitizer may > need to add padding between the end of the buffer and the right redzone. > If there are any 8-byte chunks inside this padding, we should poison > those too. > > __asan_allocas_unpoison() is just passed the top and bottom of the > dynamic stack area, so unpoisoning is simpler. > > Signed-off-by: Greg Hackmann > --- > lib/test_kasan.c | 22 ++++++++++++++++++++++ Tests would be better as a separate patch. > mm/kasan/kasan.c | 26 ++++++++++++++++++++++++++ > mm/kasan/kasan.h | 8 ++++++++ > mm/kasan/report.c | 3 +++ > 4 files changed, 59 insertions(+) > > diff --git a/lib/test_kasan.c b/lib/test_kasan.c > index a25c9763fce1..f774fcafb696 100644 > --- a/lib/test_kasan.c > +++ b/lib/test_kasan.c > @@ -473,6 +473,26 @@ static noinline void __init use_after_scope_test(void) > p[1023] = 1; > } > > +static noinline void __init kasan_alloca_oob_left(void) > +{ > + volatile int i = 10; > + char alloca_array[i]; > + char *p = alloca_array - 1; > + > + pr_info("out-of-bounds to left on alloca\n"); > + *(volatile char *)p; > +} > + > +static noinline void __init kasan_alloca_oob_right(void) > +{ > + volatile int i = 10; > + char alloca_array[i]; > + char *p = alloca_array + round_up(i, 8); Why round_up() ? > + > + pr_info("out-of-bounds to right on alloca\n"); > + *(volatile char *)p; > +} > + > static int __init kmalloc_tests_init(void) > { > /* > @@ -503,6 +523,8 @@ static int __init kmalloc_tests_init(void) > memcg_accounted_kmem_cache(); > kasan_stack_oob(); > kasan_global_oob(); > + kasan_alloca_oob_left(); > + kasan_alloca_oob_right(); > ksize_unpoisons_memory(); > copy_user_test(); > use_after_scope_test(); > diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c > index c81549d5c833..892b626f564b 100644 > --- a/mm/kasan/kasan.c > +++ b/mm/kasan/kasan.c > @@ -802,6 +802,32 @@ void __asan_unpoison_stack_memory(const void *addr, size_t size) > } > EXPORT_SYMBOL(__asan_unpoison_stack_memory); > > +/* Emitted by compiler to poison alloca()ed objects. */ > +void __asan_alloca_poison(unsigned long addr, size_t size) > +{ > + size_t rounded_up_size = round_up(size, KASAN_SHADOW_SCALE_SIZE); > + size_t padding_size = round_up(size, KASAN_ALLOCA_REDZONE_SIZE) - > + round_up(size, KASAN_SHADOW_SCALE_SIZE); > + > + const void *left_redzone = (const void *)(addr - > + KASAN_ALLOCA_REDZONE_SIZE); > + const void *right_redzone = (const void *)(addr + rounded_up_size); > + > + kasan_poison_shadow(left_redzone, KASAN_ALLOCA_REDZONE_SIZE, > + KASAN_ALLOCA_LEFT); > + kasan_poison_shadow(right_redzone, > + padding_size + KASAN_ALLOCA_REDZONE_SIZE, > + KASAN_ALLOCA_RIGHT); As Dmitry pointed out, the memory between [addr+size, addr+rounded_up_size) is left unpoisoned. kasan_alloca_oob_right() without round_up() would have caught this.