John Ogness 8d909b2333 printk: syslog: close window between wait and read
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>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210715193359.25946-7-john.ogness@linutronix.de
2021-07-26 15:09:57 +02:00
..
2021-06-29 12:07:18 -07:00
2021-06-28 11:55:20 +02:00
2021-06-18 11:43:07 +02:00
2021-04-27 18:14:38 -07:00
2021-06-28 12:14:19 -07:00
2021-06-18 11:43:09 +02:00
2021-06-29 12:31:16 -07:00
2021-07-26 15:09:44 +02:00
2021-03-24 12:11:48 -04:00
2021-04-27 13:50:58 -07:00
2021-04-08 16:04:20 -07:00
2021-06-18 11:43:08 +02:00
2021-06-28 11:45:29 -07:00
2021-06-18 11:43:09 +02:00
2021-07-26 15:09:34 +02:00
2021-05-07 00:26:33 -07:00
2020-12-14 16:40:27 -08:00
2021-07-26 15:09:34 +02:00
2020-12-17 13:01:31 -08:00
2020-12-14 16:40:27 -08:00
2021-06-18 11:43:09 +02:00
2020-12-01 10:30:28 +00:00
2021-06-18 11:43:07 +02:00
2021-02-09 12:27:29 -05:00
2021-05-07 00:26:34 -07:00