From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E004FC433EF for ; Thu, 16 Dec 2021 10:13:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 405AA6B0071; Thu, 16 Dec 2021 05:13:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 398C16B0073; Thu, 16 Dec 2021 05:13:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2550C6B0074; Thu, 16 Dec 2021 05:13:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 11C5B6B0071 for ; Thu, 16 Dec 2021 05:13:40 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C250C8249980 for ; Thu, 16 Dec 2021 10:13:29 +0000 (UTC) X-FDA: 78923245338.10.1A4B23B Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by imf07.hostedemail.com (Postfix) with ESMTP id 6307F4001E for ; Thu, 16 Dec 2021 10:13:29 +0000 (UTC) Received: by mail-qt1-f173.google.com with SMTP id f20so24916064qtb.4 for ; Thu, 16 Dec 2021 02:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YRNyvvMx0D6cmoATqQzVllabSh/sAVBFjHpHuEs3K98=; b=QP5fMqjj2HERTi9+wi+qJlnEfdulm9t0JMh0e3fxdFg1Eptn92K/EJRkxC+dymhP1k rDgAGl9zjJiJy9Z2CLiM1aizonlBf8p4dYx8YPJOsMLDa2CtFG0KgjcUo/D/MpmW/Lfu E+y0YzFu6MrvdOrCWw1M+DOOVTvuWp2IKjjkf/hmk4SVjZuBczcjSDavSFfIJtyfp35V Gk4GCY/9fc4684sjRRdi1uVL3BVTL7yPcVOqrC5Fz/rzT/vBsyErQfuaCdNAfmtKskb9 WF1IZa6maksSZ1RTQ16ie08YUAXwm3MzxFerPjTDYyrDPC/lZsZGY7ZL//NangtkxY0A raMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YRNyvvMx0D6cmoATqQzVllabSh/sAVBFjHpHuEs3K98=; b=QD+kBor0AzrWAlJzXjfs2B0/+HBLxDbsIsd5L4fGXDoa82BISRJyYLYhQxQJs6UrtK 1aCEmiEYped5b218fXXZ8Y5vy5NWUmlkbaGDclU2xHGY5jIPrPpzissgJvJuCOnmCeUP Q4IIgiUuWfzQ+WoGPPRain8x53KdUPGnuza+3kuhlgQPYbufYgygJareJxC21uob+zYG e6sjbLQZWruRYwckKRs5mKINy74Q1bc9IVaTrKRmR2dFWK20pIYB6so91ikjuvLgs/7n 5jA4ZTUuUrtXgbsM5tggNCwv3gRrjRw8I3kH9e6VcLgiSGDpmPin/vSY5SbllDF9Gy4C pRmQ== X-Gm-Message-State: AOAM531BXc2CqLjsEPmNM94qX0Mk8BNK/+44/zEx+ETgH7Xbe3Kgi+oA jQysVkSIpNAzxzA+F6b60ZH42r7zbEjqEJII+7KvCg== X-Google-Smtp-Source: ABdhPJxFhNQBI4hw6cIRpJ3Bn2gy/Dy3Dn3EXkPsiZJ6PPFBQxKOA/co/dhObm1iQVeZPt6w2zfFhE/oIx5W4j8ixtU= X-Received: by 2002:ac8:4e56:: with SMTP id e22mr16491312qtw.72.1639649608437; Thu, 16 Dec 2021 02:13:28 -0800 (PST) MIME-Version: 1.0 References: <20211214162050.660953-1-glider@google.com> In-Reply-To: From: Alexander Potapenko Date: Thu, 16 Dec 2021 11:12:52 +0100 Message-ID: Subject: Re: [PATCH 00/43] Add KernelMemorySanitizer infrastructure To: Greg Kroah-Hartman Cc: Alexander Viro , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=QP5fMqjj; spf=pass (imf07.hostedemail.com: domain of glider@google.com designates 209.85.160.173 as permitted sender) smtp.mailfrom=glider@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Queue-Id: 6307F4001E X-Stat-Signature: mm85h6htozqt3j67uxo6xe7i9bffim3i X-Rspamd-Server: rspam04 X-HE-Tag: 1639649609-52174 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Dec 14, 2021 at 5:36 PM Greg Kroah-Hartman wrote: > > On Tue, Dec 14, 2021 at 05:20:07PM +0100, Alexander Potapenko wrote: > > KernelMemorySanitizer (KMSAN) is a detector of errors related to uses o= f > > uninitialized memory. It relies on compile-time Clang instrumentation > > (similar to MSan in the userspace [1]) and tracks the state of every bi= t > > of kernel memory, being able to report an error if uninitialized value = is > > used in a condition, dereferenced, or escapes to userspace, USB or DMA. > > Why is USB unique here? syzkaller just happens to be good at fuzzing USB drivers, so it was fairly easy to implement and test USB support for KMSAN. This should give the maintainers of other buses an idea of how this could be done :) What about serial data? i2c? spi? w1? We > have a lot of different I/O bus types :) We hope to cover those after KMSAN hits upstream. > > And how is DMA checked given that the kernel shouldn't be seeing dma > memory? Before writing a buffer to DMA, that buffer's contents are checked by KMSAN. If there are uninitialized bytes, those will be reported. After reading a buffer from DMA, it is marked as initialized to avoid false positives. We do not track DMA memory itself. > thanks, > > greg k-h --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg