From patchwork Thu Jan 16 01:23:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11335779 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 D3B1013B4 for ; Thu, 16 Jan 2020 01:24:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A07942467E for ; Thu, 16 Jan 2020 01:24:23 +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="Necsxt4U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A07942467E 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 B41D08E0016; Wed, 15 Jan 2020 20:24:22 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AF2DD8E0003; Wed, 15 Jan 2020 20:24:22 -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 A077F8E0016; Wed, 15 Jan 2020 20:24:22 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id 883CD8E0003 for ; Wed, 15 Jan 2020 20:24:22 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0F15D3ABF for ; Thu, 16 Jan 2020 01:24:22 +0000 (UTC) X-FDA: 76381751964.01.frog94_7d5d164ebc75d X-Spam-Summary: 2,0,0,512d27bb49e6ee22,d41d8cd98f00b204,keescook@chromium.org,:akpm@linux-foundation.org:keescook@chromium.org:aryabinin@virtuozzo.com:lenaptr@google.com:glider@google.com:dan.carpenter@oracle.com:gustavo@embeddedor.com:arnd@arndb.de:ard.biesheuvel@linaro.org:kasan-dev@googlegroups.com::linux-kernel@vger.kernel.org:kernel-hardening@lists.openwall.com:syzkaller@googlegroups.com,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:2564:2682:2685:2693:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3867:3868:3870:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6261:6653:6742:7875:9025:10004:11026:11658:11914:12043:12291:12297:12517:12519:12555:12679:12683:12895:12986:13069:13311:13357:13846:13894:14096:14181:14384:14394:14721:21080:21444:21451:21627:21811:30054:30062:30070,0,RBL:209.85.215.195:@chromium.org:.lbl8.mail shell.ne X-HE-Tag: frog94_7d5d164ebc75d X-Filterd-Recvd-Size: 4295 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Jan 2020 01:24:21 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id b9so9024905pgk.12 for ; Wed, 15 Jan 2020 17:24:21 -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=ztBntqcbRDpikloUpN2F0KWZjGouqnztxdMWfXHrneU=; b=Necsxt4UM069dJn7UjGMxHP4B4Sb0ubZNcm+nTrWn7TXh6RK8XLGxhuR6iy+4r9KvX HtSp4KGSa43ZdYKf5GtwMSyGz/DsjpqSBBps9cJKtCKviSO7uwPrv9LibT7DWL71ALGF w4jbfha23PQIwPGtO/NJIuyW3VbmoDRbPfxSU= 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=ztBntqcbRDpikloUpN2F0KWZjGouqnztxdMWfXHrneU=; b=Jbpj9RS54SS6L/lJz0H1gU4i/Y8wP14KicenH+lp5AsSX2ihVIxBW6PkHHEl5EerPR vugMeUxYFALZ1Mb80nflsRxH0vwSVZ4H0vjjZvR+hqyhvPijqxm+5IRS4i+Fj2OsyLa+ rMx7nc54xtVZx/ztmObaNTfkm7A20WvDKi1Zwhy9BckcepUzn5IlTwAqaElX//VjRZ6g KJsbxDfIsoqdUJ7uCLek7itstBjbfPJwTN/1IEwJNG0a+vfPfvMr6wjUl7BAs/DWzKR+ xZ38pYBXsN6R5ZEmSycUsDXYuWLbrI0bJbK5jvZqAVNhdln2G4HNsaIUYpykYGen8AIj LGew== X-Gm-Message-State: APjAAAUIopLN1QLq63UX99HyVLII3MjqjwOck7CIzwQeqUoGTqg0gmFd MF7lHcGhrN3GEM9Yq/q3ecCJhg== X-Google-Smtp-Source: APXvYqyEY91Ps4j5Unu6q/04cKkVouK2+nDVdzN3lDLdlCCZsHk9TuTlpS854xybBZZK2RoncaRauQ== X-Received: by 2002:a63:7843:: with SMTP id t64mr36298336pgc.144.1579137860501; Wed, 15 Jan 2020 17:24:20 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 144sm24408406pfc.124.2020.01.15.17.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 17:24:18 -0800 (PST) From: Kees Cook To: Andrew Morton Cc: Kees Cook , Andrey Ryabinin , Elena Petrova , 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 v3 0/6] ubsan: Split out bounds checker Date: Wed, 15 Jan 2020 17:23:15 -0800 Message-Id: <20200116012321.26254-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: This splits out the bounds checker so it can be individually used. This is expected to be 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 v3: - use UBSAN menuconfig (will) - clean up ubsan report titles (dvyukov) - fix ubsan/kasan "panic" handling - add Acks 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(-)