From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:64106 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232584AbhCDSg1 (ORCPT ); Thu, 4 Mar 2021 13:36:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=iSdvSQSDfrdq+uGc+n7CiTZiXoEsTxCHbW2Zu6hOkmI=; b=ApJ9nVqYl5lk67H+L7h4FCDWBBYbIUPjWzVFPEGJVRhLflr5IbhWEmHAUa3k+dNeITxE g84tfn2GQghfZVEbyb9DtedEG9ZDoS7Tm0/UC9yDn3XM/+F+5NxzpYGCBJhb2MdWMJ+V ihxEbRsrUBC1lPejklJTS++7IarKIWLduf31+QaUFcVSSaOBHIRig0N2QybZORkaafVv p9UO+1r7leQ92eO895E5HAdZoWx1rrWvJdxIu5WkD4jTZZNSfbPwlo0/QssIlQLKijKl 52dCBymyxfvrDqZs5NgqdLPXAmH0yDU7BFS/odQZ1fG4PZ1IWq0820cbl/dwnesRNyqh Ig== Date: Thu, 4 Mar 2021 19:35:36 +0100 From: Heiko Carstens Subject: Re: smatch and copy_{to,from}_user return values Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-ID: To: Rasmus Villemoes Cc: Dan Carpenter , linux-s390@vger.kernel.org, smatch@vger.kernel.org On Wed, Mar 03, 2021 at 08:50:19AM +0100, Rasmus Villemoes wrote: > Hi Dan > > If you look at vfio_ccw_mdev_ioctl() in drivers/s390/cio/vfio_ccw_ops.c, > and vfio_ap_mdev_get_device_info() in drivers/s390/crypto/vfio_ap_ops.c, > there are examples of functions that can both return -Esomething as well > as may return the return value of a copy_{to,from}_user directly (i.e., > in case of error some positive number). > > [Those "return copy_to_user();" should probably all be changed to > "return copy_to_user() ? -EFAULT : 0;" - cc'ing the s390 list in case > the maintainers want to do that.] This has been reported just a couple of days ago - fixes will go upstream soon. Thanks for reporting anyway!