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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7f2500d-75db-4baa-9d87-07346839478d@igalia.com>
Date: Tue, 5 Aug 2025 10:01:25 -0300
From: André Almeida <andrealmeid@...lia.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Miklos Szeredi <miklos@...redi.hu>, Amir Goldstein <amir73il@...il.com>,
 Theodore Tso <tytso@....edu>, Gabriel Krisman Bertazi <krisman@...nel.org>,
 linux-unionfs@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-fsdevel@...r.kernel.org, Christian Brauner <brauner@...nel.org>,
 Jan Kara <jack@...e.cz>, kernel-dev@...lia.com
Subject: Re: [PATCH RFC v2 2/8] ovl: Create ovl_strcmp() with casefold support

Em 05/08/2025 02:08, Al Viro escreveu:
> On Tue, Aug 05, 2025 at 12:09:06AM -0300, André Almeida wrote:
> 
>> +static int ovl_strcmp(const char *str, struct ovl_cache_entry *p, int len)
> 
>> +	if (p->map && !is_dot_dotdot(str, len)) {
>> +		dst = kmalloc(OVL_NAME_LEN, GFP_KERNEL);
> 
> ...`
> 
>> +	kfree(dst);
>> +
>> +	return cmp;
>> +}
>> +
> 
>> @@ -107,7 +145,7 @@ static struct ovl_cache_entry *ovl_cache_entry_find(struct rb_root *root,
>>   	while (node) {
>>   		struct ovl_cache_entry *p = ovl_cache_entry_from_node(node);
>>   
>> -		cmp = strncmp(name, p->name, len);
>> +		cmp = ovl_strcmp(name, p, len);
>>   		if (cmp > 0)
>>   			node = p->node.rb_right;
>>   		else if (cmp < 0 || len < p->len)
> 
> Am I misreading that, or do really we get a kmalloc()/kfree() for each
> sodding tree node we traverse on rbtree lookup here?

Yes, this is what's implemented here, as it is. Alternatively, I could 
allocate one buffer prior to the rbtree search/insert to be reused, and 
free it later... I going to add that for the v3.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ