From patchwork Thu Feb 27 19:35:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11409555 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0553514E3 for ; Thu, 27 Feb 2020 19:35:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C5B4C2468E for ; Thu, 27 Feb 2020 19:35:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="GqYMFX/u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5B4C2468E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C9F206B0008; Thu, 27 Feb 2020 14:35:26 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C4FDE6B000A; Thu, 27 Feb 2020 14:35:26 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B68A86B000C; Thu, 27 Feb 2020 14:35:26 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0254.hostedemail.com [216.40.44.254]) by kanga.kvack.org (Postfix) with ESMTP id A0B296B0008 for ; Thu, 27 Feb 2020 14:35:26 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8B7E88245578 for ; Thu, 27 Feb 2020 19:35:26 +0000 (UTC) X-FDA: 76536911052.16.point97_12590d44db63d X-Spam-Summary: 2,0,0,5c24eb598cffb2d1,d41d8cd98f00b204,keescook@chromium.org,,RULES_HIT:41:69:355:379:541:800:967:973:982:988:989:1260:1311:1314:1345:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2525:2559:2566:2570:2682:2685:2703:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3352:3622:3865:3868:3870:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6261:8531:9025:9040:10004:11658:13069,0,RBL:209.85.216.67:@chromium.org:.lbl8.mailshell.net-62.2.0.100 66.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: point97_12590d44db63d X-Filterd-Recvd-Size: 4481 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Thu, 27 Feb 2020 19:35:25 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id a18so211340pjs.5 for ; Thu, 27 Feb 2020 11:35:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AoE4OLd/IvDA6cmd9pXDgHl19RWwO6y4VAoz5pE6b4E=; b=GqYMFX/utzgItiW5PidQ11FE+lHI8vpi1sL09gpDitITyGvoCdgVofeyaea3HY9ipQ kI+V9aywVW0+oZ0T24u4PDmPMEExxMztSr66kCLpV0ML6Fdn0mDsyT0Mh3zdLeUDarW0 cp8p5I5qVxBR8ULIBUY4ZLMoXbzGtmBCuNhWY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AoE4OLd/IvDA6cmd9pXDgHl19RWwO6y4VAoz5pE6b4E=; b=mLQ91vuHPmu+rYqhHL8ZcJM0/qsUApZmdSEAzMW7krOXi10zwX+mcP/VoM5ngp5Vc0 qcw2ZtcggSfN86Zcma93/oHgZ83ezZZn0B6kMYMdNv/w8fMfcV9FjYQrCeNpb0E2Drua +7394c0VZG3KBW+MtmsR2vUkmZCA2udmlvCa926VK6isKP45CNkIhfLl3R2zmpv+TG8q VULZ9N9ojk8hWZS7pwciGxLml1IGiKru0z3iX9DN9pz1LE5he5KJdJGNyBqVGVsjo2nx 5CAgpSiK+FIaL2N+CJBXiWhYrV8LPsso97mzSq9AvFFfZ3uXCCXn7wzC0VoER9fls9Ma VETQ== X-Gm-Message-State: APjAAAVgTwiJXb8iQieO9ks3uFx6VrMbPnDjNQta/jkRZbopAt+70Edt pMAzver2yBkAnRGNHpKe02cW5g== X-Google-Smtp-Source: APXvYqyHH1OhEaAU0M9XGqSIh9GqdH9ygv+RYA1KOJ+P5VFzMpUGg9ipEsHxlmsPcfBpV6cJtwqGHg== X-Received: by 2002:a17:90b:8ce:: with SMTP id ds14mr584791pjb.70.1582832124805; Thu, 27 Feb 2020 11:35:24 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e17sm8348002pfm.12.2020.02.27.11.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 11:35:20 -0800 (PST) From: Kees Cook To: Andrew Morton Cc: Kees Cook , Andrey Ryabinin , Elena Petrova , Andrey Konovalov , Alexander Potapenko , Dan Carpenter , "Gustavo A. R. Silva" , Arnd Bergmann , Ard Biesheuvel , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, syzkaller@googlegroups.com Subject: [PATCH v5 0/6] ubsan: Split out bounds checker Date: Thu, 27 Feb 2020 11:35:10 -0800 Message-Id: <20200227193516.32566-1-keescook@chromium.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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: Argh, v4 missed uncommitted changes. v5 brown paper bag release! :) This splits out the bounds checker so it can be individually used. This is enabled in Android and hopefully for syzbot. Includes LKDTM tests for behavioral corner-cases (beyond just the bounds checker), and adjusts ubsan and kasan slightly for correct panic handling. -Kees v5: - _actually_ use hyphenated bug class names (andreyknvl) v4: https://lore.kernel.org/lkml/20200227184921.30215-1-keescook@chromium.org v3: https://lore.kernel.org/lkml/20200116012321.26254-1-keescook@chromium.org v2: https://lore.kernel.org/lkml/20191121181519.28637-1-keescook@chromium.org v1: https://lore.kernel.org/lkml/20191120010636.27368-1-keescook@chromium.org Kees Cook (6): ubsan: Add trap instrumentation option ubsan: Split "bounds" checker from other options lkdtm/bugs: Add arithmetic overflow and array bounds checks ubsan: Check panic_on_warn kasan: Unset panic_on_warn before calling panic() ubsan: Include bug type in report header drivers/misc/lkdtm/bugs.c | 75 ++++++++++++++++++++++++++++++++++++++ drivers/misc/lkdtm/core.c | 3 ++ drivers/misc/lkdtm/lkdtm.h | 3 ++ lib/Kconfig.ubsan | 49 +++++++++++++++++++++---- lib/Makefile | 2 + lib/ubsan.c | 47 +++++++++++++----------- mm/kasan/report.c | 10 ++++- scripts/Makefile.ubsan | 16 ++++++-- 8 files changed, 172 insertions(+), 33 deletions(-)