Re: [PATCH/RFC] serial: sh-sci: Fix unlocked access to SCSCR register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 07, 2016 at 04:52:09PM +0100, Wolfram Sang wrote:
> On Mon, Nov 07, 2016 at 04:42:53PM +0100, Simon Horman wrote:
> > From: Takatoshi Akiyama <takatoshi.akiyama.kj@xxxxxxxxxxxxxxxxxxxxxxxx>
> > 
> > The SCSCR register access in sci_break_ctl() is not locked.
> > 
> > sci_start_tx() and sci_set_termios() changes the SCSCR register,
> > but does not lock sci_port.
> 
> Maybe naive question: Shouldn't stop_tx and/or (start|stop)_rx be
> protected, too? They change SCSCR as well?

In the case of stop_tx, this is installed as a callback where
the caller takes the lock.

In the case of start_rx, I think the lock should be taken in
sci_rx_dma_release() as other callers already take the lock.

In the case of stop_rx, this is both installed as a callback and
called directly. In both cases the caller takes the lock.

> 
> > Therefore, this patch adds lock during register access.
> > 
> > Also, remove the log output that leads to a double lock.
> > 
> > Signed-off-by: Takatoshi Akiyama <takatoshi.akiyama.kj@xxxxxxxxxxxxxxxxxxxxxxxx>
> > Signed-off-by: Takeshi Kihara <takeshi.kihara.df@xxxxxxxxxxx>
> > Signed-off-by: Simon Horman <horms+renesas@xxxxxxxxxxxx>





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux