Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4724538pxv; Tue, 6 Jul 2021 07:44:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs187XCgIbM9aOVW7VOdudUldIi7Rr3JMQ55is27/xQyZVWeZcOA1EmavWZqiAdDfu2BNL X-Received: by 2002:a17:906:38c6:: with SMTP id r6mr18617253ejd.411.1625582641948; Tue, 06 Jul 2021 07:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625582641; cv=none; d=google.com; s=arc-20160816; b=DV3r8nWE+BI2gbe4klO2Zt4YTXvsWSvZ8igERsi1W1pr+xtgW/tDGyG3zv9sta+ncb +oz1P3mZHgNbFgBoH7XI0AGnhtyDPTu7SrtDrSj7t6wtrDfd78+14RzZDV0spypYENBQ 0sFIsVK7XKJvljT3ng/TUZLuKy2Ca0tP8I7Zf6YmCt9xu0to0naqU/IugVMjdu+Gth8q MMd/6aq6dX3bPH/1XPyTlkNXFAbZE3saVv7dv7e0lJFQ7X2w9G9M3SCAgnbJhX0QIuV3 EDhRSfz7Zwhu4oyBVjGib9xwHRkyMPsYh145i5hpRjXNvHKFob1CUUG3WmVvthsfL7In +0vQ== 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:dkim-signature; bh=YWMgMiz0NSkHLipT1VEThA/f8vA9y3xyiRXKfliC2FQ=; b=f7ITvKcmTjT1FMotKKgtHwzgbiJ/V2JBJc0z4UcAOyzh1N32fuRy1WUeEBrl5+TpD4 T2ljw9tkPwvAGcURnXwyww3hMeCUJ+7ToRA1Y6qm535828NEWwYu3Svstee7V4U5UtBL D59163RhK+D2qKZaRvrbDnSKxEueotPtdjpm/fbXp6cDGHgHgR8csFHESyaweCznBxqy hBp86TXwoFUdeIP45cz6XgLY2b3ryiYmmsuTsGvS4szoAt6rInWWZNdBUqT46Rs0gPcJ FTa2mjrx3bzYqEeh4LT4An/kU5Jk1XUoG+nJXEqWogjdMo48/zxx4OMGOsAmiNRhYRQu eucg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eEJjo64t; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 kj20si553478ejc.213.2021.07.06.07.43.38; Tue, 06 Jul 2021 07:44:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eEJjo64t; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232686AbhGFOqH (ORCPT + 99 others); Tue, 6 Jul 2021 10:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232944AbhGFOqA (ORCPT ); Tue, 6 Jul 2021 10:46:00 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B622C0613AC; Tue, 6 Jul 2021 07:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YWMgMiz0NSkHLipT1VEThA/f8vA9y3xyiRXKfliC2FQ=; b=eEJjo64t1w7GzXpO1lD11M1r9W WPXSlO2KDH2Ib31wkN3RlL5OYWPdWaCfIEcbv6aUwwRwvyz3FloDabCdqH6JxLfsWDuFdBY2ZJc4T hXdxbvTiMvizZLyP71NAio0S8il8w1mNBOlxBsHPoT5TAuwyQjopHfQWCbqve7XkVrIhvnumyY1g5 BClgKyBxQBK582tIev0TvyGSblgulZfmIf5irTzOU4rsWtOKhEf9aQL/+JiM9FwECdCMXdRV+JaIJ HJE5Qykdn8CIfeRDVmEbysxhW8fE/Gurc3ZJ47TEUDi6YORm/yzPsQ8jPTanei8ivUNU4In0eZWDT RPiEPZMw==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0lVI-00BRAt-Cl; Tue, 06 Jul 2021 13:52:50 +0000 Date: Tue, 6 Jul 2021 14:52:48 +0100 From: Christoph Hellwig To: Wang Shilong Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH v3] fs: forbid invalid project ID Message-ID: References: <20210702140243.3615-1-wangshilong1991@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210702140243.3615-1-wangshilong1991@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org > diff --git a/fs/ioctl.c b/fs/ioctl.c > index 1e2204fa9963..d7edc92df473 100644 > --- a/fs/ioctl.c > +++ b/fs/ioctl.c > @@ -806,6 +806,8 @@ static int fileattr_set_prepare(struct inode *inode, > if (err) > return err; > > + if (!projid_valid(make_kprojid(&init_user_ns, fa->fsx_projid))) > + return -EINVAL; > /* And empty line before the comment would be nice for readability. Otherwise looks good: Reviewed-by: Christoph Hellwig