Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1447820ybl; Fri, 31 Jan 2020 22:26:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzs0Wm3Q036v7RNSoyYQhremIySpp0ueFc3LFDYtfKize6xjwYVoKjzqe5nbV44NJ+KNskH X-Received: by 2002:aca:5582:: with SMTP id j124mr8332180oib.20.1580538380838; Fri, 31 Jan 2020 22:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580538380; cv=none; d=google.com; s=arc-20160816; b=QlGTqZzBbCI76bWRrHbvIOLk3XjXIZ48c/Ooj/PPlRQgYGQHkxba/aJW4zJBEyAR/x hVWOH9zLqLG6HyThOqVKJfqcFnjnLBhaxsaG7P/ydCvVVQ0BY+Yb7Q+8LsapH7sZ8fz0 ZNxJh0BjzdcN4bKDGt+mwYTo4epYH5b4Dff+r9sgD2ZALUz/h9pJwgBuBD+AJXbOBt2k CVWsBOvHQgjtTHk/9x5aW56PxmpprbkNdx0v5LCvUUmNSj68Gi8/Si4H5Ha5MzT4Sn0d qljqCW3w5O0cqs/dOA2eqhPTo+vey4ecP2ZUvJFUjm/2m6dcVdFYYc2yMWmHU1HsmWNJ uLKw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=kIoryQNxUONJRGtWLKxPO60ZclmbdJRMXHgfMgH0QP0=; b=aHku7oTvCPKcwYLwlazxM6AZxOe0nM3FT7m2U0pPGgqh9/GCnGQ5OPKbqzHlSkQdZM BUAkSrjjU8WI/SvLzEYpBMaVcs27oCvm+lb37AfTjL2QmMo9z00Fb6hKDWRHkQG8fQRb 4iM59STpZgObSZ3SdNcmPKM0MJAqckAqh/TXbGyJjePTnhOnBewauxbtmKaZONris6EH 6ixhJodRT7p7Ru8UX9RaOsrsv9kionrRlwDBcZRJxRwkRZh8BRsJm70CCj7ouJNoX/Np PDb1VhBMgj5ON80nyQEYzLvCZ73rpPxe6WoSt3nytzZaB8ThhoOXbmP1OKwENGts7bKc HisQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a8HWqdZZ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si6086903otq.96.2020.01.31.22.26.07; Fri, 31 Jan 2020 22:26:20 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a8HWqdZZ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726197AbgBAGZL (ORCPT + 99 others); Sat, 1 Feb 2020 01:25:11 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44694 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbgBAGZL (ORCPT ); Sat, 1 Feb 2020 01:25:11 -0500 Received: by mail-pg1-f195.google.com with SMTP id x7so4751243pgl.11; Fri, 31 Jan 2020 22:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kIoryQNxUONJRGtWLKxPO60ZclmbdJRMXHgfMgH0QP0=; b=a8HWqdZZWAZLkD+sZxA1kKSsILlD5gmRvsj9U3v+N6blQBaQ+8VsYkBRyN7xZV/Zj4 7e+42qi6iFLM4tVW1fKuZqOFhF+3c0y7S/NOgM2K3ygTBYFWrXRjdIj8e6L+Qj2luhCd 6MPtjjhO85yBkBKTyI5eVqUUgLgmg1DnxeaIbYTmlJmlMrH4PZIzQ/ZUHJiK+1RaaZ7B FLkJfGm0ziM2b/vVZDfB0ksKtHzSyx8kLGiHsqpZSPbVpQMmRL7tf4xD8y8cVDSkgTK7 pt53OK/25Adx6fP4LRYldqspO0DzKHwCz/Ssc/WTYbEbioyrSCU4Tfwcu+PRP/d4bd2O sf1Q== 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=kIoryQNxUONJRGtWLKxPO60ZclmbdJRMXHgfMgH0QP0=; b=kgvk68jHXDCYIaUCfh8WlDZBE9ByD3EBgi5H8JQ8LmTsCJErnU8SPZCVhXdTS8Je5v JjplsCZ3DoDcENxQ1uaJx7D6/uewFwKvt0oRxDXf3V27FAy3jH1q6tOQqU8lLNd5bXyH k7olLJiE0MyMAd6dcmhreh3lvdw72uUCEdxcpoUCUcmmdCHpRzY/qE9kxx4uMGia1Iy4 /VhKP4P2MGZvfsQb8jXcjWM+ps5+x+sxHnMqeTKgQg2+4i3L9XJBQUWe0vktElijGv2/ fVKSiXZR4sqXPScMpGRwG4LGeZzSDZ/tV7X+2gdQ1Z4hMWiyPh65tfmXBOEXr8fcsXra C0Qw== X-Gm-Message-State: APjAAAXdgCEoHJqOG4T4r2jdTirc+OtsDikjQ68QnVkDezyuAeiTqWyT /DWqAURugH8Erch2qqItrOo= X-Received: by 2002:a63:214e:: with SMTP id s14mr14017609pgm.428.1580538310445; Fri, 31 Jan 2020 22:25:10 -0800 (PST) Received: from localhost.localdomain ([149.248.18.167]) by smtp.gmail.com with ESMTPSA id v4sm13191971pgo.63.2020.01.31.22.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jan 2020 22:25:09 -0800 (PST) From: Changbin Du To: Andrey Ryabinin Cc: Alexander Potapenko , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , hpa@zytor.com, x86@kernel.org, Andy Lutomirski , Masahiro Yamada , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Changbin Du Subject: [PATCH 0/2] Add SANITIZE_xx.o & SANITIZE and apply them to x86 Date: Sat, 1 Feb 2020 14:24:57 +0800 Message-Id: <20200201062459.7150-1-changbin.du@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These two patches add SANITIZE_xx.o and SANITIZE to disable all sanitizers for specific files, and apply them to x86 booting code. We need to disable UBSAN for some of ealy stage code: o For code which could operate in one-one mapping mode. In this case, kernel would crash at accessing data parameter when invoking UBSAN handlers. o Since UBSAN handlers are instrumented by KASAN, so invoking UBSAN handlers before KASAN is initiated also is not allowed. Changbin Du (2): sanitize: Add SANITIZE_xx.o and SANITIZE to disable all sanitizers for specific files x86: Disable both KASAN and UBSAN for some booting code Documentation/dev-tools/kasan.rst | 12 ++++++++++++ arch/x86/boot/Makefile | 2 +- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/entry/vdso/Makefile | 3 +-- arch/x86/kernel/Makefile | 10 +++++----- arch/x86/lib/Makefile | 2 +- arch/x86/mm/Makefile | 4 ++-- arch/x86/realmode/Makefile | 2 +- arch/x86/realmode/rm/Makefile | 2 +- scripts/Makefile.lib | 4 ++-- 10 files changed, 27 insertions(+), 16 deletions(-) -- 2.24.0