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  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]
Date:   Mon, 18 May 2020 23:13:30 +0200
From:   Pavel Machek <>
To:     Greg Kroah-Hartman <>
        Hugh Dickins <>,
        Andrew Morton <>,
        Yang Shi <>,
        Linus Torvalds <>,
        Sasha Levin <>
Subject: Re: [PATCH 4.19 02/80] shmem: fix possible deadlocks on


> This may not risk an actual deadlock, since shmem inodes do not take
> part in writeback accounting, but there are several easy ways to avoid
> it.


> Take info->lock out of the chain and the possibility of deadlock or
> lockdep warning goes away.

It is unclear to me if actual possibility of deadlock exists or not,
but anyway:

>  	int retval = -ENOMEM;
> -	spin_lock_irq(&info->lock);
> +	/*
> +	 * What serializes the accesses to info->flags?
> +	 * ipc_lock_object() when called from shmctl_do_lock(),
> +	 * no serialization needed when called from shm_destroy().
> +	 */
>  	if (lock && !(info->flags & VM_LOCKED)) {
>  		if (!user_shm_lock(inode->i_size, user))
>  			goto out_nomem;

Should we have READ_ONCE() here? If it is okay, are concurency
sanitizers smart enough to realize that it is okay? Replacing warning
with different one would not be exactly a win...

Best regards,

(cesky, pictures)

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists