|
Message-ID: <20170509064522.anusoikaalvlux3w@gmail.com> Date: Tue, 9 May 2017 08:45:22 +0200 From: Ingo Molnar <mingo@...nel.org> To: Greg KH <greg@...ah.com> Cc: Thomas Garnier <thgarnie@...gle.com>, Martin Schwidefsky <schwidefsky@...ibm.com>, Heiko Carstens <heiko.carstens@...ibm.com>, Dave Hansen <dave.hansen@...el.com>, Arnd Bergmann <arnd@...db.de>, Thomas Gleixner <tglx@...utronix.de>, David Howells <dhowells@...hat.com>, René Nyffenegger <mail@...enyffenegger.ch>, Andrew Morton <akpm@...ux-foundation.org>, "Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>, "Eric W . Biederman" <ebiederm@...ssion.com>, Oleg Nesterov <oleg@...hat.com>, Pavel Tikhomirov <ptikhomirov@...tuozzo.com>, Ingo Molnar <mingo@...hat.com>, "H . Peter Anvin" <hpa@...or.com>, Andy Lutomirski <luto@...nel.org>, Paolo Bonzini <pbonzini@...hat.com>, Rik van Riel <riel@...hat.com>, Kees Cook <keescook@...omium.org>, Josh Poimboeuf <jpoimboe@...hat.com>, Borislav Petkov <bp@...en8.de>, Brian Gerst <brgerst@...il.com>, "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>, Christian Borntraeger <borntraeger@...ibm.com>, Russell King <linux@...linux.org.uk>, Will Deacon <will.deacon@....com>, Catalin Marinas <catalin.marinas@....com>, Mark Rutland <mark.rutland@....com>, James Morse <james.morse@....com>, linux-s390 <linux-s390@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>, Linux API <linux-api@...r.kernel.org>, the arch/x86 maintainers <x86@...nel.org>, linux-arm-kernel@...ts.infradead.org, Kernel Hardening <kernel-hardening@...ts.openwall.com>, Linus Torvalds <torvalds@...ux-foundation.org>, Peter Zijlstra <a.p.zijlstra@...llo.nl> Subject: Re: Re: [PATCH v9 1/4] syscalls: Verify address limit before returning to user-mode * Greg KH <greg@...ah.com> wrote: > What about a simple coccinelle script to test for this type of thing? > We write it once, add it to the in-kernel body of tests, and then 0-day > runs it on all trees all the time. That should catch this type of > issue, like all of the other "bad programming bus" that the tool > currently catches. Yeah, that would work - but today most of our coccinelle scripts are still pretty verbose, and I think it's important to make this a different category of coccinelle script, which is .config driven where a loud warning yells at us. I.e. force the 'zero warnings tolerated' model. I also noticed that Coccinelle builds are pretty slow, so it would still make sense to have a performance oriented static checking facility that does not have the performance baggage of high level functional languages. I.e. either integrate it into Sparse - or start a kernel integrated static analysis tooling project that would only follow control flow initially - which is what we need here I believe. We only have ~115 code blocks in the kernel that set/restore KERNEL_DS, it would be a pity to add a runtime check to every system call ... We could also add a runtime check to oops handling to make sure we don't leak KERNEL_DS through kernel crashes, to ease worries about CVE-2010-4258. Thanks, Ingo
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.