Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753175AbaA2Q5m (ORCPT ); Wed, 29 Jan 2014 11:57:42 -0500 Received: from mail-oa0-f46.google.com ([209.85.219.46]:37852 "EHLO mail-oa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753046AbaA2Q5l (ORCPT ); Wed, 29 Jan 2014 11:57:41 -0500 MIME-Version: 1.0 In-Reply-To: <1390996897.20153.123.camel@i7.infradead.org> References: <1380833605-26313-1-git-send-email-keescook@chromium.org> <1380833605-26313-2-git-send-email-keescook@chromium.org> <1390996897.20153.123.camel@i7.infradead.org> Date: Wed, 29 Jan 2014 08:57:40 -0800 X-Google-Sender-Auth: CBgUB61-zMdd3maahAKBanwi4zc Message-ID: Subject: Re: [PATCH] x86, boot: fix word-size assumptions in has_eflag() inline asm From: Kees Cook To: David Woodhouse Cc: LKML , "x86@kernel.org" , "kernel-hardening@lists.openwall.com" , Aaron Durbin , Eric Northup , Julien Tinnes , Will Drewry , Mathias Krause , Zhang Yanfei , "H. Peter Anvin" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 29, 2014 at 4:01 AM, David Woodhouse wrote: > Commit dd78b97367bd575918204cc89107c1479d3fc1a7 ("x86, boot: Move CPU > flags out of cpucheck") introduced ambiguous inline asm in the > has_eflag() function. We want the instruction to be 'pushfl', but we > just say 'pushf' and hope the compiler does what we wanted. > > When building with 'clang -m16', it won't, because clang doesn't use > the horrid '.code16gcc' hack that even 'gcc -m16' uses internally. > > Say what we mean and don't make the compiler make assumptions. > > Signed-off-by: David Woodhouse Yes, excellent point. Thanks! Acked-by: Kees Cook -Kees -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/