Received: by 10.223.164.202 with SMTP id h10csp4896553wrb; Wed, 29 Nov 2017 13:51:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMYbuo6QC61n8ZAgStdhNjnXO1007sWzMwvJNEFf7Lz8hJRvHTK6a4lBXOeW29PXm5sXSi+u X-Received: by 10.84.174.67 with SMTP id q61mr316879plb.184.1511992313836; Wed, 29 Nov 2017 13:51:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511992313; cv=none; d=google.com; s=arc-20160816; b=Vl5AYcMIvOAgMUXWRD9OCbu5UKxXH+tySwNrtpwSW+lGCfQM9ELnP80JIcSmajKWyn LYVIY1LFe6wPvwLqRLRyoXgEWjnfsnChSYpOxwx+BWXeu9pdZp3pS65h1LUK4xIKihah UaQPzizQqVBRiITuQB42S8aaIvsRRkJtEWC1UaKYqIKXY9J9fzMWsac+BPmBgyj+6h9F IW34F4tyHsWdBe10WNYU6nUJNGhv8wwLnyzv/cy2PFt8gbyqZPTuEiRpSbqs1PPcHONH UIOIJjQAcASdK/gomEB69axwar2yRJt6fT16KPWAz+KxrRMoH255gUIYxzgiiiunXe5J nXTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=VWW0E+CWNwOQ5UtaPw4SWGEOQN4Dw9CFaQteU/P1dNI=; b=R8Cr8HAhtoowbu5fT9F6PKL5qPIinPVzKvzOM5Q8uFtNQU8Jr9T0BFCcYH4TsI68QG x9K2/7AQMbDV2j5qYCcCzLYyNDd+Oag0hoIvsN3xOT0pgaFvtvs8Biz0dXmgoQpwpeXY 4Guc9JAbhOBMU6d7pAFi7SWhwaP1aeeHGceJ3CEhRJBnHfNvCAWhkmoibApm43biftqP ANeThVCR3XIN4QP3hEQaJBl1arS2yVTZoRqvz4k3FE0Vdyzf+2C+0KaBS0mQAGgKhoku 8glZH9bZF21nS2Y3H5dGNeFqA6rPGlhfUMIaVy7sUrhzhs+44PSUaLgz5GJVFVF51zA/ kc8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Y5QvoGZh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si1126994pgt.433.2017.11.29.13.51.39; Wed, 29 Nov 2017 13:51:53 -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=@google.com header.s=20161025 header.b=Y5QvoGZh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752691AbdK2Vv0 (ORCPT + 99 others); Wed, 29 Nov 2017 16:51:26 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:36123 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752384AbdK2VvY (ORCPT ); Wed, 29 Nov 2017 16:51:24 -0500 Received: by mail-it0-f65.google.com with SMTP id d16so6014243itj.1 for ; Wed, 29 Nov 2017 13:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VWW0E+CWNwOQ5UtaPw4SWGEOQN4Dw9CFaQteU/P1dNI=; b=Y5QvoGZhNSjyUku4HxjTJdFmuaZrQmi1JQ4zPbjhz1axWcosQxvqxmsBJM3pmOPee8 zndDmgddnWY1rt58XOfXuIevO8nzgfo6dXn3U4gd5udRUhti+IMCUJJIlGjXyBenNizz bloxI42e/qnY6HiYOyjUgE4rpy6i2qgs0KpvfqP31xTNWxnAFxJXzfezaEfUMEMTzqo3 C4jT3euW+OEBl/rnAIbJhQBm8CcnBwTmrfKf5kPynZ8H92LKJzo92I3XzYMG0PD4QXLO io95rxLVBltXwZtUxFi2fXAorLdr52nGQOL6Hkj7rZZl1BnIzU1GaVGBlAtQXZb+5xvY rgkA== 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; bh=VWW0E+CWNwOQ5UtaPw4SWGEOQN4Dw9CFaQteU/P1dNI=; b=MIqKR67tH5Y7q/jY3fWuNjhKl6d68iEektC1C66Tm15gmXfbeYNWgIDOp7QsawD3wM gKjmbUOMKbwo2Sv8XjivppOjXpsJM/rC/8clr+0ONwOW3oVSx2tQBuEnioMfnltLIVf+ vm56swWq9I282hVqwBYr91UPMoeZvsCRnl6Tl/KYrAT8ExNjl8p2jm7aNugYcZIfuoZP /21D6FTVeNy/+rZwYYClsOzFFReXRPdQXaSpRhKk4exI6YEoKNpU/nfyPYQs9MpiHMby QGgcaH93A16IAILQ2wf8Fm5WP6IXxSAkY7wS+2iiE54sXsLo5vjCWfwo6/a4OBwYWm3Y R6BQ== X-Gm-Message-State: AJaThX7NANVrLkyFy9LuEMVGPeOjaSUoIsf/R4ht2VKH6coLbPf7zbAi OuOpn6HwTwlaKwvfrSIAkkh5+Q== X-Received: by 10.36.115.133 with SMTP id y127mr354969itb.83.1511992283281; Wed, 29 Nov 2017 13:51:23 -0800 (PST) Received: from paullawrence.mtv.corp.google.com ([172.22.120.84]) by smtp.gmail.com with ESMTPSA id x72sm1438438ite.43.2017.11.29.13.51.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 13:51:22 -0800 (PST) From: Paul Lawrence To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Masahiro Yamada , Michal Marek Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kbuild@vger.kernel.org, Matthias Kaehlcke , Michael Davidson , Greg Hackmann , Paul Lawrence Subject: [PATCH v2 5/5] kasan: add compiler support for clang Date: Wed, 29 Nov 2017 13:50:50 -0800 Message-Id: <20171129215050.158653-6-paullawrence@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129215050.158653-1-paullawrence@google.com> References: <20171129215050.158653-1-paullawrence@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For now we can hard-code ASAN ABI level 5, since historical clang builds can't build the kernel anyway. We also need to emulate gcc's __SANITIZE_ADDRESS__ flag, or memset() calls won't be instrumented. Signed-off-by: Greg Hackmann Signed-off-by: Paul Lawrence --- include/linux/compiler-clang.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h index 3b609edffa8f..d02a4df3f473 100644 --- a/include/linux/compiler-clang.h +++ b/include/linux/compiler-clang.h @@ -19,3 +19,11 @@ #define randomized_struct_fields_start struct { #define randomized_struct_fields_end }; + +/* all clang versions usable with the kernel support KASAN ABI version 5 */ +#define KASAN_ABI_VERSION 5 + +/* emulate gcc's __SANITIZE_ADDRESS__ flag */ +#if __has_feature(address_sanitizer) +#define __SANITIZE_ADDRESS__ +#endif -- 2.15.0.531.g2ccb3012c9-goog From 1586558711037610655@xxx Tue Dec 12 06:31:34 +0000 2017 X-GM-THRID: 1586558711037610655 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread