Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp250033rwl; Thu, 30 Mar 2023 15:29:47 -0700 (PDT) X-Google-Smtp-Source: AKy350YUHFUdx1M668IZOzNYrOxnR76mRPr2nAuZHHy30E7o7cRfSVuJGWFztlibw+SIWhkOqCcV X-Received: by 2002:a17:90a:bc83:b0:23f:6872:e37c with SMTP id x3-20020a17090abc8300b0023f6872e37cmr3775347pjr.0.1680215387082; Thu, 30 Mar 2023 15:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680215387; cv=none; d=google.com; s=arc-20160816; b=ISVbzPwsWE5Ep03DIrSP0MVdIUC93PEr8+L9UjO45gbm/zJ2GrdgibpX7adVHjC2SH dMKyeP2xNTLUg2DJmx6lrlPHP25PfhCBEELwWdkYyyW9E/OwU57d2LajBFtB9vM/t69u Mp9um6qPMaVoxSldB6PyG+CicCUHwFKRMcvzrr53YsoQMHtjVRiVNDuxB/jFmkSUOBAU 7AdcK/VYHI/i8N5wHe5NcKoiuLGpOBH3Sz+T7NuuQ0qkbKMurRuALIV877q70QkeZ62o QP4ryTAM+dwYuKzx36l856LvB/xYWK9Eqx/Mrela7JXdnMGw0+kuEnPkG7y0B66j1bwM Ry7A== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Yrg7gd+3buI58FtTknCRM1CGb3Q5tRIhU3QrztqGTxw=; b=RtO6Xo4S/n3/9zx6pfiZg25mNmgL6BT38D/Qm8AgeiN/A4HdDwKSpmoJbETSLrYE9z ZqOg5vaqtSBKfrVaTi4OcB2PH6xCVzF8v9lpdnIPOh56fvK4hsKmcjblY4o5vzWaQzKD 3ZkN4uGtaknK1VDREpEjDLAIzRociI4mQaGqgKCcflZ/tEWwLrRJibD1fFkjuRBKFrDm 17jLywtbw0B6AWrFY4zCizF0aJeHo9FPKEO2W7a9pJHV5rUNiM0S2043Sev4CapOjCpn Nc7ztCRaxCkWg37PwrOEPZkz1CwVHS6+vBqs+6uOx7DUBZUhY+TlXsXrrWse8opr5whB /Qcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NsuuR3VE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a17090adc0500b0023a6f4e0510si4972732pjv.155.2023.03.30.15.29.35; Thu, 30 Mar 2023 15:29:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NsuuR3VE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229663AbjC3W2F (ORCPT + 99 others); Thu, 30 Mar 2023 18:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbjC3W2A (ORCPT ); Thu, 30 Mar 2023 18:28:00 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6CA0CA30 for ; Thu, 30 Mar 2023 15:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680215231; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yrg7gd+3buI58FtTknCRM1CGb3Q5tRIhU3QrztqGTxw=; b=NsuuR3VET14lycej3l6vBMjEXFtN7mI/tUCi22BgpXZQGzglFwAF3l6qMaaR8O2ktng2J3 5sXI1Itbs0QP/+U8GUo+DNJ3DK0QHqOq5Op8WMSAc3sckvrZYBnFUtINWCyt5XTgk9iHqA Pu5w4t1FSZHSxh2iW7wCFhEPqg8B4yQ= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-364-uRFbNsv1MC2DVtLu_RWfiQ-1; Thu, 30 Mar 2023 18:27:10 -0400 X-MC-Unique: uRFbNsv1MC2DVtLu_RWfiQ-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-746bae78af3so65343785a.1 for ; Thu, 30 Mar 2023 15:27:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680215230; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Yrg7gd+3buI58FtTknCRM1CGb3Q5tRIhU3QrztqGTxw=; b=Tlax2061I3Eb91Jrdkush7IaVO/2pfLBLBPOKP0LDN2UD+re5rezkcT48V2gMdyTjA TLwb5IW7loXomniE+GAorXgI2wHKcuxwyFJYzYpiXZdPLZSsR9wj5fvyg2DXOgX4XqsD RFGCwljC9MmrNwYXl1z1kUcbxeYwSYoe7Lb8OtfQXMIg0BLrHgwBFieEM6WSxOjAoT9E rPjcJ+WZ5hNQfs58PYlqkK39szEjyCJpI1TkBASRBSCMvmrmNDeYFdXas4af/UKqleTS Cz5cV/Cw5m+IPxnFkZPDizMzOeOpTMET+nLq07hpPDkNuKIUNDL5Cc5qM+8/OcddxJZK uOwQ== X-Gm-Message-State: AAQBX9fsOuQ/37etkf/qxGAT8/FHKo8IsO237PEF9fEJy5XXhz7N96Pd 4RvPkkLIJBqF0/eGqEh8y+qhZZJGeoNfNyMjmN2TNszscnOV3xPs2tjoqf0WO8MDz7++NC7bXXn Cr0nCPIEk0we+THLxCcnci+fT X-Received: by 2002:a05:622a:1a0a:b0:3e3:7ed0:d6df with SMTP id f10-20020a05622a1a0a00b003e37ed0d6dfmr6427796qtb.6.1680215229921; Thu, 30 Mar 2023 15:27:09 -0700 (PDT) X-Received: by 2002:a05:622a:1a0a:b0:3e3:7ed0:d6df with SMTP id f10-20020a05622a1a0a00b003e37ed0d6dfmr6427778qtb.6.1680215229676; Thu, 30 Mar 2023 15:27:09 -0700 (PDT) Received: from x1n (bras-base-aurron9127w-grc-40-70-52-229-124.dsl.bell.ca. [70.52.229.124]) by smtp.gmail.com with ESMTPSA id k19-20020ac84753000000b003dffd3d3df5sm191625qtp.2.2023.03.30.15.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 15:27:09 -0700 (PDT) Date: Thu, 30 Mar 2023 18:27:07 -0400 From: Peter Xu To: Axel Rasmussen Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Kravetz , Andrew Morton , Andrea Arcangeli , Mike Rapoport , Nadav Amit , Leonardo Bras Soares Passos , David Hildenbrand , linux-stable Subject: Re: [PATCH 01/29] Revert "userfaultfd: don't fail on unrecognized features" Message-ID: References: <20230330155707.3106228-1-peterx@redhat.com> <20230330155707.3106228-2-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 30, 2023 at 12:04:09PM -0700, Axel Rasmussen wrote: > On Thu, Mar 30, 2023 at 8:57 AM Peter Xu wrote: > > > > This is a proposal to revert commit 914eedcb9ba0ff53c33808. > > > > I found this when writting a simple UFFDIO_API test to be the first unit > > test in this set. Two things breaks with the commit: > > > > - UFFDIO_API check was lost and missing. According to man page, the > > kernel should reject ioctl(UFFDIO_API) if uffdio_api.api != 0xaa. This > > check is needed if the api version will be extended in the future, or > > user app won't be able to identify which is a new kernel. > > 100% agreed, this was a mistake. > > > > > - Feature flags checks were removed, which means UFFDIO_API with a > > feature that does not exist will also succeed. According to the man > > page, we should (and it makes sense) to reject ioctl(UFFDIO_API) if > > unknown features passed in. > > I still strongly disagree with reverting this part, my feeling is > still that doing so makes things more complicated for no reason. > > Re: David's point, it's clearly wrong to change semantics so a thing > that used to work now fails. But this instead makes it more permissive > - existing userspace programs continue to work as-is, but *also* one > can achieve the same thing more simply (combine probing + > configuration into one step). I don't see any problem with that, > generally. > > But, if David and others don't find my argument convincing, it isn't > the end of the world. It just means I have to go update my userspace > code to be a bit more complicated. :) I'd say it's fine if it's your own program that you can in full control easily. :) Sorry again for not noticing that earlier. There's one reason that we may consider keeping the behavior. IMHO it is when there're major softwares that uses the "wrong" ABI (let's say so; because it's not following the man pages). If you're aware any such major softwares (especially open sourced) will break due to this revert patch, please shoot. > > I also still think the man page is incorrect or at least incomplete no > matter what we do here; we should be sure to update it as a follow-up. So far it looks still fine if with this revert. Maybe I overlooked somewhere? I'll add this into my todo, but with low priority. If you have suggestion already on how to improve the man page please do so before me! -- Peter Xu