Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4183224imm; Fri, 18 May 2018 00:18:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoL3pNSeMF5hHtQQBtUmibUV0zWh1RFegHejBXkFQs51eL+sNjocLLBqCjsEZSJecrspYrP X-Received: by 2002:a62:a044:: with SMTP id r65-v6mr8045198pfe.235.1526627926933; Fri, 18 May 2018 00:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526627926; cv=none; d=google.com; s=arc-20160816; b=f4qnBpA787/NeIO3t6EKfqD/js/46XlLkZJW2JnIf7yglwhPBtLeDN8uneFdjsxKI4 Q3ISQ/H4rWxEgruzcqmiDg5DYBWg1qaI8PYZvlIEGV1kURCaw9zktsGVbKxReIngb1Ye JXGT9A7QXE1ivKuIej6JcBfgPSkHpPAmaBgf0PMANUdB5YJ2oWkFe872htz4KouwWNXt hN9/RELujNN3jpdoe0duRme26m0ooSjoJgcJ8RCexRwaCIbp/A7x9LlFH3rGOwrqFCfT nG//nU0j5tnhUzpsInlAfBgWds3+FwHd2m/J/J8uZ2KjG9DVTSQcyr08pO5L0l841yFv 9cgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=GihKjsEWJ2fmTJqto3YfVewaEfhfrPFGhLugmLU3CNk=; b=ATsnqNrGLrL1ALrSG0Aovkjl+g0pFW7xsMQKXbZAypNhMlfQP8GYPLK3UMM+5H9Jdp MBkI0M9E8i8R3qtISGbPjbavy6f6nC3WvSM1xmO9OuB7WLfdVDNZpiKRUvjxwElPcKvL StYViv9DYeHIIUqPa6kA1vTAyYdK6lAJEFX+XFKL+1nhVWTwkKPR90H0EumB8VpWw1sF rBh01TZVRbjmUKPMQCz4kXavO/hXG6hGlCOt7+WcPh+fzFb818xA4yQirph4AWK6HTB3 ITnOZ/iveDwdXCv9/2+5BC5wRKidpnh8edQ7Pxq8A35WV/niw34KpHEtoCerCEXti+gL BkSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=L3d20PpS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6-v6si6851250pfh.17.2018.05.18.00.18.32; Fri, 18 May 2018 00:18:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=L3d20PpS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751754AbeERHST (ORCPT + 99 others); Fri, 18 May 2018 03:18:19 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35794 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbeERHSS (ORCPT ); Fri, 18 May 2018 03:18:18 -0400 Received: by mail-wr0-f196.google.com with SMTP id i14-v6so8060972wre.2 for ; Fri, 18 May 2018 00:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GihKjsEWJ2fmTJqto3YfVewaEfhfrPFGhLugmLU3CNk=; b=L3d20PpSou7LvjGB0joU5okK/CLTBChClSQnMcLEI8OtKhXZWN+VmMDQ8E2U0dtZhF cn+qHULTNYAfC522MEZqJSN5jFBibCkqyJu/YFc24tM/bV5bYKKrllfso2NbGfem9aFo IqrePp4N/96KpkFTK/Ga64uSQCZElCIbKatWluQu3rMvQRZGo1yd0t3a4ryPtXxZaFjI s2hNuwvq5cm868ZovYKfyo9i8MyTbEGOZl7+cVmhQfnMKyOi5koz+LLZTpSmmqm8D07Y X6cs6HklXda7EnKrM2QiMdxJUgZuiW09Eu0JdrOUj7u22yz2ee2wNGGio0V2o1x8Qtuu ZcSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=GihKjsEWJ2fmTJqto3YfVewaEfhfrPFGhLugmLU3CNk=; b=MCuqNBifYAR2um0i91pzxTX5gnzxq7tZHHEUTCFBEos8AsXV0k8CuElB81H21Rftjf GrxRT4Goj1qucRH3xYKKbApxZ94HZ0hL7sF0oZ/jAsAONgBw/RhaHZOxghoWN8uC+2cu 0Kb+dcdKhBrjAR/roD/EK/kN5qOdVn8DyeDx6QkPKgqyqhIDDjcwQy3DQ5JvWFeVCZA6 9MNa6Gbk/FmQ2IT3pJKGqRTRq5/ErNaKizmVMiMlX6Z9xOTT2C1bnT8r3GjL2tuEbVpo 0VUeSjZ5iBsWD4uAwEaCbZRkwV/tA3VEZPfvAOmjlOx+d//eR2ij20pGEkK0lJ6F3qA7 66xQ== X-Gm-Message-State: ALKqPwddyz8GkxoSYFhXoCBDdleSIVvxn5BKi5eUKVZQQ5Qr4J3Ml6Vi r6eyB02EeQq5GgxBVrMpGOo= X-Received: by 2002:adf:e1c3:: with SMTP id l3-v6mr4257123wri.111.1526627897246; Fri, 18 May 2018 00:18:17 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id g75-v6sm9514405wmd.15.2018.05.18.00.18.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 00:18:16 -0700 (PDT) Date: Fri, 18 May 2018 09:18:14 +0200 From: Ingo Molnar To: Josh Poimboeuf Cc: Linus Torvalds , Alexey Dobriyan , Peter Anvin , kernel test robot , Thomas Gleixner , Andrew Lutomirski , Borislav Petkov , Brian Gerst , Denys Vlasenko , Peter Zijlstra , Linux Kernel Mailing List , Peter Anvin , tipbuild@zytor.com, LKP Subject: Re: [PATCH] objtool: Detect assembly code falling through to INT3 padding Message-ID: <20180518071814.GB26358@gmail.com> References: <20180515210757.GA12225@avx2> <20180515214337.GA18021@avx2> <20180515222211.ods5hzne46hozojq@treble> <20180515224354.zmygmsnlqj5lrdbo@treble> <20180516033044.odb74pdgcn5nacwb@treble> <20180517134934.eog2fgoby5azq5a7@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180517134934.eog2fgoby5azq5a7@treble> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Josh Poimboeuf wrote: > With the following commit: > > 51bad67ffbce ("x86/asm: Pad assembly functions with INT3 instructions") > > ... asm function alignments are padded with INT3, so it's no longer safe > to fall through to an aligned function. Make sure we catch any such > cases with objtool. > > Note this only adds checking for 64-bit, since objtool doesn't support > x86-32. > > Suggested-by: Thomas Gleixner > Suggested-by: Linus Torvalds > Signed-off-by: Josh Poimboeuf > --- > arch/x86/kernel/head_64.S | 2 -- > tools/objtool/arch.h | 3 ++- > tools/objtool/arch/x86/decode.c | 2 +- > tools/objtool/check.c | 11 ++++++++++- > 4 files changed, 13 insertions(+), 5 deletions(-) Ok, this is cool, it addresses the robustness problem that INT3 padding introduced very nicely. The concept of built-in kernel tooling working at the machine code level is just so powerful - we should have added our own KCC compiler 20 years ago. Thanks, Ingo