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: <20080905124046.GP2772@parisc-linux.org>
Date:	Fri, 5 Sep 2008 06:40:46 -0600
From:	Matthew Wilcox <matthew@....cx>
To:	Stephen Hemminger <shemminger@...tta.com>
Cc:	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Ben Hutchings <bhutchings@...arflare.com>,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] PCI: vpd handle longer delays in access

On Thu, Sep 04, 2008 at 01:56:37PM -0700, Stephen Hemminger wrote:
> -		udelay(10);
> +		if (signal_pending(current))
> +			return -EINTR;

If you're going to use _killable instead of _interruptible, this needs
to be fatal_signal_pending().  Otherwise the one who owns the lock can
be interrupted by _any_ signal while those waiting for the lock can only
be interrupted by fatal signals.  Which seems daft to me.

> -	spin_lock_irq(&vpd->lock);
> +	ret = mutex_lock_killable(&vpd->lock);
> +	if (ret)
> +		return ret;

What's wrong with the shorter:

	if (mutex_lock_killable(&vpd->lock))
		return -EINTR;
?

The actual error is irrelevant here since userspace will never consume it.

(I agree with Peter about use of yield())

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
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