Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3383753pxa; Tue, 25 Aug 2020 21:20:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjH3JleupyeL7C1J269xq71xbVDmrmkj/Ud5B4SoE218UyEswMFOg645gvlxZMaV9Y1n1q X-Received: by 2002:aa7:cccb:: with SMTP id y11mr12646273edt.15.1598415654052; Tue, 25 Aug 2020 21:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598415654; cv=none; d=google.com; s=arc-20160816; b=A6XD6nR0Q1wWJ0TGIlWUmIwyu7G7u9cHcacuW/YjTGMAtweaPq7S75RoUKmb1qBerq gIJh4yMd1r03JefTT01iW+nwwrDwJRP628H2xM8ZbLqQKjJ7ryDLLuIx96WXrXopPX3U HoPrWNWslQw9AcbyhXoFfBn7bQlxKyFIWA4beNZ1yraafWObdWqvVZ5PjbtdRyd+dwTr yYY+2plHr56SzLe15tNj9n8JTh2PE06nXGy2lfY1E2stg3D177GpbGpy70rjr2FsQINC JgSz6C6VyM6BLlqGFB1ReBrs/vVxmyDITlaa3bX20zRw/RPrqUd+C76r8rnqdZEY45rF NXnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:cc:to:from :dkim-signature:dkim-filter; bh=vJGhhWEMdU4RI4OZUZrLMlmVOp+37EnHBm+2cAvft5A=; b=n0IkWLfB00DHLXjV0gyUp6uB6lD0bhU03vKsjjHnU/2k86bEJK8QQJlJ9O03cjSpIt uKSzrmxFiWoyCkZIvVXTRfAxyn/5APCVvxKeRvJHaMIsOc2666kk4pJEq5jlF+mOd6QK UWVbkaGsiBZAENWw3hF+yFSBBb8C2hX+SJJiWT2//5UGjV4sGtIDuant3ot/1e+oYOex SFYF02doS8BZ/MWAKEuHf4cofxsh3wPErkx5z9mPhEUfK0QkEtDxtp1hmEA2evUbj1FN 0DihOOGwcIvzckI8puk15LyXoskWoFws0apcViv/hd8E/pzQ+3YAfJiHsgZdYgU3w0Zj QNCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="ph/ow5Wb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h25si746572eje.30.2020.08.25.21.20.30; Tue, 25 Aug 2020 21:20:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@samsung.com header.s=mail20170921 header.b="ph/ow5Wb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725880AbgHZETO (ORCPT + 99 others); Wed, 26 Aug 2020 00:19:14 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:30916 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbgHZETO (ORCPT ); Wed, 26 Aug 2020 00:19:14 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200826041911epoutp015215fe033bde395e3a568531065b1eb6~utnm2iauG1547915479epoutp01m for ; Wed, 26 Aug 2020 04:19:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200826041911epoutp015215fe033bde395e3a568531065b1eb6~utnm2iauG1547915479epoutp01m DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598415551; bh=vJGhhWEMdU4RI4OZUZrLMlmVOp+37EnHBm+2cAvft5A=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=ph/ow5Wb6ctfebKa9bR+c09dMz9TtuYryQxorG2i2pQNaegLp0iek93i2v+d9lMAq FcA2kzcV1OZ0razWq5DTKtwRCwrm8I/Dw/RqbnEpgGULEuo7cTBDsdTNTuPJTMoLkO q/hDvylasipMBqHVlWVllI/fA7SUBdhUvgjgpGGI= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20200826041911epcas1p19f1533c00e4fc98d69003ca85944f373~utnmSIz332055620556epcas1p1p; Wed, 26 Aug 2020 04:19:11 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.159]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4Bbt0Y5g3pzMqYks; Wed, 26 Aug 2020 04:19:09 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 34.68.28578.DB2E54F5; Wed, 26 Aug 2020 13:19:09 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200826041909epcas1p108db024e965f292c5b479a341bdd76b5~utnkjO58I2055620556epcas1p1l; Wed, 26 Aug 2020 04:19:09 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200826041909epsmtrp1204bee6a4dd0f9a97184e4fc19b014df~utnkimfOJ1440014400epsmtrp1O; Wed, 26 Aug 2020 04:19:09 +0000 (GMT) X-AuditID: b6c32a39-8dfff70000006fa2-91-5f45e2bd5169 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 7E.A1.08303.DB2E54F5; Wed, 26 Aug 2020 13:19:09 +0900 (KST) Received: from namjaejeon01 (unknown [10.88.104.63]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200826041908epsmtip2130885c172cdc3cfaf55c12035ad47be~utnkYYDEN2804828048epsmtip2G; Wed, 26 Aug 2020 04:19:08 +0000 (GMT) From: "Namjae Jeon" To: "'Tetsuhiro Kohada'" Cc: , , , "'Sungjong Seo'" , , In-Reply-To: Subject: RE: [PATCH v3] exfat: integrates dir-entry getting and validation Date: Wed, 26 Aug 2020 13:19:09 +0900 Message-ID: <002e01d67b60$0b7d82a0$227887e0$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQH6G9isXEQ9sMxkt33jRW4ItYjr3QIF0gSvAfjtwRwBp6Lp0QLf0PstAjwGXzkCQUE62QDGw52qqJQvqBA= Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNJsWRmVeSWpSXmKPExsWy7bCmvu7eR67xBqdPaFv8mHubxeLNyaks Fnv2nmSxuLxrDpvF5f+fWCyWfZnMYrHl3xFWB3aPL3OOs3u0Tf7H7tF8bCWbx85Zd9k9+ras YvT4vEkugC0qxyYjNTEltUghNS85PyUzL91WyTs43jne1MzAUNfQ0sJcSSEvMTfVVsnFJ0DX LTMH6BYlhbLEnFKgUEBicbGSvp1NUX5pSapCRn5xia1SakFKToGhQYFecWJucWleul5yfq6V oYGBkSlQZUJOxsWtvxgLLvBXvLyxirWB8RBPFyMnh4SAicS1dxvYQGwhgR2MEqeuAsW5gOxP jBIr1y1ghnA+M0osfrKSBabj4fQmdojELkaJN7fOsUA4LxklDnfMYQKpYhPQlfj3Zz/YXBEB PYmTJ6+zgRQxCzQySSw/8QVoLgcHp4CtxIQOCxBTWMBLYl6vFEg5i4CqRP/ZQ6wgNq+ApcTF 5mfsELagxMmZT8COYBaQl9j+dg4zxEEKEj+fLmO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4LEFNYwEtiXq8USC+LgKpE/9lD rCA2r4ClxMXmZ+wQtqDEyZlPWEBsZgFtiac3n0LZ8hLb385hhjhTQeLn02WsEDckSdxumcgM USMiMbuzjXkCo/AsJKNmIRk1C8moWUhaFjCyrGKUTC0ozk3PLTYsMMpLLdcrTswtLs1L10vO z93ECI4qLa0djHtWfdA7xMjEwXiIUYKDWUmEV/Cic7wQb0piZVVqUX58UWlOavEhRmkOFiVx 3q+zFsYJCaQnlqRmp6YWpBbBZJk4OKUamNxU5UqVPwse3SrdVBHFkZ/DeUl5zvYv2XV1XX9q S1gYQ8KXKVy5cSb2OFtTkQN77VyBF4VeoUFOz3YdfTol6Zh79K4JcbPaVu3+WN9/fauQqvC1 6QfFBMvvFF7TqNftjeq6pRah5j9dsHdPncAdjiRWiTz+3yeM59wMnsu18UDnoxlR5pqpFjIZ twwXncyIWdNf9PWdmffGuWFH3JXv2k0pnDa182g0f6TRQvfuo0s3X1sy/yJXzbkvxbMqu1re +k27PD+Hd79B2cpJuZNCYxoVSu++0T5hsMFYJy1vpp5p7zyO4DWNFl1f0x257H+YRwsopawJ aqvq+VmyJiKmPtb2fJpEnkT78gqp0rNKLMUZiYZazEXFiQCAkxC0GQMAAA== X-CMS-MailID: 20200826041909epcas1p108db024e965f292c5b479a341bdd76b5 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200806010250epcas1p482847d6d906fbf0ccd618c7d1cacd12e References: <20200806010229.24690-1-kohada.t2@gmail.com> <003c01d66edc$edbb1690$c93143b0$@samsung.com> <000001d67787$d3abcbb0$7b036310$@samsung.com> <000101d67b44$ac458c80$04d0a580$@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 2020/08/26 10:03, Namjae Jeon wrote: > >> Second: Range validation and type validation should not be separated. > >> When I started making this patch, I intended to add only range validation. > >> However, after the caller gets the ep, the type validation follows. > >> Get ep, null check of ep (= range verification), type verification is a series of procedures. > >> There would be no reason to keep them independent anymore. > >> Range and type validation is enforced when the caller uses ep. > > You can add a validate flags as argument of exfat_get_dentry_set(), e.g. none, basic and strict. > > none : only range validation. > > basic : range + type validation. > > strict : range + type + checksum and name length, etc. > > Currently, various types of verification will not be needed. > Let's add it when we need it. > > > >>> - /* validiate cached dentries */ > >>> - for (i = 1; i < num_entries; i++) { > >>> - ep = exfat_get_dentry_cached(es, i); > >>> - if (!exfat_validate_entry(exfat_get_entry_type(ep), &mode)) > >>> + ep = exfat_get_dentry_cached(es, ENTRY_STREAM); > >>> + if (!ep || ep->type != EXFAT_STREAM) > >>> + goto free_es; > >>> + es->de[ENTRY_STREAM] = ep; > >> > >> The value contained in stream-ext dir-entry should not be used before validating the EntrySet > checksum. > >> So I would insert EntrySet checksum validation here. > >> In that case, the checksum verification loop would be followed by the > >> TYPE_NAME verification loop, can you acceptable? > > Yes. That would be great. > > OK. > I'll add TYPE_NAME verification after checksum verification, in next patch. > However, I think it is enough to validate TYPE_NAME when extracting name. > Could you please tell me why you think you need TYPE_NAME validation here? I've told you on previous mail. This function should return validated dentry set after checking file->stream->name in sequence. > > > BR > --- > Tetsuhiro Kohada > >