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  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]
Date:	Thu, 19 Apr 2007 21:06:16 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Keiichi KII <k-keiichi@...jp.nec.com>
Cc:	mpm@...enic.com, davem@...emloft.net, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org
Subject: Re: [RFC][PATCH -mm take4 3/6] add interface for netconsole using
 sysfs

On Wed, 18 Apr 2007 21:08:45 +0900 Keiichi KII <k-keiichi@...jp.nec.com> wrote:

> +static ssize_t store_local_port(struct netconsole_target *nt, const char *buf,
> +				size_t count)
> +{
> +	spin_lock(&target_list_lock);
> +	nt->np.local_port = simple_strtol(buf, NULL, 10);
> +	spin_unlock(&target_list_lock);
> +
> +	return count;
> +}
> +
> +static ssize_t store_remote_port(struct netconsole_target *nt, const char *buf,
> +				size_t count)
> +{
> +	spin_lock(&target_list_lock);
> +	nt->np.remote_port = simple_strtol(buf, NULL, 10);
> +	spin_unlock(&target_list_lock);
> +
> +	return count;
> +}

I think that you'll find that the locking in here does nothing useful and
can be removed.


Also, write_msg() can be called from IRQ context, so this lock _must_ be
taken with spin_lock_irq[save] basically everywhere - the code as-is can be
deadlocked.


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists