Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp3053190pxy; Wed, 4 Aug 2021 00:43:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNYsWWTe3oiEZOL2xfE6KsAVM9bHXUt5ePlogOp3vhw8iF8qxOT6vP541v9vgR4mq6AWCP X-Received: by 2002:a05:6402:1c83:: with SMTP id cy3mr31273841edb.231.1628062985830; Wed, 04 Aug 2021 00:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628062985; cv=none; d=google.com; s=arc-20160816; b=zlfUU3QzkAGxEXqdTBmuC4vfsKT/KuKbz6oNv1AMm/9v7O+kxjPbfnsy0h4In0pd6O 5kR2GxAcA1YD69XeQnxzCd8AUppnfCXC4KbRNvEAy/ofu0hCXivET7rcoZ4AI0TDzFc7 +JX58AzTwTDVLepwce/Fl7W/uV12AzzN0GARAJ+RNm0f90+HiU8fO0vetCYAaMTzia6J S0dGSK6GFFuxH4TvGne4CxiK+T11g3AGDgaGYoKzTHyzTzcgLycByP4obxVzpLGisZZN Zvlx3YCD+vA8ma66aisK3MqC+o2RCsiX8GLgLEG1swUMwniGeeVFyS4YZUEYIek0Mrz6 6zog== 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=ufsAD/3Qdi1T2HB3quxBOdR/T1U1h8GciPGwUgTjHCI=; b=bscM7iWvihd6gUwjh4V31cmqwr2yfbEXWqtVoPX+SvW501DBL2wjYV2x+ilFUfyCFH wlNtGAkO4MhmRF3YuGSp3EMiSrnD8Ogx0/0YOkqCaJbjJYeQepNgMmEdt/EwnQZpnclm ZPhB/lUolHCv27/MWmqlFtFJBXeYBWKFgcrlvpdVhLmfPKmb9xWCQKTHq3xYPaBdJnG8 9UPBdUSYNDFRrYLAlO35RzFEtK+SBCy9Kql5WoA/LBckz30DIAd5mG5X6Ykz3+ZvvaWh Qm4ZdQpdfcZEHw4OJhoWCHKtsubbJTboDDY4oV27w0+xny9dHm526D15Ipfi6XFnx5XD H0rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qqocDoGS; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si523976edx.601.2021.08.04.00.42.33; Wed, 04 Aug 2021 00:43:05 -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=@google.com header.s=20161025 header.b=qqocDoGS; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235717AbhHDHk0 (ORCPT + 99 others); Wed, 4 Aug 2021 03:40:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235619AbhHDHkZ (ORCPT ); Wed, 4 Aug 2021 03:40:25 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7970C0613D5 for ; Wed, 4 Aug 2021 00:40:13 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id l19so1806953pjz.0 for ; Wed, 04 Aug 2021 00:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ufsAD/3Qdi1T2HB3quxBOdR/T1U1h8GciPGwUgTjHCI=; b=qqocDoGSTbG1vEp6u73Alx+v/Hts8tf3aADkUHdMUM+qdnPusHXtBXwz5UV8Bi5Aay MSEByll6Ne+XnITdf9lRuktuFv/jdget/bDiltssjlXsx/jrlw+jCTSIIeVRY4AOpqI3 P2dCZXuVbafOx2LGtlpLd9cN0Cl5xGApnS0hmc6LQfolI/ZC/9GKJ4IcSIjsc1L/15Pe i6cDkHrVV4jTL5IMqziWgBynBnEYLKFnDlmRZAiSTeqfukID/SgYlMunruRg3tZkAkst OqaLbg+3MxBJbCZaKKu+UJTMxEkhpYXd86wtoHGMmox5mLIlrhZxYsmiUQGH232D1+n+ oyWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ufsAD/3Qdi1T2HB3quxBOdR/T1U1h8GciPGwUgTjHCI=; b=GRFZ3b1eMFyQYt9YQZvyJlsby9PhtiFhJAKtt/v9XeMc2/s8YPqrAYnbIwvHs+Fx/G yX8+IEeogN4eM4wRPbgPd5l6Iob4s6ev3GLCyC4DuETBXRNJ/sFPXAS4S295sqVqkWKQ mvah+RVg1noCJTkcfPPhCYA1MPibtd+HfwiXQoelFR4bktsuQcT088M3i9ObiLdsWECY pf/opd5xXGxI8ljbOsqMwrN9ef6MABTi5U76v7nQjEicCzgTCmG3xO8MwanWp0Dth0YH tXMnhIcAoeq/GjC6UAME3+Spy+cxLxK17NNWyFqhirdStnBgUxw2GZViFNitWekVrNHR b/Eg== X-Gm-Message-State: AOAM531OW8c1N80tOxa7wWMXsVctweTn9Egba86ki7TLQUF22K5vRMrU sxBeCbvCpfwRIBAFyFn5gM2YCw== X-Received: by 2002:a62:8643:0:b029:3b1:a6ee:196 with SMTP id x64-20020a6286430000b02903b1a6ee0196mr23380719pfd.13.1628062813093; Wed, 04 Aug 2021 00:40:13 -0700 (PDT) Received: from google.com ([2401:fa00:9:211:7ff1:360d:6b2e:2bd2]) by smtp.gmail.com with ESMTPSA id r18sm2164903pgk.54.2021.08.04.00.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 00:40:12 -0700 (PDT) Date: Wed, 4 Aug 2021 17:40:00 +1000 From: Matthew Bobrowski To: krisman@collabora.com Cc: amir73il@gmail.com, LTP List , Jan Kara , Ext4 , Khazhismel Kumykov , kernel@collabora.com Subject: Re: [PATCH 3/7] syscalls/fanotify20: Validate incoming FID in FAN_FS_ERROR Message-ID: References: <20210802214645.2633028-1-krisman@collabora.com> <20210802214645.2633028-4-krisman@collabora.com> <87fsvphksu.fsf@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Aug 04, 2021 at 08:39:55AM +0300, Amir Goldstein wrote: > On Wed, Aug 4, 2021 at 7:54 AM Gabriel Krisman Bertazi > wrote: > > > > Amir Goldstein writes: > > > > > On Tue, Aug 3, 2021 at 12:47 AM Gabriel Krisman Bertazi > > > wrote: > > >> > > >> Verify the FID provided in the event. If the testcase has a null inode, > > >> this is assumed to be a superblock error (i.e. null FH). > > >> > > >> Signed-off-by: Gabriel Krisman Bertazi > > >> --- > > >> .../kernel/syscalls/fanotify/fanotify20.c | 51 +++++++++++++++++++ > > >> 1 file changed, 51 insertions(+) > > >> > > >> diff --git a/testcases/kernel/syscalls/fanotify/fanotify20.c b/testcases/kernel/syscalls/fanotify/fanotify20.c > > >> index fd5cfb8744f1..d8d788ae685f 100644 > > >> --- a/testcases/kernel/syscalls/fanotify/fanotify20.c > > >> +++ b/testcases/kernel/syscalls/fanotify/fanotify20.c > > >> @@ -40,6 +40,14 @@ > > >> > > >> #define FAN_EVENT_INFO_TYPE_ERROR 4 > > >> > > >> +#ifndef FILEID_INVALID > > >> +#define FILEID_INVALID 0xff > > >> +#endif > > >> + > > >> +#ifndef FILEID_INO32_GEN > > >> +#define FILEID_INO32_GEN 1 > > >> +#endif > > >> + > > >> struct fanotify_event_info_error { > > >> struct fanotify_event_info_header hdr; > > >> __s32 error; > > >> @@ -57,6 +65,9 @@ static const struct test_case { > > >> char *name; > > >> int error; > > >> unsigned int error_count; > > >> + > > >> + /* inode can be null for superblock errors */ > > >> + unsigned int *inode; > > > > > > Any reason not to use fanotify_fid_t * like fanotify16.c? > > > > No reason other than I didn't notice they existed. Sorry. I will get > > this fixed. > > No problem. That's what review is for ;-) > > BTW, unless anyone is specifically interested I don't think there > is a reason to re post the test patches before the submission request. > Certainly not for the small fixes that I requested. > > I do request that you post a link to a branch with the fixed test > so that we can experiment with the kernel patches. > > I've also CC'ed Matthew who may want to help with review of the test > and man page that you posted in the cover letter [1]. I'll get around to going through both the LTP and man-page series by the end of this week. Feel free to also loop me in directly on any subsequent iterations of the like. /M