Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8123471imu; Thu, 15 Nov 2018 07:00:38 -0800 (PST) X-Google-Smtp-Source: AJdET5edcN7pgu50CaeK5Z46PV/eY0jfmY6Z0yNEDeMd3ZfA6Z9egyypIZk0Ja3Fza+mwZYadrUT X-Received: by 2002:a63:224f:: with SMTP id t15mr6084784pgm.69.1542294038630; Thu, 15 Nov 2018 07:00:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542294038; cv=none; d=google.com; s=arc-20160816; b=fTdpGETPmdQWu6aG8kxs15ZEQpvLlCbhCJv7gIFS8pCdydtZKiylHgqx3g67HShGnB BgZYBNBa3htfPLxaY7B3KauTPCR338VXaT1jE+d4WTQCLG3LM/uN1P1CsNfJtx2v4d+D oP+TxjYS1WoQYyfNYPNv/3HF9vu8A/ZmL7FznIk6sWFCPiC9P2dIMWTAow6+gbMVvaSz zkxPc7ax61kRyo+salBHrNm2y9p7tMCDoEwiCvV08WYjLzlbBtQ0rj/hQSHsWq5gMx5m qYw1HdAqFF+rZjgFcX0gI4zKBpNDpKn8Wb1h5ilYqGQhiabv2wwgvex6aK5QFrXhQuDu wUsA== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=24JG3cUKzQWrcKQyIOLhenCWTe3cRMt7frjOX9/e/2U=; b=y0nkE6iQPNpLKmAHpVOXgJIbMuXxhpuOFzmh1b9lAB+iY0ofrReCy9Ze9El3+4xQNA cx2HNmnqI1HN6PRjaLlrO1+LhKHwTQyHHsV6I31j5+OvT1rMYQJ/RAPuenP088daMc01 gCx/NKF8YhfBDThNx+LTBiqCbhUUHChXTnqoMCxIQ/+X/4LnuwEauo9rY8O8DnTxsXw3 +QQLo6wTiWh8da8vTtJ1HaMwnHpDnCY5BFSuaVbB1K84+bl751Mxwk0y0xs8iOXAJ6Su towcAvBZQrx/wEy0vdwVb79I0qa3T9GlTrloHzPEm01t+SKTogKegQB7F7UE5hpJGiSz 0hIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=SEk+Wt4W; 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 d33-v6si28488127pla.82.2018.11.15.07.00.23; Thu, 15 Nov 2018 07:00:38 -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=@sifive.com header.s=google header.b=SEk+Wt4W; 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 S2388293AbeKPBHS (ORCPT + 99 others); Thu, 15 Nov 2018 20:07:18 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44146 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbeKPBHR (ORCPT ); Thu, 15 Nov 2018 20:07:17 -0500 Received: by mail-pf1-f193.google.com with SMTP id b81-v6so9323236pfe.11 for ; Thu, 15 Nov 2018 06:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=24JG3cUKzQWrcKQyIOLhenCWTe3cRMt7frjOX9/e/2U=; b=SEk+Wt4WCYLIr1NCgAvQlQB97RcZg4cCG5VKofuQ3NE1+GDriRyCBm/xgY+uLLsnt2 IO+miovqipaPJ2Hz3fT2L5KXCc6HYr1rWAM7JtRQe0h0SiGBSwbIWrXnmgZiKGJaXPJy aiEybmsg95bXcrBeKNwMdfbZta+v3nz8zQsSJeeGJ0K523T0hSGV1EHGsyYBzOIksaIE g/WvFh6LrnAco18uNvzDAJVEJkc7eD9dB7Wn9fjjUEdjjWChOOoi0L4LFj2zOa8I3a10 gnq+msRduQHYJnildlvMAXEMIVxTEwGqYFcalh4RutEev7g2feee3Y8GTvmJEQhiYG/g xCVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=24JG3cUKzQWrcKQyIOLhenCWTe3cRMt7frjOX9/e/2U=; b=sIC6XaTuhgkD2IzLXm6SHAnvkSoPdPztgN5id2ugYk3VvjcfjW57HWbvbHLdPht8RB qzOnK9+4pAnOIDPs6HJ3AmVfM0jzv5ZL0ipl70yLZrSJEIg/xNkCc/ELRilhAlUN6b1m 11ltGEm6Awwkc/CHE1u773fgqlVGz3Dazh4tQMcz/IQtqp3U8deupMKC6SyxFWRQc3Wx F84futy+5iiT5GPtKnnstuTAtRO0uLjag1cVl1QMVOlbnIdVI7T4tEzrImR8EMcsvmiU xrCXc/z0HrWAzELs3aH3DWKveETQ197gArBWnfgorBDwH2hd3Sl672nqFFACwEcFV2Bw 4X2g== X-Gm-Message-State: AGRZ1gItMR5WIT1Vwk00W8Mthv3tTFsEJyDJlqUgADi/s0vlCL3VACBV AIeg+hmyt3j/HYnwOsQwM0WJkw== X-Received: by 2002:a63:af45:: with SMTP id s5-v6mr6101120pgo.125.1542293946495; Thu, 15 Nov 2018 06:59:06 -0800 (PST) Received: from localhost ([64.114.255.114]) by smtp.gmail.com with ESMTPSA id g5sm23690020pgu.57.2018.11.15.06.59.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Nov 2018 06:59:05 -0800 (PST) Date: Thu, 15 Nov 2018 06:59:05 -0800 (PST) X-Google-Original-Date: Wed, 14 Nov 2018 16:50:43 PST (-0800) Subject: Re: [PATCH] RISC-V: Fix raw_copy_{to,from}_user() In-Reply-To: <20181115002755.24195-1-olof@lixom.net> CC: aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Olof Johansson From: Palmer Dabbelt To: Olof Johansson Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 14 Nov 2018 16:27:55 PST (-0800), Olof Johansson wrote: > Sparse highlighted it, and appears to be a pure bug (from vs to). > > ./arch/riscv/include/asm/uaccess.h:403:35: warning: incorrect type in argument 1 (different address spaces) > ./arch/riscv/include/asm/uaccess.h:403:39: warning: incorrect type in argument 2 (different address spaces) > ./arch/riscv/include/asm/uaccess.h:409:37: warning: incorrect type in argument 1 (different address spaces) > ./arch/riscv/include/asm/uaccess.h:409:41: warning: incorrect type in argument 2 (different address spaces) > > Signed-off-by: Olof Johansson > --- > arch/riscv/include/asm/uaccess.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uaccess.h > index 473cfc84e412f..8c3e3e3c8be12 100644 > --- a/arch/riscv/include/asm/uaccess.h > +++ b/arch/riscv/include/asm/uaccess.h > @@ -400,13 +400,13 @@ extern unsigned long __must_check __asm_copy_from_user(void *to, > static inline unsigned long > raw_copy_from_user(void *to, const void __user *from, unsigned long n) > { > - return __asm_copy_to_user(to, from, n); > + return __asm_copy_from_user(to, from, n); > } > > static inline unsigned long > raw_copy_to_user(void __user *to, const void *from, unsigned long n) > { > - return __asm_copy_from_user(to, from, n); > + return __asm_copy_to_user(to, from, n); > } > > extern long strncpy_from_user(char *dest, const char __user *src, long count); Oh, no idea how I missed that one. This looks like it's been in for a long time, so I'm surprised anything works at all! I'm going to add a stable CC and PR this to Linus this week, assuming I get some time to at least give it a minimal test. Thanks for catching this!