Messages in this thread | | | Date | Thu, 24 Jun 2021 16:57:54 +0200 | From | Petr Mladek <> | Subject | Re: [PATCH printk v3 6/6] printk: syslog: close window between wait and read |
| |
On Thu 2021-06-24 13:17:48, John Ogness wrote: > Syslog's SYSLOG_ACTION_READ is supposed to block until the next > syslog record can be read, and then it should read that record. > However, because @syslog_lock is not held between waking up and > reading the record, another reader could read the record first, > thus causing SYSLOG_ACTION_READ to return with a value of 0, never > having read _anything_. > > By holding @syslog_lock between waking up and reading, it can be > guaranteed that SYSLOG_ACTION_READ blocks until it successfully > reads a syslog record (or a real error occurs). > > Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards, Petr
| |