Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1885706rdb; Sat, 2 Dec 2023 13:29:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeVQPcFomIR4ACXLMR7Te+NXFCSd793dkCMQqMpPeBEZ25bcFFhdgWfKv31MZGTt9U0lnn X-Received: by 2002:a17:902:b414:b0:1d0:6ffd:6105 with SMTP id x20-20020a170902b41400b001d06ffd6105mr1569851plr.39.1701552549787; Sat, 02 Dec 2023 13:29:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701552549; cv=none; d=google.com; s=arc-20160816; b=Ow1cyxmISlEPVM/uvmLDRan8J+XCVWTEBf4xxw3a6Mi13UfsAh9ZaufxLO+UsDn23f QG/DmvhkD0EjUAgObgsTmI1pdiZDyP7HnMHfpcxNerTmxlyQXwI+IhQCFa9/U4QfJCIr SCioTB/TqkpE/LXn8IDcL/Rdqgvr5gztj8G90Y3EHZVXWfuz3zSmXBmTU3bYWnAf0Be4 6ZmbYglZTPBdhA9EYuRLrTlFHSQON6avrYXa+D0WSuNZTflxRktH5CmXDYKxSSSyZHgp vsBv6p/zx4aLKPtyUXDoueM043QkuEuGRlpqWi9wyr2dAOftdTaISYLxiteTpCILhS8u jMpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mzmbYFT6eXgeUvFzA1AjZh/++WkproRxrIlBwE1gCY0=; fh=FF1Fm43wjDVBknCypeo6GYbgR2lUx2vVEAg8epl3//0=; b=veN42b8SBMkIHZzWc8kGDkynI/FoOvlX6BtUMyb++eB3aZp1nkRLH5A7Az9aSecndj 70IgFOLf9TOOFBMvhhuYu9Hlk6Peui+wBzf14/ZSU77tlOZ2nZr4zZfMJXpLa66yfnoy 4bJXDFHgYWYlRC2aUqdUFWYPZcLmqkmmy7u311Dum2nkFe9KOHC2BxRkzsvejZzzsj8d tm3cXQtd8MTvqRNMHZ+ph7UkgKSxk4DmyzIuWfqFNytqFF+Bt3GMkzFmv6mp0FQ6uwOe Blhzw9YXv/Yn/og7fdReVqKrRv8UB3S+sjJg4iEiz+qDBHesPGA40vZyDPDlVPrS8Ew0 IGJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=L00IxRP0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id h6-20020a170902704600b001c3411c9b83si5358099plt.454.2023.12.02.13.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 13:29:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=L00IxRP0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7F91480C5CA8; Sat, 2 Dec 2023 13:29:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229531AbjLBV2x (ORCPT + 99 others); Sat, 2 Dec 2023 16:28:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjLBV2w (ORCPT ); Sat, 2 Dec 2023 16:28:52 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4F1BE5; Sat, 2 Dec 2023 13:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mzmbYFT6eXgeUvFzA1AjZh/++WkproRxrIlBwE1gCY0=; b=L00IxRP0LYY+aPJJMHp1lU47ZA J176Pu7GbGT10FCC346cVLmX3g4rokO0HR8qfU7qotr7mZRJxwPbvsTyIGYtKqUjjY6C63yY4Jke0 Yytq/fZRQsrgejmnx9MZDzaUzJuZ/SkWZ44LwDPyeWhEtGySoc/T/EWn8uCH2HvyFGjz/SsJqXTlJ 51L/vgsBow83BFz5+SBn8AQpHa5PE31NM3JiuftoaVkYrOsK5SZaA0uqdoMDGhFkSs68EWHG5IjDI Ja6wcomXEuo3azj/d/V5rZFelUc41t3Vfy9vL5qf5O6FOnJPAmn7dTkYCjhlcQD8ft6zLjVDRmTp8 ACZNl36A==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1r9XXa-006Nv1-0M; Sat, 02 Dec 2023 21:28:46 +0000 Date: Sat, 2 Dec 2023 21:28:46 +0000 From: Al Viro To: Kees Cook Cc: "Guilherme G. Piccoli" , Christian Brauner , Peter Zijlstra , linux-fsdevel@vger.kernel.org, Tony Luck , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 3/5] fs: Add DEFINE_FREE for struct inode Message-ID: <20231202212846.GQ38156@ZenIV> References: <20231202211535.work.571-kees@kernel.org> <20231202212217.243710-3-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231202212217.243710-3-keescook@chromium.org> Sender: Al Viro X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 02 Dec 2023 13:29:07 -0800 (PST) On Sat, Dec 02, 2023 at 01:22:13PM -0800, Kees Cook wrote: > Allow __free(iput) markings for easier cleanup on inode allocations. NAK. That's a bloody awful idea for that particular data type, since 1) ERR_PTR(...) is not uncommon and passing it to iput() is a bug. 2) the common pattern is to have reference-consuming primitives, with failure exits normally *not* having to do iput() at all. Please, don't.