Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752666AbbGOQWm (ORCPT ); Wed, 15 Jul 2015 12:22:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51074 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752340AbbGOQWl (ORCPT ); Wed, 15 Jul 2015 12:22:41 -0400 Date: Wed, 15 Jul 2015 11:05:28 -0500 From: Josh Poimboeuf To: Ingo Molnar Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Michal Marek , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Andi Kleen , Pedro Alves , x86@kernel.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 0/4] Compile-time stack validation Message-ID: <20150715160528.GA6184@treble.redhat.com> References: <20150714172553.GD4562@treble.redhat.com> <20150715101627.GA21770@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150715101627.GA21770@gmail.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2368 Lines: 61 On Wed, Jul 15, 2015 at 12:16:28PM +0200, Ingo Molnar wrote: > > * Josh Poimboeuf wrote: > > > On Tue, Jul 14, 2015 at 12:14:06PM -0500, Josh Poimboeuf wrote: > > > Posting a listing of reported warnings in a reply to this email. > > > > These are the reported stackvalidate warnings on tip/master with my Fedora-based > > config. There were 1399 warnings in 26 .c files and 16 .S files. It was mostly > > repeat warnings so I removed a lot of the repeats to keep it short. > > Are most of these warnings legit, what's the false positive rate in your > impression? Examining the warnings per-file (since that's a much easier analysis than per-warning): Of the 26 .c files: - 21 have real frame pointer bugs, most of them caused by a handful of inline asm() macros - 5 have false positives (but several of these have questionable usage of asm() which might be convertible to C code) Of the 16 .S files: - 12 have real frame pointer bugs*, typically caused by not having FRAME/ENDFRAME (note: many of these files also have false positive warnings) - 4 have no bugs and only false positives Most of the false positives in the .S files are actually incorrect ELF annotations. I still consider them false positives because they're not "real" bugs, per se. But they're still fixable. Overall I think there will end up being only be a handful of locations that need to use one of the whitelist macros (STACKVALIDATE_IGNORE_{INSN,FILE}). > You might want to start fixing a few typical types, just to see what it involves > exactly and whether we want to fix it that way. I already have a good idea of what needs to be done for most of the warnings. I'll post some patches and try to give a representive sampling of what the different types of fixes look like. [*] But note that the definition of a frame pointer bug is open to interpretation, especially for "special" asm code like suspend, hibernate, relocate, reboot, ftrace, bpf, entry code, etc. In general, when looking at whether frame pointers are needed, I asked myself "what would gcc do?" -- Josh -- 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/