lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e7b2c58-0bb4-e008-a157-3d83ac33bf81@linux.alibaba.com>
Date:   Tue, 30 May 2023 11:42:55 +0800
From:   Jingbo Xu <jefflexu@...ux.alibaba.com>
To:     Gao Xiang <hsiangkao@...ux.alibaba.com>, xiang@...nel.org,
        chao@...nel.org, huyue2@...lpad.com, linux-erofs@...ts.ozlabs.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/5] erofs: introduce erofs_xattr_iter_fixup_aligned()
 helper



On 5/29/23 3:41 PM, Gao Xiang wrote:
> Hi,
> 
> On 2023/5/18 10:45, Jingbo Xu wrote:
>> Introduce erofs_xattr_iter_fixup_aligned() helper where
>> it.ofs <= EROFS_BLKSIZ is mandatory.
>>
>> Signed-off-by: Jingbo Xu <jefflexu@...ux.alibaba.com>
>> ---
>>   fs/erofs/xattr.c | 79 +++++++++++++++++++++---------------------------
>>   1 file changed, 35 insertions(+), 44 deletions(-)
>>
>> diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c
>> index bbfe7ce170d2..b79be2a556ba 100644
>> --- a/fs/erofs/xattr.c
>> +++ b/fs/erofs/xattr.c
>> @@ -29,6 +29,28 @@ struct xattr_iter {
>>       unsigned int ofs;
>>   };
>>   +static inline int erofs_xattr_iter_fixup(struct xattr_iter *it)
>> +{
>> +    if (it->ofs < it->sb->s_blocksize)
>> +        return 0;
>> +
>> +    it->blkaddr += erofs_blknr(it->sb, it->ofs);
>> +    it->kaddr = erofs_read_metabuf(&it->buf, it->sb, it->blkaddr,
>> EROFS_KMAP);
> 
> could we use a new buf interface to init_metabuf at once?

As discussed offline, I think the following unified API is preferred:

```
int erofs_xattr_iter_fixup(struct xattr_iter *it, bool nospan)

{
    if (it->ofs < it->sb->s_blocksize)
        return 0;

    if (nospan && it->ofs != it->sb->s_blocksize) {
	DBG_BUGON(1);
	return -EFSCORRUPTED;
    }

    ...
}
```

-- 
Thanks,
Jingbo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ