Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp37389pja; Fri, 22 Nov 2019 03:08:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwp3oSon+G4a3eP3d3g8cw3qbgqsSVWXA5QtPGE/TWY9K7hOUJU88az+duUXPyJRvl4wy52 X-Received: by 2002:a17:907:20b4:: with SMTP id pw20mr20919380ejb.83.1574420922676; Fri, 22 Nov 2019 03:08:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574420922; cv=none; d=google.com; s=arc-20160816; b=vTVfxgDO3DdWsTjhbngrTiSMZkE+FdtN7jWsxteWPeSwatwBozqGLFWcRpFgZ8dZcd qoJGshMZNos03D+pS2ptq5sk8yhYzc18uLOou934Nrk9I2vTQIReOMFRfjpiTQK722+E ely1gYTRR60S3f/aFHSvuBCb+sMMDs9A8eAA09QLizWzkKw9tiP8D2tH2FQUARyCFMQE 0ModstGxAHTW7ntzbKqYTf0OoJp9om5JCYSVUrxsQ9whkDXrB9FaSMOAWbLXX92fIKFk luSozuXgscRtiLwLfaNmbsVVrm99dxlPeWS9Xi/P05wq7HNICwJQOuT5p96flyAewOcF QE4w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9nAodFp1f2zKwqtJX6arBdEseGDx4NDhAABRLE7yEso=; b=t06pBfVqpR2shMJgLxU1tiPZNPhTe/TYwLQn4YTw+BpmUIGe9/T5e3hyvlPu/OjThE sxxT2X9Ue68P/2tUGCga3uke+oI4XY+puLewFAcWvLt97Pr8SJ7bMLkYVOFv21afkHwx 3SkEYDrPsc1keB/SflUlyRWyh5gy7Jb5Nr1JK7LIhkeEbASfXV+5pWOdQD1475eeQ3if 7cpiNVDqBjJnpVHCFh9URcT+p5/biMicwE5Fsjxaius9o3HgTunBk88t5x8XHY28zHAW N6sz+meJC2zljJ99yKzXaRVZLY2aNRWpG0Ai0sqmHepu/KkamtogGuSdKzGpIJjmi5zh VJGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="1T/31Wj2"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f24si4314729edf.15.2019.11.22.03.08.19; Fri, 22 Nov 2019 03:08:42 -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=@kernel.org header.s=default header.b="1T/31Wj2"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730980AbfKVLEc (ORCPT + 99 others); Fri, 22 Nov 2019 06:04:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:59488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731563AbfKVLEb (ORCPT ); Fri, 22 Nov 2019 06:04:31 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D1588207FC; Fri, 22 Nov 2019 11:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574420670; bh=WNzOcSDtG5/ZzPIRNc452Bw+G3KZ9d2AoXandGQy9MM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1T/31Wj2VRkukB8wemW1hd8GbXwOlWC5XCrztXKgPlSJ3pVCRMfWaLg3UkA1Q5U/K Dp2c6htyutCYf4eyKgenljcjylw18VEbPBsKZ5H3OVzvHBz1ZZyRIM13tsKizGE2hi WOHYvVWkRipTFxzArK23jJwWo9WMJBJTiSjS9w4g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Schwidefsky , Vasily Gorbik , Sasha Levin Subject: [PATCH 4.19 169/220] s390/kasan: avoid user access code instrumentation Date: Fri, 22 Nov 2019 11:28:54 +0100 Message-Id: <20191122100924.963763508@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100912.732983531@linuxfoundation.org> References: <20191122100912.732983531@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasily Gorbik [ Upstream commit b6cbe3e8bdff6f21f1b58b08a55f479cdcf98282 ] Kasan instrumentation adds "store" check for variables marked as modified by inline assembly. With user pointers containing addresses from another address space this produces false positives. static inline unsigned long clear_user_xc(void __user *to, ...) { asm volatile( ... : "+a" (to) ... User space access functions are wrapped by manually instrumented functions in kasan common code, which should be sufficient to catch errors. So, we just disable uaccess.o instrumentation altogether. Reviewed-by: Martin Schwidefsky Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- arch/s390/lib/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile index 57ab40188d4bd..5418d10dc2a81 100644 --- a/arch/s390/lib/Makefile +++ b/arch/s390/lib/Makefile @@ -9,5 +9,9 @@ lib-$(CONFIG_SMP) += spinlock.o lib-$(CONFIG_KPROBES) += probes.o lib-$(CONFIG_UPROBES) += probes.o +# Instrumenting memory accesses to __user data (in different address space) +# produce false positives +KASAN_SANITIZE_uaccess.o := n + chkbss := mem.o include $(srctree)/arch/s390/scripts/Makefile.chkbss -- 2.20.1