Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5258298pxj; Tue, 22 Jun 2021 19:43:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypx+ly1UQsLVwtUC6K3cAwVtB/poQPobqhA1iHhHPqVTXVtm1+ZEKK+YLQwv5F/Ev7UUVK X-Received: by 2002:a17:906:2bdb:: with SMTP id n27mr7365456ejg.312.1624416205124; Tue, 22 Jun 2021 19:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624416205; cv=none; d=google.com; s=arc-20160816; b=t5DiAE4S514wMpZ/joocxbPvXU0y5qRHl+FVBShMQBOptzw0yd4zPWBU7qYGQe9uD+ yKxXhDRScRB7yLgYJUL9IZPBRU8bqtNiClvGrfNUYseIK9v8bgSFhAqwk7JNsGXijjeG ZRmspcPhyOHB2G3HSERgRBgu3JEiNdS9sfrrV8LSFIRG4q5lxBVcG86htRP7/P9c/SbF Oc4QE+DRk7Ty3fh1Zi+3I0vAZ0UwJJ3y23x1/OaMoTpuFsXMZOjtDiZjfKCv8GnR7BpF vCSAIUWSq7odDlQLlNOx8K+EbZw2KBI0eiztjGg/bCS67sMCLV23srfCmBL1uE/7RB1/ 2rrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ldYxQCsm77i69v+UQ/pNsAcB0gkNoG5L0zzCNzeJ2SY=; b=xauHcl7i/DTobZ5YkuhEMGxTZkziwJSc8c+B9j+qtU9MFZghCoXpPtwHbyilATUmQS lofgXgGD7aOnYSB4tFSTVkT/N3fJ95ZVVYbl95j3GHYqR0Oc6aF+LL2S/sUbBLPSeheW DEOniu1TUd9hRRpc7DeqKpwmykz6PADD62pQJ2tj1i7hqrIeS+EiVvtdpzBp5WZKWvQ+ EgqNRdzHAj7Zxh9NbtxIdWAapA7c6QkPf+DBDpUnLcGNObcVk6foUyK7vT+BHjUdhads l7bPXLHiWmfa+29QAIMAzLrlyzr+WqrR3xT9jqz3u8CLwYKr0n7FGnf9jKuFL5hfCZAZ RkpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v9si8628353edq.17.2021.06.22.19.43.02; Tue, 22 Jun 2021 19:43:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229955AbhFWCob (ORCPT + 99 others); Tue, 22 Jun 2021 22:44:31 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:50714 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbhFWCoa (ORCPT ); Tue, 22 Jun 2021 22:44:30 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id BEE9E72C8B4; Wed, 23 Jun 2021 05:42:12 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id B27227CF72A; Wed, 23 Jun 2021 05:42:12 +0300 (MSK) Date: Wed, 23 Jun 2021 05:42:12 +0300 From: "Dmitry V. Levin" To: Andrew Morton Cc: Gleb Fotengauer-Malinovskiy , Axel Rasmussen , Peter Xu , Mike Kravetz , Andrea Arcangeli , Lokesh Gidra , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] userfaultfd: fix UFFDIO_CONTINUE ioctl request definition Message-ID: <20210623024212.GA17269@altlinux.org> References: <20210601143432.1002481-1-glebfm@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210601143432.1002481-1-glebfm@altlinux.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Jun 01, 2021 at 05:34:32PM +0300, Gleb Fotengauer-Malinovskiy wrote: > This ioctl request reads from uffdio_continue structure which justifies > _IOC_READ flag. > See NOTEs in include/uapi/asm-generic/ioctl.h for more information. These ioctl flag usage rules seem to be a perpetual source of mistakes. I suggest a slightly different wording of the commit message which is hopefully a bit easier to follow: "This ioctl request reads from uffdio_continue structure written by userspace which justifies _IOC_WRITE flag. It also writes back to that structure which justifies _IOC_READ flag. See NOTEs in include/uapi/asm-generic/ioctl.h for more information." Please make sure this patch is merged before v5.13 is released, otherwise the UAPI bug would have to stay for backwards ABI compatibility. > Fixes: f619147104c8 ("userfaultfd: add UFFDIO_CONTINUE ioctl") > Signed-off-by: Gleb Fotengauer-Malinovskiy > Acked-by: Peter Xu > --- > include/uapi/linux/userfaultfd.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > v2 fix commit message > > diff --git a/include/uapi/linux/userfaultfd.h b/include/uapi/linux/userfaultfd.h > index bafbeb1a2624..650480f41f1d 100644 > --- a/include/uapi/linux/userfaultfd.h > +++ b/include/uapi/linux/userfaultfd.h > @@ -80,8 +80,8 @@ > struct uffdio_zeropage) > #define UFFDIO_WRITEPROTECT _IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \ > struct uffdio_writeprotect) > -#define UFFDIO_CONTINUE _IOR(UFFDIO, _UFFDIO_CONTINUE, \ > - struct uffdio_continue) > +#define UFFDIO_CONTINUE _IOWR(UFFDIO, _UFFDIO_CONTINUE, \ > + struct uffdio_continue) > > /* read() structure */ > struct uffd_msg { Reviewed-by: Dmitry V. Levin -- ldv