Message ID | 20200227193516.32566-5-keescook@chromium.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=kwPD=4P=kvack.org=owner-linux-mm@kernel.org> 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 36639159A for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 27 Feb 2020 19:35:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E0C97246A3 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 27 Feb 2020 19:35:24 +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="g/0EvsSA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0C97246A3 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 1A1786B0005; Thu, 27 Feb 2020 14:35:24 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 152716B0006; Thu, 27 Feb 2020 14:35:24 -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 019A36B0007; Thu, 27 Feb 2020 14:35:23 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id DB3B96B0005 for <linux-mm@kvack.org>; Thu, 27 Feb 2020 14:35:23 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B58208245578 for <linux-mm@kvack.org>; Thu, 27 Feb 2020 19:35:23 +0000 (UTC) X-FDA: 76536910926.21.drain28_11f133e8af607 X-Spam-Summary: 2,0,0,0fe10bee4529a0a7,d41d8cd98f00b204,keescook@chromium.org,,RULES_HIT:41:355:379:541:800:960:967:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2525:2553:2559:2563:2682:2685:2689:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3867:3870:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:5007:6261:6653:6742:7903:8957:9025:10004:11026:11658:11914:12043:12291:12296:12297:12438:12517:12519:12555:12679:12683:12895:13069:13311:13357:13894:14181:14384:14394:14721:14777:21080:21444:21627:21740:21939:21983:30054:30070:30090,0,RBL:209.85.216.67:@chromium.org:.lbl8.mailshell.net-66.100.201.201 62.2.0.100,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:23,LUA_SUMMARY:none X-HE-Tag: drain28_11f133e8af607 X-Filterd-Recvd-Size: 4248 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf34.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Thu, 27 Feb 2020 19:35:23 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id m7so3556042pjs.0 for <linux-mm@kvack.org>; Thu, 27 Feb 2020 11:35:22 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=46Z0N6nNFPIgM2OuwNgkHRjYe659IsqNoWw8FG0hdrY=; b=g/0EvsSAMFLQMs3F4fsuSd2nVZEd0UnWu4D3Sl3dqAK2cD5B2JP/5fjn+Xf0mTTCA1 5qBJKz6rexuU4wD/Fm2T6RKX1mqL5z11ejipV8pBRRNCR/z0fgr1nevk9cbdozCY3z4J CEEvmhdGXWUBzU64x5LbmMXX3iFxMU4Y/Igq8= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=46Z0N6nNFPIgM2OuwNgkHRjYe659IsqNoWw8FG0hdrY=; b=fkeie0tHx5z6BRX4HUHxxFKZsiZ6VmxG79ToScUZGcGAIWwcAyDqWkuTJxsR1pwu1y VFniz+bU42747AVQ+AkMbDSJPYFh2LvW+1/vXdIiZwPHU6fnuBx1RwAus0GKiIR8w5d3 TulMi0A4xBXbzahGmpI5pMU+lucMgy8/Nc9w6Pge+hn+mrwydDgsFryAvpNthVRYvTUV Oxb8FVXJNcGwjKe+iXuGVSz947fasxiw/2wom/L2B2GRdU3iPfSa9pQu5FeNU8gA3AkU u4WAsCSmoyp7+CuCWYKmRrD/24j07oQsjs+/xjbNP9SaBMW8Wuxy1mpbNZ+WrmiLt8tN unGA== X-Gm-Message-State: APjAAAXhaTThPEXzyDHjU5AXrW7peHiEw5WJKF5hCKJZz+qPDSK+nP8f bLbwvI0k1EPI7YGcV1DBLRBaPw== X-Google-Smtp-Source: APXvYqyO3xXE1iYRbSHC6/Q9hVVz43xR0biiVO0z4es+cZucLAEsJlQuw4NFe3BlB1tUhIBv2xxm2g== X-Received: by 2002:a17:90a:c24c:: with SMTP id d12mr520844pjx.113.1582832121953; Thu, 27 Feb 2020 11:35:21 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id p18sm11620140pjo.3.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 <keescook@chromium.org> To: Andrew Morton <akpm@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org>, Andrey Ryabinin <aryabinin@virtuozzo.com>, Elena Petrova <lenaptr@google.com>, Andrey Konovalov <andreyknvl@google.com>, Alexander Potapenko <glider@google.com>, Dan Carpenter <dan.carpenter@oracle.com>, "Gustavo A. R. Silva" <gustavo@embeddedor.com>, Arnd Bergmann <arnd@arndb.de>, Ard Biesheuvel <ard.biesheuvel@linaro.org>, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, syzkaller@googlegroups.com Subject: [PATCH v5 4/6] ubsan: Check panic_on_warn Date: Thu, 27 Feb 2020 11:35:14 -0800 Message-Id: <20200227193516.32566-5-keescook@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200227193516.32566-1-keescook@chromium.org> References: <20200227193516.32566-1-keescook@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: <linux-mm.kvack.org> |
Series |
ubsan: Split out bounds checker
|
expand
|
diff --git a/lib/ubsan.c b/lib/ubsan.c index 7b9b58aee72c..429663eef6a7 100644 --- a/lib/ubsan.c +++ b/lib/ubsan.c @@ -156,6 +156,17 @@ static void ubsan_epilogue(void) "========================================\n"); current->in_ubsan--; + + if (panic_on_warn) { + /* + * This thread may hit another WARN() in the panic path. + * Resetting this prevents additional WARN() from panicking the + * system on this thread. Other threads are blocked by the + * panic_mutex in panic(). + */ + panic_on_warn = 0; + panic("panic_on_warn set ...\n"); + } } static void handle_overflow(struct overflow_data *data, void *lhs,
Syzkaller expects kernel warnings to panic when the panic_on_warn sysctl is set. More work is needed here to have UBSan reuse the WARN infrastructure, but for now, just check the flag manually. Link: https://lore.kernel.org/lkml/CACT4Y+bsLJ-wFx_TaXqax3JByUOWB3uk787LsyMVcfW6JzzGvg@mail.gmail.com Signed-off-by: Kees Cook <keescook@chromium.org> --- lib/ubsan.c | 11 +++++++++++ 1 file changed, 11 insertions(+)