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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7843CC433E2 for ; Mon, 8 Jun 2020 23:09:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5481820890 for ; Mon, 8 Jun 2020 23:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657752; bh=1nuTO3/C9PLdayS+YAYuAtfHYtA++BUHbRE+Z0bXpyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NTD7qYQ4vYYPEYfe3Z8f6HpvWvkzL68JdEXrKrViMEkxsMaPPNowl924vyjUMeYgq iA64TrZ4POyg5pjZsPOcf7TYGh4hjDMKafwF8DtT6taFjZGMVFLht3VSfV64neeoVY GgVHQZP1uOBmM/ho0aGMItnuYz1Wmp4ndtZOPyAM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728366AbgFHXJL (ORCPT ); Mon, 8 Jun 2020 19:09:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:53082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728096AbgFHXIG (ORCPT ); Mon, 8 Jun 2020 19:08:06 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 10F2D2085B; Mon, 8 Jun 2020 23:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657686; bh=1nuTO3/C9PLdayS+YAYuAtfHYtA++BUHbRE+Z0bXpyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TUhikeQflvAJ4Kv3CTONiPHy11fM/FeFSahA0BPnkewMN6GP0LWprWE3nHF5kW//W afpsHT8pc3abywmCIEx+aVa7OVZEveEnSk8B5Ycb/jekr4ejHZwRZckFVUtAnHbqiA GTeOS4WADwO7mQrpLutvIdIHS6/wJkDWKLZvzTMo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kees Cook , Randy Dunlap , Andrew Morton , Josh Poimboeuf , Dmitry Vyukov , Elena Petrova , Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL 5.7 088/274] ubsan: entirely disable alignment checks under UBSAN_TRAP Date: Mon, 8 Jun 2020 19:03:01 -0400 Message-Id: <20200608230607.3361041-88-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook [ Upstream commit 9380ce246a052a1e00121cd480028b6907aeae38 ] Commit 8d58f222e85f ("ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST") tried to fix the pathological results of UBSAN_ALIGNMENT with UBSAN_TRAP (which objtool would rightly scream about), but it made an assumption about how COMPILE_TEST gets set (it is not set for randconfig). As a result, we need a bigger hammer here: just don't allow the alignment checks with the trap mode. Fixes: 8d58f222e85f ("ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST") Reported-by: Randy Dunlap Signed-off-by: Kees Cook Signed-off-by: Andrew Morton Acked-by: Randy Dunlap Cc: Josh Poimboeuf Cc: Dmitry Vyukov Cc: Elena Petrova Link: http://lkml.kernel.org/r/202005291236.000FCB6@keescook Link: https://lore.kernel.org/lkml/742521db-1e8c-0d7a-1ed4-a908894fb497@infradead.org/ Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- lib/Kconfig.ubsan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan index 929211039bac..27bcc2568c95 100644 --- a/lib/Kconfig.ubsan +++ b/lib/Kconfig.ubsan @@ -63,7 +63,7 @@ config UBSAN_SANITIZE_ALL config UBSAN_ALIGNMENT bool "Enable checks for pointers alignment" default !HAVE_EFFICIENT_UNALIGNED_ACCESS - depends on !X86 || !COMPILE_TEST + depends on !UBSAN_TRAP help This option enables the check of unaligned memory accesses. Enabling this option on architectures that support unaligned -- 2.25.1