Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp52496ybg; Mon, 8 Jun 2020 16:12:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHpMP1nv7geNXaU1I80gH6EjjKALvl2BbjIDba4eVv9c5aifi/UHVGy2gxOeQLPjNbsQmN X-Received: by 2002:a05:6402:1776:: with SMTP id da22mr24763663edb.84.1591657935648; Mon, 08 Jun 2020 16:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591657935; cv=none; d=google.com; s=arc-20160816; b=TzL5zugD49vA4dOXd3SvdQJqnMZHiWLvm3eIBEmzZzOpT05LrYOj1SZokpCUqNiFb2 fcvDoGHLFhg2E8Izs2iB4NnpQwGSHTGR2I59xzP96ZouEBUoqUTWuvKlt9oUCQkoyKyN DM/R8Qdu58arIDszNfNktGn2qZ9i6fijwfpVJqkWGV3s6j/CjRxAVn6miNZVk1tn+J3+ eP5wTPlUkUwMOyrjhnUeTNwU+K3YEVzRvgsvGl/uK8TewTPWJdBp6nxsk7wdlSDeRzWw tI4NlLHcx3dsPqAsWga26R8C5u+bN2PyS7xeiaiZ4b/6571SHMR1yezus5X3eqLlSj3n YpFg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hGO4l5yDRzesVD0YWInipAhOdo20P4Zpvt2ZxCTsHIM=; b=kOtB4odX9Znv3zfpM+z+f+/ohov5WhBIBdnrwHX86EDJRYDDS3meKOUYNpD9deIIoe 9kEdMsCtXM/yCZFWLawsLXNDzIeDqhPYTuPR7wiAO6hwcl6I5m/nUfSPb8sN1Dm60IVa Ts9+vyYywfVdeU/ZYTOd+ZTItEb4QpwAxHQiIpGQb+OvVKI81opOJ38bAvHOK11ukWJ2 0Y6ISdm09xAuvYYiaDm97WvFjqDAMyfFgTZGJ2ThHt2712NG0IgH2IOXTwkhbKkRtqCH KtLFALNOJP7QzcpwghZV6EwQ4ohSHk9j++aLOwvkreFMLbz3KAWaX8Hct/id6FS8ngMQ ToSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TUhikeQf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si10389847edy.582.2020.06.08.16.11.52; Mon, 08 Jun 2020 16:12:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TUhikeQf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728347AbgFHXJJ (ORCPT + 99 others); Mon, 8 Jun 2020 19:09:09 -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