Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3271675pxa; Sat, 8 Aug 2020 16:09:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrObproeC8MwoDEgH24G3+VFcs7v7uMcrIJODANylMIcRwxw20uWMbkXAWDnXWbc0DMw8p X-Received: by 2002:a50:e047:: with SMTP id g7mr14618080edl.290.1596928184789; Sat, 08 Aug 2020 16:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596928184; cv=none; d=google.com; s=arc-20160816; b=k2NEQX7m+/XhbHGiD/5w5dQL9ZZ62OlSyPdJzT4X/midMdFISMd1FDnt3/XZLCqmIE RqanRCRlxY92GYlcb7rvRqx3UWrI3w7B78dV7VaTuuAhKADJdHStUNLKl3QDp2u9GSb7 JanJX8BQytcHD3LrP5sf6V8aBV9bGFv9R3eDr3FfSwtmcDbhj/7vJLzIdUW/YLGFbq9v m7lRzzolUih0fKQJ5OINlikTDKZtSuDViQCZY9H3i+mIpuwQpsHeyyMTfmiIYrixInQE P/TV5nc7KEYS5w38+rtFAx6LfFa6ThrpPgH0yMudLKy88i35hc+U73hMR0piTVQDLS2O DMrQ== 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=pDz8Q0LmiAvmhRqG8qC/282Sb6uJp9Qz6LidATVCB/U=; b=OPajZ/97TLoKGr/3jwiNZcOibTQmi9y58FoKrYg6QTW7sHzeCqU6I5h6dmOX38camR S9oNCqcwjk9D6DBIa74SgIW5WyF5mNbngKn1lkaw1eCcDHpnL0sSw7z8yV/XWx1hgj5m Hm/Jfy60Kxq+BzU6H5Wi7iUiLEoacvgpr5cW0JQTyb9h9htJVw04xGVOVUqewOl/qHpC 9KgOSPzx2Xe+UKr3y2w2znJOlqhdhf6TZNEXxWwJUOLmgrDTCTMHhY2x861fqk+ibC7z mU4tRqksLVyqYWwRLUGw6SBEjvaEgvnv+P3t10WLtGxyL/W8Ko/a1uktGfpobe42b8No /u6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Nf0dY76R; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si7576323eja.704.2020.08.08.16.09.22; Sat, 08 Aug 2020 16:09:44 -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=@gmail.com header.s=20161025 header.b=Nf0dY76R; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726478AbgHHXHW (ORCPT + 99 others); Sat, 8 Aug 2020 19:07:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbgHHXHU (ORCPT ); Sat, 8 Aug 2020 19:07:20 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 637BAC061756 for ; Sat, 8 Aug 2020 16:07:20 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id g19so2932627plq.0 for ; Sat, 08 Aug 2020 16:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pDz8Q0LmiAvmhRqG8qC/282Sb6uJp9Qz6LidATVCB/U=; b=Nf0dY76R58uGzD6j3/28zS3w3KIIQTf+muQl7PjVubwID4qK3JWF/9uoawz9K+B3cV 6mwPMHZTcKgnC3MqMrija8j3xlZRRlX49fmrdoNZ0+bbr2c/JeoglNRA3febJPBHHWIc gziUJ3Z9alJH4y6c2m3wCdXWTd5YuQ3BE5200BmqAzzPzCmQEcUZ/lWGzhvfE18Dy6Zv Vzj4kjzScpnL+WBZLDRHOF3SQBQxR/b6wBtCu6WjADq2f85Crt/axQ3fErfA/lvIRX07 8aBpGst0tzKazlBzIYSFoWyFC4PYw38G6iS9Vo13uOiHbC6aTfTZq2IFlOJITVHxXglj AyQg== 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:mime-version:content-transfer-encoding; bh=pDz8Q0LmiAvmhRqG8qC/282Sb6uJp9Qz6LidATVCB/U=; b=uIhgn5daxsN68PYBsFzV67NFc35C2zVfyc8iacjRAC+oXJm4hqGbnkfrs1yiji8Q9I H9mTGoruLRLzPNV6V2ZRVzpOIvvchElrBz09U5gWZZ96SBYDu3XQNgBBwiFQDJXVcHPd xymEnriC5g6ESyHsZbdfEl9SDMjDQamff1YfgEigpw13LJsn1YCYBYyHIi9Vi0ytPNCK 14Ey7P/7+sfB31X7PnHEcQTBIr3/WYyUh7752qg/dcC7xWLn/J5jcxOEnlp1BJEeq4TW H2/ZgY6M/2Vtr4UQKz4o++KUqDAQ8yex5z6Ab8zW+eW9D1YkY7avZo40ArFKzSINiFoF VsoQ== X-Gm-Message-State: AOAM531pNyWqgFH5Jh5O4yA2P4Ex9OmrrNk2MkiBof+gn3pveb19MPsZ 5dbNvtkQhMGxiS+gSgjyT5+G1A1e X-Received: by 2002:a17:90a:2224:: with SMTP id c33mr19383534pje.56.1596928039642; Sat, 08 Aug 2020 16:07:19 -0700 (PDT) Received: from localhost (g223.115-65-55.ppp.wakwak.ne.jp. [115.65.55.223]) by smtp.gmail.com with ESMTPSA id j8sm9324330pfh.90.2020.08.08.16.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2020 16:07:19 -0700 (PDT) From: Stafford Horne To: LKML Cc: Luc Van Oostenryck , Stafford Horne , Jonas Bonn , Stefan Kristiansson , openrisc@lists.librecores.org Subject: [PATCH v3 6/6] openrisc: uaccess: Add user address space check to access_ok Date: Sun, 9 Aug 2020 08:06:47 +0900 Message-Id: <20200808230647.833047-7-shorne@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200808230647.833047-1-shorne@gmail.com> References: <20200808230647.833047-1-shorne@gmail.com> 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 Now that __user annotations are fixed for openrisc uaccess api's we can add checking to the access_ok macro. This patch adds the __chk_user_ptr check, on normal builds the added check is a nop. Signed-off-by: Stafford Horne Reviewed-by: Luc Van Oostenryck --- Changes since v2: - Remove __force in cast suggsted by Luc arch/openrisc/include/asm/uaccess.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/openrisc/include/asm/uaccess.h b/arch/openrisc/include/asm/uaccess.h index 85a55359b244..7c5892f56765 100644 --- a/arch/openrisc/include/asm/uaccess.h +++ b/arch/openrisc/include/asm/uaccess.h @@ -57,6 +57,7 @@ static inline int __range_ok(unsigned long addr, unsigned long size) #define access_ok(addr, size) \ ({ \ + __chk_user_ptr(addr); \ __range_ok((unsigned long)(addr), (size)); \ }) -- 2.26.2