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: <40182b31-95ad-4825-9c0c-0127be1734a6@cachyos.org>
Date: Tue, 8 Apr 2025 12:39:25 +0800
From: Eric Naim <dnaim@...hyos.org>
To: Vlastimil Babka <vbabka@...e.cz>, Suren Baghdasaryan <surenb@...gle.com>,
 akpm@...ux-foundation.org
Cc: peterz@...radead.org, willy@...radead.org, liam.howlett@...cle.com,
 lorenzo.stoakes@...cle.com, mhocko@...e.com, hannes@...xchg.org,
 mjguzik@...il.com, oliver.sang@...el.com, mgorman@...hsingularity.net,
 david@...hat.com, peterx@...hat.com, oleg@...hat.com, dave@...olabs.net,
 paulmck@...nel.org, brauner@...nel.org, dhowells@...hat.com,
 hdanton@...a.com, hughd@...gle.com, lokeshgidra@...gle.com,
 minchan@...gle.com, jannh@...gle.com, shakeel.butt@...ux.dev,
 souravpanda@...gle.com, pasha.tatashin@...een.com, klarasmodin@...il.com,
 corbet@....net, linux-doc@...r.kernel.org, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH v7 10/17] mm: uninline the main body of vma_start_write()

On 1/8/25 01:35, Vlastimil Babka wrote:
> On 12/26/24 18:07, Suren Baghdasaryan wrote:
>> vma_start_write() is used in many places and will grow in size very soon.
>> It is not used in performance critical paths and uninlining it should
>> limit the future code size growth.
>> No functional changes.
>>
>> Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
> 
> Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
> 
>> --- a/mm/memory.c
>> +++ b/mm/memory.c
>> @@ -6328,6 +6328,20 @@ struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm,
>>  #endif
>>  
>>  #ifdef CONFIG_PER_VMA_LOCK
>> +void __vma_start_write(struct vm_area_struct *vma, unsigned int mm_lock_seq)
>> +{
>> +	down_write(&vma->vm_lock.lock);
>> +	/*
>> +	 * We should use WRITE_ONCE() here because we can have concurrent reads
>> +	 * from the early lockless pessimistic check in vma_start_read().
>> +	 * We don't really care about the correctness of that early check, but
>> +	 * we should use WRITE_ONCE() for cleanliness and to keep KCSAN happy.
>> +	 */
>> +	WRITE_ONCE(vma->vm_lock_seq, mm_lock_seq);
>> +	up_write(&vma->vm_lock.lock);
>> +}
>> +EXPORT_SYMBOL_GPL(__vma_start_write);
> 
> Do any modules need it? If not we shouldn't export.

Hi Vlastimil, Suren

The out-of-tree NVIDIA modules seem to rely on this symbol, is it possible to use EXPORT_SYMBOL() here instead of EXPORT_SYMBOL_GPL(), below is the modpost error:

	MODPOST Module.symvers
	WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia.o
	WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia-uvm.o
	WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia-modeset.o
	WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia-drm.o
	ERROR: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol '__vma_start_write'
	ERROR: modpost: GPL-incompatible module nvidia-drm.ko uses GPL-only symbol '__vma_start_write'
	make[4]: *** [/tmp/makepkg/linux-cachyos-rc-nc/src/linux-6.15-rc1/scripts/Makefile.modpost:147: Module.symvers] Error 1
	make[3]: *** [/tmp/makepkg/linux-cachyos-rc-nc/src/linux-6.15-rc1/Makefile:1964: modpost] Error 2

If it's possible I can send a patch that changes that.

> 
>>  /*
>>   * Lookup and lock a VMA under RCU protection. Returned VMA is guaranteed to be
>>   * stable and not isolated. If the VMA is not found or is being modified the
> 
-- 
Regards,
Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ