Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6712941ybl; Wed, 15 Jan 2020 09:03:03 -0800 (PST) X-Google-Smtp-Source: APXvYqz9rQTLEoJubQDRIoXdvF/pejCFL49CenPMLU+PbOdX9LQ5d7cHRZaEjWqAcMyuRJr37N4Z X-Received: by 2002:a9d:6544:: with SMTP id q4mr3499030otl.194.1579107783122; Wed, 15 Jan 2020 09:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579107783; cv=none; d=google.com; s=arc-20160816; b=gN2HSd3rNwDAIH2rhv8STyRtTTYO4xqNP+hN5S2D+TYO4TeRWnVQKORglhvvaE0sME cczoglaJzjdUkU/iHU9WxuExFDzm+S2KkGyPVeYI5wZKX8LsNk51bI2Zqx7LHCNaRS+Z Oo91FONfg523IZyYiCYTU7gf2S2ahJIyMBbCd4kl8kPUep6rhHHPLVFu2PaGe4WFtOjL J7Ab4rpq+jVaHIDyE0sXuCRGnbPH9w8xzO6hfLl8N2cZOsbtlNWeIXbAYRIv6O7LH+JV yvAWAEhvzzNffDxvNlUJ6v0fiqc65dV5+cVCsAeswKEi4Kn3L1Mdsl3WI8shJ18yUo4y eEKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oBQnQpVm4eKdteh8IhTOrm9qQNdOr/TSGOdEhhv2XDw=; b=f8koBpvZoSDuMqnadP2FpoE23ZP1xISvYUxizhUnO57hUH0GF1HjvhkN00WtQk6DvG t/s++SG1wc36BzjCSbGNNxwQk9vN6fX99JrukOl6phAhhqjgQ+c5GR4G63nz55iZ5D3m pVAAvj9o5e7DVx+yRDva4apPvQjEx7CNrXQ77XJzVLDyFfXneLQ4UYXoVighzVeH9PZK dAmHRWAgSHZ/622qT8gAwQgMRagO8hHwf+t/fqnPGU+z6yUj7ENtVEFdENs2Snh4OvGN hb+aJZttIxAerDA/S++OjoMzMgHkcXaDvhQdfdtiepTS62m3p4FtfJocsRak9Nli8Fl4 p1hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WZd/LM+V"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si10787748otr.57.2020.01.15.09.02.50; Wed, 15 Jan 2020 09:03:03 -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=@redhat.com header.s=mimecast20190719 header.b="WZd/LM+V"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728928AbgAORAK (ORCPT + 99 others); Wed, 15 Jan 2020 12:00:10 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:48163 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726574AbgAORAJ (ORCPT ); Wed, 15 Jan 2020 12:00:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579107608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oBQnQpVm4eKdteh8IhTOrm9qQNdOr/TSGOdEhhv2XDw=; b=WZd/LM+VhyfI69Xb8chtjnTkq6RCuqJVSEkVO6HoyvGqJ3ODl1na73n7mtKgu4BaNRIUKq 5JOxKcR4qqqSHXOigZ40YNYLznZDHP0M6RgXIHE8DEUr81uRbBTp6eNuJ/wHDC8A2dqW7q /aWE+8V3utRbH6m+V2mwUTbMLem02Nc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-233-xcn94VcLNdidfkTKf6Vnqg-1; Wed, 15 Jan 2020 12:00:04 -0500 X-MC-Unique: xcn94VcLNdidfkTKf6Vnqg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B90F800D4C; Wed, 15 Jan 2020 17:00:02 +0000 (UTC) Received: from asgard.redhat.com (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C89460BE0; Wed, 15 Jan 2020 17:00:00 +0000 (UTC) Date: Wed, 15 Jan 2020 17:59:57 +0100 From: Eugene Syromiatnikov To: Jens Axboe Cc: linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, Alexander Viro , linux-kernel@vger.kernel.org, Jeff Moyer , "Dmitry V. Levin" Subject: Re: [PATCH] io_uring: fix compat for IORING_REGISTER_FILES_UPDATE Message-ID: <20200115165957.GJ1333@asgard.redhat.com> References: <20200115163538.GA13732@asgard.redhat.com> <20200115165017.GI1333@asgard.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 15, 2020 at 09:53:27AM -0700, Jens Axboe wrote: > We'd need it in a union for this to work. Note that union usage may be a bit problematic, as it may lead to difference in behaviour (and possible subtle bugs, as a result) between native 32-bit kernel and 64-bit one in compat mode due to the fact that u64_to_user_ptr doesn't check higher 32 bits on 32 bit kernels; it is mostly ignored in the case of plain __u64 usage, as it is less likely to pass garbage in the higher 32 bits in that case, but the issue, nevertheless, stands, so I'd propose to check these bits in case the union approach is implemented.