Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp81268pxh; Thu, 7 Apr 2022 14:39:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpBx0UvkuB+LQdgTh95khr+JJ90Wkp42d3T7tiwfTa4A53oLzYinVoMKEsfbCclAlIG/r1 X-Received: by 2002:a17:902:aa8b:b0:156:c639:7283 with SMTP id d11-20020a170902aa8b00b00156c6397283mr15915020plr.13.1649367553850; Thu, 07 Apr 2022 14:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649367553; cv=none; d=google.com; s=arc-20160816; b=lSPCO8EocUBZHlFbAwOSQwAUJt5jYWEyQ4I8dfWyaMgBk19L7mbNbn+KbWc69iH6Id 9h8qOPaEpoCcahyODh9VMLe/3GONYcyrE0KmZG8RDPzHwkMGp5qdVYGDYISxoizBNqzC mgbzPXzD5DcTfR5iSLDKQw3/d2CuapncnixNyt1CTJhYgenlBfiQiTHdFysh+i+Vj1g9 4qcip5SAwpQwg4rlGTkYhlpDdho5B1chpmtwTovSnhWiaVliPYgClFhCU7k+KaPTVm+G zfNNSxOWdimNYYNofXDP+2TJDlQnXt0LdwY9cNBLVfyNW12AsSiPzgGkt/kQEoYwyO5A E73g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mmcWlJ84YViN+zBz2iaDU/q++aTCp0s9uGL/kCZwrVA=; b=PPtSUCoTFiAFI9wnrmiwTBuTPv/ulXL2QM59ps9SC4HdQ8bp0jpAfs0bk07iN+TnQl QONUG4B/MQUhZ7Dv5H4rszGF4yJZSCNFmPcPRfmwKkdVpe6fZQg78DZraekIUUuuVq4C kkO1JkWDS/3V1qwJxz3X0lj3ZNKeA6PhbbePmNcayXFlOqAGM20DZdWQWiU6L2+S6D9f C1YY3XGx0zpU6o7RDEzcAD4XMnjsKHaWeum+F/w2h+j2CLaFU08nHtkmBO4lTBkYtqXC AkjS2gZZSWw0BY2oY3d+aYB4FebDGxUWOzfreb++wEH61NImp8qVh9BlngvAIL4X1wpZ hHwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=UINhBf9l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h12-20020a170902748c00b00156701abd74si771334pll.215.2022.04.07.14.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 14:39:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=UINhBf9l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5FE851DA57; Thu, 7 Apr 2022 13:52:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230310AbiDGUyg (ORCPT + 99 others); Thu, 7 Apr 2022 16:54:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231330AbiDGUyY (ORCPT ); Thu, 7 Apr 2022 16:54:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16582F8455; Thu, 7 Apr 2022 13:50:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3A4BE61F7C; Thu, 7 Apr 2022 20:50:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68752C385A8; Thu, 7 Apr 2022 20:50:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1649364654; bh=1vFrHO/IV/OlcF4Lq304ipCo0E3OpEp58N3JX16PGRQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UINhBf9lLNG+xMtTtcUk2JIJy6jl18do1S006ZOXeNJ/aeVS8b7KCqu5js3b8QA3f euuuTPkACA2sC1+9nSZ/+PfYBJC8EUYQBIQ59JTcnJpO5yhXHjYWkmZMEPLu5X4kt/ iRDaLH5yWwNaZ7VE7b1Abi+93mDrdpBLDac9EyYI= Date: Thu, 7 Apr 2022 13:50:53 -0700 From: Andrew Morton To: Axel Rasmussen Cc: Matthew Wilcox , Mike Rapoport , Linux MM , LKML , stable@vger.kernel.org Subject: Re: [PATCH] mm/secretmem: fix panic when growing a memfd_secret Message-Id: <20220407135053.6652bdad545fe98fc9babfbc@linux-foundation.org> In-Reply-To: References: <20220324210909.1843814-1-axelrasmussen@google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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, 31 Mar 2022 10:42:12 -0700 Axel Rasmussen wrote: > Any strong opinions on which error code is used? I think overall I > would still pick EOPNOTSUPP, but happy to change it if anyone feels > strongly. > > - I think ENOSYS is specific to syscall nr not defined > - I think ENOTTY is specific to ioctls > - The kernel (sort of mistakenly) defines ENOTSUPP instead of ENOTSUP, > but it's marked deprecated and it's recommended to use EOPNOTSUPP > instead (despite POSIX saying these should be distinct and for > different uses). `man ftruncate' sayeth EINVAL The argument length is negative or larger than the maximum file size. which reasonably accurately describes what we're doing here? + if ((ia_valid & ATTR_SIZE) && inode->i_size) + return -EOPNOTSUPP;