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: <20101106181617.GE13315@infradead.org>
Date:	Sat, 6 Nov 2010 14:16:17 -0400
From:	Christoph Hellwig <hch@...radead.org>
To:	Alessio Igor Bogani <abogani@...ware.it>
Cc:	Jan Kara <jack@...e.cz>, Arnd Bergmann <arnd@...db.de>,
	Christoph Hellwig <hch@...radead.org>,
	Tim Bird <tim.bird@...sony.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/4] udf: Replace bkl with a mutex for protect
 udf_sb_info struct

> +		mutex_lock(&sbi->lock);
>  		result = udf_relocate_blocks(inode->i_sb,
>  						old_block, &new_block);
> +		mutex_unlock(&sbi->lock);

Moving the locking inside udf_relocate_blocks would be cleaner.

> @@ -570,7 +569,7 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options)
>  	if (!udf_parse_options(options, &uopt, true))
>  		return -EINVAL;
>  
> -	lock_kernel();
> +	mutex_lock(&sbi->lock);

What are you protecting against here?  Concurrent remount calls are
protects against by the VFS.  Is there any reader that takes sbi->lock
to get a consistent view of the various options?  It doesn't seem you
introduce one in this series, so it seems we could do fine without any
locking.

> -		unlock_kernel();
>  		return -ENOMEM;
>  	}
>  
> +	mutex_init(&sbi->lock);
> +	mutex_lock(&sbi->lock);

What are you locking against here?  I can't fine anything that puts the
superblock on a global list in fill_super, and I can't find any code
that would look a superblock up that's not fully set up.  I don't think
synchronization here in fill_super is needed at all.

> +	/* Serialize writer access, replace the old bkl */
> +	struct mutex lock;

Same comment as for the per-inode mutex applies here, too.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ