Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752616AbdLEQdI (ORCPT ); Tue, 5 Dec 2017 11:33:08 -0500 Received: from mail-db5eur01on0121.outbound.protection.outlook.com ([104.47.2.121]:55104 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751550AbdLEQdG (ORCPT ); Tue, 5 Dec 2017 11:33:06 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Subject: Re: [PATCH v4 3/5] kasan: support alloca() poisoning To: Paul Lawrence , Alexander Potapenko , Dmitry Vyukov , Masahiro Yamada Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kbuild@vger.kernel.org, Matthias Kaehlcke , Michael Davidson , Greg Hackmann References: <20171204191735.132544-1-paullawrence@google.com> <20171204191735.132544-4-paullawrence@google.com> From: Andrey Ryabinin Message-ID: <92997308-7c91-7d37-f699-1a9ea9be14ed@virtuozzo.com> Date: Tue, 5 Dec 2017 19:36:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171204191735.132544-4-paullawrence@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: HE1PR08CA0059.eurprd08.prod.outlook.com (2603:10a6:7:2a::30) To AM4PR08MB2818.eurprd08.prod.outlook.com (2603:10a6:205:d::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3752328-14bf-4a65-ca56-08d53bfddadc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603286);SRVR:AM4PR08MB2818; X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB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/DuVlTddJLdKIPfUrCM1jUCJTFhM7mM7LEq6Dt5JQbD+/+CfrZnG9dS/Ko63RC589P9GXKU5VJ0+FhS8Co/o3f8x05nmJ+2CBk6WV4cbWwodtV6hfPzxJ9a1ScEqe8xaDELbJ4qOnjAjGvHUErT6e5l9FaAcfLr9ULlN4TRyc4BEFVIUq0dCd0NZ9n6WWJPmgr9xd2kExcTN9TPWohcxAS7aLUywjJH59skIGBsk/0Uo1DGdQB4iTyQ+QpG0zh7yXWLoJhwxMh9Q=;4:lUUbcQwgaNWgToV3anF9AQGMMYI4tvp5RjYIlmSf+r/LSHAaqkXspE4xs5EJ5ud6ruBf2Z0An+DV0ScjXHn9rUqzEBfN1Ut0W1agV2OIvcrYUu4Vx6fqIMpmWtR/E2meeUZUXxqSAjBgacnfDvA10ygSeZqx/R9POfxcTH2qd4yX1IxCpSiNzRYJew/IPpOmhASu2du4MJ4pv9iRZBtjA15i+3nz1jzMmULyEj++Ua0iR+dyIiBrBuxlONLEYF4H+RSo4yrTDAONMntVvydWPqobJm9YE9PJwmf3eRcJeigx2jsl7zAkUblMoXjPjG2OVcib0+R35dhx/Sz+1YDVYCwdpH/AfkkLMmW0zTwIYMOe392TBbCmijSr5TDFtcf8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211936372134217)(153496737603132)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(3231022)(920507027)(3002001)(93006095)(93001095)(6041248)(20161123564025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(6072148)(201708071742011);SRVR:AM4PR08MB2818;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:AM4PR08MB2818; X-Forefront-PRVS: 0512CC5201 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(376002)(346002)(366004)(24454002)(33646002)(6246003)(53546010)(66066001)(34040400001)(8676002)(229853002)(8936002)(50466002)(31696002)(53936002)(305945005)(2906002)(478600001)(316002)(7736002)(76176011)(81166006)(110136005)(54906003)(83506002)(36756003)(2950100002)(16576012)(25786009)(81156014)(31686004)(52116002)(101416001)(47776003)(6666003)(65956001)(58126008)(6486002)(77096006)(97736004)(64126003)(3846002)(6116002)(16526018)(230700001)(65806001)(7416002)(105586002)(68736007)(65826007)(86362001)(55236003)(4326008)(52146003)(23676004)(2486003)(106356001)(5660300001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR08MB2818;H:[172.16.25.12];FPR:;SPF:None;PTR:InfoNoRecords;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA4TUIyODE4OzIzOmt6eWxtRmU0TE1tSEFJY1RpaGtMQUFRUU5n?= =?utf-8?B?L09mc0x6SlNWc2lFTnVRTklad2JXVWdkSFdZZUVxNDB5WVBRdXY2V2RDU3Zn?= =?utf-8?B?bm51RDZmaWxmR3B2UHFTR3lWcEN6UFgrRFBPNlkyV1ljaXdTZzJhWE44T2xU?= =?utf-8?B?SGhQT2YxZi9OMnV6K0YrN3hFWm5SeTBQbituZ1ByZWNtdmlWZHdNV2RYS21s?= =?utf-8?B?eXBLZzNNRG9xdmVibUdXUFpkUEkrWkxLaWtTd2xUTXVUU0pmRm5MSEkzV0FW?= =?utf-8?B?L09oM1dYVDIrTWhaRkV4QXJVTHYwQXlvS05xTy96bVl6cmZxM29wWVNaRW1w?= =?utf-8?B?eis2K3B6YUpVUUR6bGl5M0tacGRteUJhdVNtY2JaWUNZQmNCTDEwREhvS0dv?= =?utf-8?B?NnZsNjJwWjFFaGlZUFpDaXd5U01RUjF3U2kzalZFMW94SEV4WGFaNjFEc1Ry?= =?utf-8?B?Yks5VXVOTlhzVmxWeEpCYTV3elBYRUhwazdWU1ZRN3I0QlJUQ1llbkJtNGZv?= =?utf-8?B?SjZRV28wRGxBNy9YUEtmZ0VrY1FTaC9pd01NOUJ6Vi83MU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DVCqEfJykv6PQWM6RKCTBrdLQqxzFnjyjfhl7dH6IZvuOo5XesBxWMejQogpkqLjwzfGs=;7:GKblRCfeYIr49MVTxs+yfTcZCF0QgI9ZnnPrLB7D+LuXsMj9kD2EwW8iOcfiasTf9YSDN+aCX/lcY4pIq93b4fmuQ0EgyxWBo8yNom8f2vOcbVRG8aHk+RBgRtRQPbZZWSUMcLR5/MPmbJv34/FTGy6GxrGFVTSPr/1E7cSO/9jbBo19QJYyEuer/kc3gHftT90felEGQE7e9msovEAUtPcutFSl4tzkUkbV1vLOJkMuy99mJo3p0yVHUBTVBcfB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB2818;20:RINwUtSofbKPnt9mmd4qtx9N2H1o1/beswLC0bBTd7u+yRk49+5jB/kEKk/JQuo86vo9hsAiJfMKnfNU4PgIq/SsCKWFSDlyWonA55DjiNsH1fanqvJktwIYDAqGzO+Io1Uu6c+W8LOiingB0hhX7fFS8ZHHmuA6amgnJX1ML5Q= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2017 16:33:01.9491 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3752328-14bf-4a65-ca56-08d53bfddadc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2818 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 885 Lines: 20 On 12/04/2017 10:17 PM, Paul Lawrence 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. > > __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 > Signed-off-by: Paul Lawrence > --- Acked-by: Andrey Ryabinin