Re: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-27 Thread Tetsuhiro Kohada
- /* 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->typ

RE: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-26 Thread Namjae Jeon
> Thank you for quick reply! > > On 2020/08/26 13:19, Namjae Jeon wrote: > >> 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. > Howeve

Re: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-25 Thread Tetsuhiro Kohada
Thank you for quick reply! On 2020/08/26 13:19, Namjae Jeon wrote: 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

RE: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-25 Thread Namjae Jeon
> 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

Re: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-25 Thread Tetsuhiro Kohada
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 verificati

RE: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-25 Thread Namjae Jeon
> 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 > ser

Re: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-25 Thread Tetsuhiro Kohada
I prefer to assign validated entries to **de and use it using enum value. struct exfat_dentry **de; I've tried several implementations that add a struct exfat_dentry type.(*de0 & *de1; *de[2]; etc...) The problem with the struct exfat_dentry type is that it is too flexible for type

RE: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-20 Thread Namjae Jeon
> Thank you for your reply. > > >> @@ -171,7 +174,9 @@ struct exfat_entry_set_cache { > >>unsigned int start_off; > >>int num_bh; > >>struct buffer_head *bh[DIR_CACHE_SIZE]; > >> - unsigned int num_entries; > >> + int num_entries; > >> + struct exfat_de_file *de_file; > >> + stru

Re: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-12 Thread Tetsuhiro Kohada
Thank you for your reply. @@ -171,7 +174,9 @@ struct exfat_entry_set_cache { unsigned int start_off; int num_bh; struct buffer_head *bh[DIR_CACHE_SIZE]; - unsigned int num_entries; + int num_entries; + struct exfat_de_file *de_file; + struct exfat_

RE: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-09 Thread Namjae Jeon
> > +#define TYPE_PRIMARY (TYPE_CRITICAL_PRI | TYPE_BENIGN_PRI) > +#define TYPE_SECONDARY (TYPE_CRITICAL_SEC | TYPE_BENIGN_SEC) > + > #define MAX_CHARSET_SIZE 6 /* max size of multi-byte character */ > #define MAX_NAME_LENGTH 255 /* max len of file name exc

RE: [PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-08 Thread Sungjong Seo
> Add validation for num, bh and type on getting dir-entry. > Renamed exfat_get_dentry_cached() to exfat_get_validated_dentry() due to a > change in functionality. > > Integrate type-validation with simplified. > This will also recognize a dir-entry set that contains 'benign secondary' > dir-entri

[PATCH v3] exfat: integrates dir-entry getting and validation

2020-08-05 Thread Tetsuhiro Kohada
Add validation for num, bh and type on getting dir-entry. Renamed exfat_get_dentry_cached() to exfat_get_validated_dentry() due to a change in functionality. Integrate type-validation with simplified. This will also recognize a dir-entry set that contains 'benign secondary' dir-entries. Pre-Valid