Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3197195ybc; Thu, 21 Nov 2019 04:56:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxuPnNbPtXTceLqN51kRDymC/24Ho/jQa5s2uRwf0D/M+uPfHBoJ+oNpLyhWpW7yRGbgUGa X-Received: by 2002:a1c:ed0e:: with SMTP id l14mr9142882wmh.74.1574340974832; Thu, 21 Nov 2019 04:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574340974; cv=none; d=google.com; s=arc-20160816; b=Leq05u/KsVR2guWGIW1E0XUrWHyaONXtZ4VvDSpCES/VolpUCKD4/1s+a29n1gASL1 GugXnDWtFDkzqKGtbsz4yK8t6+a+YBHC63i62dxPRvrdtvy4c15KouZz5gJUnV5eSxlE Krd+AZBByqlx4b+XbLhnflH7gJOJaopnZkcN//X3B7Z4LfC5wLwJWHfSrDa5zChY4Pyy XxBfdqWX+pEe9eDZysAYef4rx5RswCDQ3GVqCI/fr94L2bHDHw6qnPYj4qRUROBCUoZu zTlKr0abrB/AU5R4Fl+EVEKOCCdQ2ev8Ak+QXeNbkHD6gwAfBhUdfTSEFXAnOk/7Wr8E 6ZfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0+L8h9ensdN1j4gyCGQx+fEr6tXQsonNDbLN6tfONUA=; b=dqxc+MxFOSG6ef7GZ0fJywQHYG6u0X4i9xHgMB8LwZSjv59DGWdnyRog09qa5gk0HA +Swg/TIcxkzlptSVDQzyYf7SMv338jhk9ufU3y8q2pMp7SRHUZ6NGcAnLDFVBB3uLr0k zXl/Zqs1jAQae4XSieu3lvP6kCyQN3S8G/t3efMmNGkvzm7K55qwWK59q2cODYj7LVJe mG4l+IedNYFF9A9D/b+KkqtVzxTycKfuznYX/y0GMJx3yeX5wKZmwBzM9rCR4ZP5YMCT q48DAhwdtpIQz9P4A2SMV6hgiS47nmrajXiKomLMrbW/c8hQVUTXl7Pq10/6pv9IC7bq 9STA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g53si2141938edb.313.2019.11.21.04.55.50; Thu, 21 Nov 2019 04:56:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726747AbfKUMxW (ORCPT + 99 others); Thu, 21 Nov 2019 07:53:22 -0500 Received: from relay.sw.ru ([185.231.240.75]:51612 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbfKUMxW (ORCPT ); Thu, 21 Nov 2019 07:53:22 -0500 Received: from dhcp-172-16-25-5.sw.ru ([172.16.25.5]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1iXlxI-000251-L0; Thu, 21 Nov 2019 15:53:04 +0300 Subject: Re: [PATCH 1/3] ubsan: Add trap instrumentation option To: Kees Cook Cc: Elena Petrova , Alexander Potapenko , Dmitry Vyukov , Linus Torvalds , Dan Carpenter , "Gustavo A. R. Silva" , Arnd Bergmann , Ard Biesheuvel , Andrew Morton , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com References: <20191120010636.27368-1-keescook@chromium.org> <20191120010636.27368-2-keescook@chromium.org> From: Andrey Ryabinin Message-ID: <35fa415f-1dab-b93d-f565-f0754b886d1b@virtuozzo.com> Date: Thu, 21 Nov 2019 15:52:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191120010636.27368-2-keescook@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/20/19 4:06 AM, Kees Cook wrote: > +config UBSAN_TRAP > + bool "On Sanitizer warnings, stop the offending kernel thread" That description seems inaccurate and confusing. It's not about kernel threads. UBSAN may trigger in any context - kernel thread/user process/interrupts... Probably most of the kernel code runs in the context of user process, so "stop the offending kernel thread" doesn't sound right. > + depends on UBSAN > + depends on $(cc-option, -fsanitize-undefined-trap-on-error) > + help > + Building kernels with Sanitizer features enabled tends to grow > + the kernel size by over 5%, due to adding all the debugging > + text on failure paths. To avoid this, Sanitizer instrumentation > + can just issue a trap. This reduces the kernel size overhead but > + turns all warnings into full thread-killing exceptions. I think we should mention that enabling this option also has a potential to turn some otherwise harmless bugs into more severe problems like lockups, kernel panic etc.. So the people who enable this would better understand what they signing up for.