Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758450AbeAHX4c (ORCPT + 1 other); Mon, 8 Jan 2018 18:56:32 -0500 Received: from mail-it0-f51.google.com ([209.85.214.51]:36147 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758252AbeAHX4b (ORCPT ); Mon, 8 Jan 2018 18:56:31 -0500 X-Google-Smtp-Source: ACJfBouFW5ygJ+58FS5V1dF+6ZaA4oCTQwun4eB7Jy+07aTHfrlrviqEfTmgB+0cxhc2kYyY+WH5oc9TYXKvVx5IUqU= MIME-Version: 1.0 In-Reply-To: <1515455051.15588.7.camel@infradead.org> References: <1515363085-4219-1-git-send-email-dwmw@amazon.co.uk> <1515455051.15588.7.camel@infradead.org> From: Linus Torvalds Date: Mon, 8 Jan 2018 15:56:30 -0800 X-Google-Sender-Auth: upO4PGDmR7IOmdEQsEh2Rll7pH0 Message-ID: Subject: Re: [PATCH v6 11/10] x86/retpoline: Avoid return buffer underflows on context switch To: David Woodhouse Cc: David Woodhouse , Andi Kleen , Paul Turner , LKML , Greg Kroah-Hartman , Tim Chen , Dave Hansen , Thomas Gleixner , Kees Cook , Rik van Riel , Peter Zijlstra , Andy Lutomirski , Jiri Kosina , One Thousand Gnomes Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, Jan 8, 2018 at 3:44 PM, David Woodhouse wrote: > > To guard against this fill the return buffer with controlled > content during context switch. This prevents any underflows. Ugh. I really dislike this patch. Everything else in the retpoline patches makes me go "ok, that's reasonable". This one makes me go "Eww". It's hacky, it's ugly, and it looks pretty expensive too. Is there really nothing more clever we can do? Linus