Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp612542ybr; Fri, 22 May 2020 14:46:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgUMT7zr1bqSzIzp13NPdyyEu+I6uHQXes9H4pUSbFzdgimky5/ErsNtiPDuMIHrIRaGsu X-Received: by 2002:a17:906:a984:: with SMTP id jr4mr9934577ejb.3.1590183961015; Fri, 22 May 2020 14:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590183961; cv=none; d=google.com; s=arc-20160816; b=yA4RdOLDYfVxB536wPFBNVx6AAVKIPsmxiM52GZJdfOr5qv03R+75gOz4JdAdJM2TX CkpXqMD++HBBlmkze9YmY7pmXw80LgRrZ6dCxsu7UzrQOmPsSSmreraRmemS2cBe2axU JBDpx7KywHkMjAjHHvC8PuHo3NGpbw6t8BAveMLdJtQeaVNm/ExUx6IGCHYOERGLwXap +ylL+FVx6Zvg2VFGYuBQUH/QqwIfZsr5eezFKEmwxMsceFyLA4W3cm9CZDcl1dlFAJAg 8434Bym1L0N/bD7niX2CWZQGIsPqOsv4RNYIAyK0iZrmrhJz4/1t40vCtOotSVgGokNI p1/Q== 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=GCdpqksdEQ8eOMgD/HeQaMyUeYodk/YD8+VXvzwnuBg=; b=xmT50m6VqNVosMPmyfRZjMYiahpseo+fWc67Ve/16UYJ8GJTs+U57HMyz+YWbY5eGP obPZuoK24N+AdBFzxTWXSdNuvFQagi49FNuFkEAuipGO2hpBKhc1ChDSTYRwhmEzamBw tUgZIUjAyV9ZOFdmstyi5CWZSfRUpM3F7FUJ174k9JZ4PSZ+HHM8O4t4qe7FJcp6DO73 yyrsQO+6f2Iejq2e1MpvZ5uH/QBUZj49ngl0f0oLZMopXIMssB495GZ9XZNIuLXIrAAk f3Q2jRvzASxnGpi1YSZNJKSAsvhvTKJZCDc2HFpFwzdSb7HEwjcuLEaSX+SwO6jCs1eR b0jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mi6AGVnD; 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 la1si5817175ejb.235.2020.05.22.14.45.38; Fri, 22 May 2020 14:46:00 -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=mi6AGVnD; 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 S1731132AbgEVVmR (ORCPT + 99 others); Fri, 22 May 2020 17:42:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731033AbgEVVmO (ORCPT ); Fri, 22 May 2020 17:42:14 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 896AEC061A0E for ; Fri, 22 May 2020 14:42:14 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id j21so5602415pgb.7 for ; Fri, 22 May 2020 14:42:14 -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=GCdpqksdEQ8eOMgD/HeQaMyUeYodk/YD8+VXvzwnuBg=; b=mi6AGVnD3HKGHYWtiQQx/i5gPZUL3dF201rW6+tZvS1caUZP1SHEv1C+N4m02hlIj9 LIQn0k8d0q+WgZW+vFsVlgxnv4BFVK4JBtiZ2NuDJTUAyuqcnSNaWlKoMIVq2/qaO6ZC jOistPykwRXjN40NpVnhom96ljTid5YbZz/Zphfx1KsusvwUh8OBbI5SSmYoZ3xlQ8X0 A3QiYAy/tD7AHCInVh1LjqnePq+tATpwigKlo9rspwW6OI8n4SnIMUD9MJgdAppFSErK 4ffvOEaD+QjaI5ANjrm7xzwsCNLShc8cDDBbyA7INFk1Kt/w6m/CDx+30fWyljbPwIcR wjdg== 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=GCdpqksdEQ8eOMgD/HeQaMyUeYodk/YD8+VXvzwnuBg=; b=BhVWUNYKUcL4O/6f3uCsNhJCsCnTe+eo7WXeejl8cTZcRElNHXiMpVuwxSKSN0490w VhLdJYLEs46aJZBjJq0ZToGjPd0AoUycnJF/Ir3q/AAGpOFajMH1ftb/++BXjna3uRLU 9jFokThLOyNsSFiy2uJ3C0HV9BlDFgW2cQoabrnTG3hMGzlGlHgckzl6Br/GLou2nl7L GGP5EvFmQe1wFdJQi/KQzK6seQJH51V8ENU4AlSpGhirA0ZjSIiEKuzWMZsNuYul+Qw1 cjtKWnW+SggAWaZnzXk/BbuKLCty9tA4lPaY9C3rqzZgbAyJVe315ij8XqKAOaIN1Whk xgjA== X-Gm-Message-State: AOAM533TGik+VAy8NEdNsDxi67RAgE5mQabf6FcfY+fDQFTI+6sSgDHf dohIx15o0jyYOiepodkMLVk= X-Received: by 2002:a63:1103:: with SMTP id g3mr15688372pgl.206.1590183734186; Fri, 22 May 2020 14:42:14 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:400:e00:d0d2:96ff:22ac:b8e6]) by smtp.gmail.com with ESMTPSA id 4sm7625098pff.18.2020.05.22.14.42.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 14:42:13 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org Cc: Chris Zankel , Arnd Bergmann , Al Viro , linux-kernel@vger.kernel.org, Max Filippov , kbuild test robot Subject: [PATCH 1/3] xtensa: add missing __user annotations to __{get,put}_user_check Date: Fri, 22 May 2020 14:41:51 -0700 Message-Id: <20200522214153.30163-2-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200522214153.30163-1-jcmvbkbc@gmail.com> References: <20200522214153.30163-1-jcmvbkbc@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 __get_user_check and __put_user_check use temporary pointer but don't mark it as __user, resulting in sparse warnings: sparse: warning: incorrect type in initializer (different address spaces) sparse: expected long *__pu_addr sparse: got long [noderef] *ret sparse: warning: incorrect type in argument 1 (different address spaces) sparse: expected void [noderef] *to sparse: got long *__pu_addr Add __user annotation to temporary pointer in __get_user_check and __put_user_check. Reported-by: kbuild test robot Reported-by: Arnd Bergmann Signed-off-by: Max Filippov --- arch/xtensa/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index 47b7702aaa40..754a7c96b9da 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h @@ -84,7 +84,7 @@ extern long __put_user_bad(void); #define __put_user_check(x, ptr, size) \ ({ \ long __pu_err = -EFAULT; \ - __typeof__(*(ptr)) *__pu_addr = (ptr); \ + __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ if (access_ok(__pu_addr, size)) \ __put_user_size((x), __pu_addr, (size), __pu_err); \ __pu_err; \ @@ -180,7 +180,7 @@ __asm__ __volatile__( \ #define __get_user_check(x, ptr, size) \ ({ \ long __gu_err = -EFAULT; \ - const __typeof__(*(ptr)) *__gu_addr = (ptr); \ + const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ if (access_ok(__gu_addr, size)) \ __get_user_size((x), __gu_addr, (size), __gu_err); \ else \ -- 2.20.1