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: <20110331112559.090948a7@lxorguk.ukuu.org.uk>
Date:	Thu, 31 Mar 2011 11:25:59 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Pavan Savoy <pavan_savoy@...y.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: locks inside receive_buf

On Wed, 30 Mar 2011 17:51:27 +0530
Pavan Savoy <pavan_savoy@...y.com> wrote:

> Hi,
> 
> Does holding a lock make any sense inside the line discipline's
> ops->receive_buf?
> I see the locks being held and released - during some calls like
> flush_to_ldisc, which end up calling receive_buf....
> 
> 
> and yes, I would like to have a lock because, there are other
> functions in my ldisc driver executed in process context ...
> Is there some hints as to what should be the do's and don'ts inside
> the ldisc ops functions ? (say tty_wakeup ...)

It's not well documented no. Your ld->receive_buf is single threaded and
runs from a sleeping context (but please don't sleep too long)

The output path from user space will be in a sleeping context too, but
you can call the write method of the tty your driver is using from
interrupt context or holding a spinlock (eg from timers)



--
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