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=-8.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 617CFC46477 for ; Mon, 17 Jun 2019 21:30:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A3E92063F for ; Mon, 17 Jun 2019 21:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560807036; bh=P0LIOFq/wF6tmB19nDw5NC14GjcgOnPUKzgCtfUQLYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=E6hbYR4dtzPjoe5b432484kqZQcc7SSQyH9D/Q/W4nJpBjTZgK2hSj1UoOR0yplaO tJs+kQ5sDMN1NFP+QQQr/x9PvU2woIJQqhdHx53AkxxLcnZ0wNuHZrunei4iElWKdg t0rLjRMQslV81RTHZNQfRSW1GG4CVRgyrHKSbYJk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730335AbfFQVaE (ORCPT ); Mon, 17 Jun 2019 17:30:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:57232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730328AbfFQVaB (ORCPT ); Mon, 17 Jun 2019 17:30:01 -0400 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 8746D20673; Mon, 17 Jun 2019 21:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560807001; bh=P0LIOFq/wF6tmB19nDw5NC14GjcgOnPUKzgCtfUQLYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qxx8uq2uouU31M/2hYbC24Lxf9YmGjzwvJofvL6WnIyLnDwsbUV69qNcIZzksjhB2 9TXwNxxLo5IG6nMsudONvilFx/bBuw7mzaaUlwX5JA/4eXA50LrtQ6PQpdFJjaPqDO ApI1Yk9IkjrvRM5ZFNKiz5f8NF0j9Cdm1TE8BO+c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasily Gorbik , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.14 26/53] s390/kasan: fix strncpy_from_user kasan checks Date: Mon, 17 Jun 2019 23:10:09 +0200 Message-Id: <20190617210750.342730819@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210745.104187490@linuxfoundation.org> References: <20190617210745.104187490@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit 01eb42afb45719cb41bb32c278e068073738899d ] arch/s390/lib/uaccess.c is built without kasan instrumentation. Kasan checks are performed explicitly in copy_from_user/copy_to_user functions. But since those functions could be inlined, calls from files like uaccess.c with instrumentation disabled won't generate kasan reports. This is currently the case with strncpy_from_user function which was revealed by newly added kasan test. Avoid inlining of copy_from_user/copy_to_user when the kernel is built with kasan support to make sure kasan checks are fully functional. Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- arch/s390/include/asm/uaccess.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h index cdd0f0d999e2..689eae8d3859 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h @@ -67,8 +67,10 @@ raw_copy_from_user(void *to, const void __user *from, unsigned long n); unsigned long __must_check raw_copy_to_user(void __user *to, const void *from, unsigned long n); +#ifndef CONFIG_KASAN #define INLINE_COPY_FROM_USER #define INLINE_COPY_TO_USER +#endif #ifdef CONFIG_HAVE_MARCH_Z10_FEATURES -- 2.20.1