From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751854AbcFUJaT (ORCPT ); Tue, 21 Jun 2016 05:30:19 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:54480 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751491AbcFUJaM convert rfc822-to-8bit (ORCPT ); Tue, 21 Jun 2016 05:30:12 -0400 From: Arnd Bergmann To: Andy Lutomirski Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Borislav Petkov , Nadav Amit , Kees Cook , Brian Gerst , "kernel-hardening@lists.openwall.com" , Linus Torvalds , Josh Poimboeuf , Jann Horn , Heiko Carstens Subject: Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Date: Tue, 21 Jun 2016 11:24:18 +0200 Message-ID: <13212319.WrhLzgRA6Z@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-22-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" X-Provags-ID: V03:K0:eYXla6h++UiDPirxainOYcFq5f+Fftvj5AhZ4aILfTWWJ5rvHgo utMFVsz31epWkeqNtsggpsiwA0HkyNV+u31nVVbKXkzn8uzAjno59QKMHfZZPBN3h6Xs9CH tKmCDvrn+CzeY1OSOKHpPFCCzwai8FZ2JuHAyfqqp1I6OrfOy3qXA5IYUJAdAjBUi7bBQWu 0FA/nUxLULccA2nuMf6LQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:5d+lj6UDIAU=:0xOgmRr4ur0QUoFVtsVuWS eM2xU6KLQS9Z/uKQDomFjQ6glCdnLaHogLfB+w6QCXSB6FeTU97xbsBDcrSXP0tww7EctKgUv szjSHKKym7eXNb1quNqWBh/3qDAzE14AJCuFH6l+FZXLzv08jCRIb12bABjkeygqsvXSw+/py vH0QX5xmPr1G28xPOelYaNzybBL3dP1TXHP7hYdgQPKZcWUwRNPZA2QOPiAn+et7y7iXiAV+9 R5PDXe9vE8aFeP0cBB/3/MiAIo8C94fQrBwRHO3jNQsT9WQpeFN4c0uplFIt//mIg9Lb4Uv0G GLnyvbNClH7bUOskUVElBBTlqmFDyArS4Red5w0eRCOEeTVkPG5IB6sPNSESAQ7g8Ly0pKBwW PdT9bOmNuMesxhE8hDdnt2wE9OcJ+BU9B/kVCpZKiQBsvjBqG9nAifm273hq+VKJgoMZO+3rN SxS+PpIB1ibBWOaQe7P4G3Ma1oN1FurwMxzA47XnU1s7yLbHKMXsMPsZ5lSng1OmtdI9reQIR EXOZaFj25LXW/cwrKzU8XO3jpZbQ7ghh8B8NTlT+Rl22i/t5Lt2Kc3/ymq0m1dLvrczH3nAtL 0o6yf6c1dEHyODwAJ/IsKLk83rOT4ofDyrQ79+nIgAbN0rwrCC2OZXTZVGSoM5zdFk7tSiGjM xmqD1Az2uG46PouJFmALSgxK7JxIA7ADNfpoNgQ74AppDVqNhccf2HKeMVE6JUBRDVcKmECgf Cp1SU2gt4HDbpixB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, June 20, 2016 4:43:30 PM CEST Andy Lutomirski wrote: > > On my laptop, this adds about 1.5µs of overhead to task creation, > which seems to be mainly caused by vmalloc inefficiently allocating > individual pages even when a higher-order page is available on the > freelist. Would it help to have a fixed virtual address for the stack instead and map the current stack to that during a task switch, similar to how we handle fixmap pages? That would of course trade the allocation overhead for a task switch overhead, which may be better or worse. It would also give "current" a constant address, which may give a small performance advantage but may also introduce a new attack vector unless we randomize it again. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Date: Tue, 21 Jun 2016 11:24:18 +0200 Message-ID: <13212319.WrhLzgRA6Z@wuerfel> References: Reply-To: kernel-hardening@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: To: Andy Lutomirski Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Borislav Petkov , Nadav Amit , Kees Cook , Brian Gerst , "kernel-hardening@lists.openwall.com" , Linus Torvalds , Josh Poimboeuf , Jann Horn , Heiko Carstens List-Id: linux-arch.vger.kernel.org On Monday, June 20, 2016 4:43:30 PM CEST Andy Lutomirski wrote: >=20 > On my laptop, this adds about 1.5=B5s of overhead to task creation, > which seems to be mainly caused by vmalloc inefficiently allocating > individual pages even when a higher-order page is available on the > freelist. Would it help to have a fixed virtual address for the stack instead and map the current stack to that during a task switch, similar to how we handle fixmap pages? That would of course trade the allocation overhead for a task switch overhead, which may be better or worse. It would also give "current" a constant address, which may give a small performance advantage but may also introduce a new attack vector unless we randomize it again. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com From: Arnd Bergmann Date: Tue, 21 Jun 2016 11:24:18 +0200 Message-ID: <13212319.WrhLzgRA6Z@wuerfel> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: [kernel-hardening] Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) To: Andy Lutomirski Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Borislav Petkov , Nadav Amit , Kees Cook , Brian Gerst , "kernel-hardening@lists.openwall.com" , Linus Torvalds , Josh Poimboeuf , Jann Horn , Heiko Carstens List-ID: On Monday, June 20, 2016 4:43:30 PM CEST Andy Lutomirski wrote: >=20 > On my laptop, this adds about 1.5=B5s of overhead to task creation, > which seems to be mainly caused by vmalloc inefficiently allocating > individual pages even when a higher-order page is available on the > freelist. Would it help to have a fixed virtual address for the stack instead and map the current stack to that during a task switch, similar to how we handle fixmap pages? That would of course trade the allocation overhead for a task switch overhead, which may be better or worse. It would also give "current" a constant address, which may give a small performance advantage but may also introduce a new attack vector unless we randomize it again. Arnd