Re: [PATCH v2] audit: Avoid excessive dput/dget in audit_context setup and reset paths

Waiman Long <[email protected]>
Newsgroups org.kernel.vger.audit,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 2/3/26 2:59 PM, Al Viro wrote:
> On Tue, Feb 03, 2026 at 02:44:33PM -0500, Waiman Long wrote:
>
>> +		/*
>> +		 * Defer the path_put() call of the old pwd to workqueue as
>> +		 * we may be in an atomic context that cannot call path_put()
>> +		 * directly because of might_sleep().
>> +		 */
>> +		pp = kmalloc(sizeof(*pp), GFP_NOFS);
> If that really gets called in atomic context, this kmalloc will
> in itself be enough to fuck you over, won't it?

Looking at the bug report again, I realized that the problem is because 
of the get_cond_fs_pwd() helper in my v1 patch call path_put() in a 
spinlock critical section. So we don't need to use workqueue here, just 
doing a path_put() should be good enough.

Thanks, Longman
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.