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] [day] [month] [year] [list]
Message-ID: <20091120120855.GA28630@bicker>
Date:	Fri, 20 Nov 2009 14:08:55 +0200
From:	Dan Carpenter <error27@...il.com>
To:	Alan Cox <alan@...ux.intel.com>
Cc:	greg@...ah.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 04/12] mxser: Use the new locking rules to fix
	setserial properly

On Wed, Nov 18, 2009 at 02:15:23PM +0000, Alan Cox wrote:
> Propogate the init/shutdown mutex through the setserial logic. Use the proper
> locks for the various bits still using the BKL. Kill the BKL in this driver.
> 

>  drivers/char/mxser.c |  145 +++++++++++++++++++++++++++-----------------------

> @@ -1951,6 +1959,7 @@ static void mxser_wait_until_sent(struct tty_struct *tty, int timeout)

> +	spin_lock_irqsave(&info->slock, flags);
>  	while (!((lsr = inb(info->ioaddr + UART_LSR)) & UART_LSR_TEMT)) {
>  #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
>  		printk("lsr = %d (jiff=%lu)...", lsr, jiffies);
>  #endif
> +		spin_unlock_irqrestore(&info->slock, flags);
>  		schedule_timeout_interruptible(char_time);
>  		if (signal_pending(current))
>  			break;
>  		if (timeout && time_after(jiffies, orig_jiffies + timeout))
>  			break;

If we break out of this while loop we get a double unlock.

> +		spin_lock_irqsave(&info->slock, flags);
>  	}
> +	spin_unlock_irqrestore(&info->slock, flags);
>  	set_current_state(TASK_RUNNING);
> -	unlock_kernel();

regards,
dan carpenter
--
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