Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp611413ybr; Fri, 22 May 2020 14:43:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyzic6vGY4ljbRurxSqNxVoxJ99NSwHfbt02+YxVw+XfRPXrTWh76AKf71RneGfuNXCTxq X-Received: by 2002:a17:906:3e96:: with SMTP id a22mr9734145ejj.232.1590183836551; Fri, 22 May 2020 14:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590183836; cv=none; d=google.com; s=arc-20160816; b=C5ZkDUYHYip01w3Su38CWxIzAML1Dgj0bMyzzVAcRTFlg6Z1uIXQcqCK/PbuTId1Kr GZHfsmdNmVfc/sGgCUXTgmgBLpXPZCB4T/USH6WBvoYgpS876XSNTer/u47TE5LF6rDh qac92Bh0qMGVGIvSGqc2hzIzhN89TlkLUdRsQVazvt1vDw8WFUeAZG+c/7qz3LS5EIZA V16MAfHw4WmTzaa/L0uPQRELhs2BkwzT8KY0y8xaJ10tfUqp/wHwUu4z6jqTKaTNV0ZU aRQBSkRL4mXY5/GlPEOeU86RBs1yK6qHin+LQe78GKuv2BVPMEqMFPqJdcCQRGZuRpGh 116Q== 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=GgtkiazwQoiTvdTYPMpf28KQw+7R+qBoN6rSS4orM1s=; b=hol6gvBTCqQUuxfHtHJmpUT9spxGsJ6FdDYMLv603OQLbM1nXwLzP5uuIIFfglNgBd R9t6Uq+rEHexHvKHaCQke7ZHHNeaqHUcwVcCNnD7LvxQT06ePf6slhQ2t15EqwaZngJJ j+6R2BsNyPGGVM+JltYI4cdU+COxfTQ9R2Cr0RQ4y0OeQbOygZhe+/pX0CqpF0ebtYOV xMb27nCGEfP4KjDouBicMHP3+w5HlZ3vp/datlPeSDxBfzpIvN8iuv9ftkQuPOMVGnVp LemxNbZLlGkOrT8h0Ml371P+MYomUMCz/ESozk52yIbcHUpNOdWeG/8/nMmy7kivn60E R//g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HjRVxmVf; 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 j7si5702379ejs.646.2020.05.22.14.43.34; Fri, 22 May 2020 14:43:56 -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=HjRVxmVf; 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 S1731154AbgEVVmT (ORCPT + 99 others); Fri, 22 May 2020 17:42:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731104AbgEVVmP (ORCPT ); Fri, 22 May 2020 17:42:15 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94F7CC05BD43 for ; Fri, 22 May 2020 14:42:15 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id d10so5624073pgn.4 for ; Fri, 22 May 2020 14:42:15 -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=GgtkiazwQoiTvdTYPMpf28KQw+7R+qBoN6rSS4orM1s=; b=HjRVxmVf1ldbdQQ4jNcadad7e/KmN7zX/mXlPZvNTiCYkFgoNVyaBwqVVZufsT5Kzv WeRED5ZDTFO1Dq1gsi2RuHgeAOWVlGDpU92OdtXKa8vmBBsOEwYT9GzhXt/+8ihBHXM6 neVBMtFF5nkFfjdhHFAEKbr9wYKK2dX/z7VhUV9TeMSXXAGvhVJ9JCjKuo0Uic6EUVtv LWJzMPhHlcO5oQUCnLf0nV5bR9LhIbpiyGEB1GrhHTGk7f1GlG03kWyFwbz3r8J3oont RiHHjbG37wSn1RwjIDl3jfQsst2KEODtihMM7EnQBz2PWRKIPcUd3pVAZ24OKYizQHHY blgQ== 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=GgtkiazwQoiTvdTYPMpf28KQw+7R+qBoN6rSS4orM1s=; b=mCJaGxSqpVEAy7aQTQEGn5Qu3VFv2p1HEJZ2BBooRNvdGBl2HIkWDRSm0pbNOsvANd UIKjWPiS/Ki9b/ZR5i2fhlUgK2ZHN5p6q4/FM7s1NtK64M7iX9CRICQ9n6zSfKMmXWrC UoEbh+48uJCy4nWLk8r1ELD5IN4K6NKfgiTCLofxoq276gfslwzGySEdgjgU5Ya+05ku VK1dK+TZT96YT2tDIAobIixoWhiSnvVSCZ0gJsb51k7Iuvew/QBfZEsN9F3LhCBkJjgh xO15fZYJgngfD0PsVo5YM1lUzRW4wR7si7qpmsDGelORCOWuzM2YBcjjxYFhdaHLv8oL W2MA== X-Gm-Message-State: AOAM530kABvjTJHiKuG2/StHNBdZyywpNu4G2J/ENo7WR1DpapB9Jvpg JTmARN+FJ65TgUNtNXJ+UW8= X-Received: by 2002:a63:3449:: with SMTP id b70mr16118674pga.289.1590183735190; Fri, 22 May 2020 14:42:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 14:42:14 -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 Subject: [PATCH 2/3] xtensa: fix type conversion in __get_user_size Date: Fri, 22 May 2020 14:41:52 -0700 Message-Id: <20200522214153.30163-3-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 8-byte access in __get_user_size converts pointer to temporary variable to the type of original user pointer and then dereferences it, resulting in the following sparse warning: sparse: warning: dereference of noderef expression Instead dereference the original user pointer under the __typeof__ and add indirection outside. Signed-off-by: Max Filippov --- arch/xtensa/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index 754a7c96b9da..445bb4cf3c28 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h @@ -204,7 +204,7 @@ do { \ retval = -EFAULT; \ (x) = 0; \ } else { \ - (x) = *(__force __typeof__((ptr)))&__x; \ + (x) = *(__force __typeof__(*(ptr)) *)&__x; \ } \ break; \ } \ -- 2.20.1