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] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 23 Jun 2012 20:03:55 +0200
From:	Kay Sievers <kay@...y.org>
To:	Jan Beulich <JBeulich@...e.com>
Cc:	gregkh@...uxfoundation.org, yuanhan.liu@...ux.intel.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] syslog: fill buffer with more than a single message for SYSLOG_ACTION_READ

On Fri, Jun 22, 2012 at 5:36 PM, Jan Beulich <JBeulich@...e.com> wrote:
> The recent changes to the printk buffer management resulted in
> SYSLOG_ACTION_READ to only return a single message, whereas previously
> the buffer would get filled as much as possible. As, when too small to
> fit everything, filling it to the last byte would be pretty ugly with
> the new code, the patch arranges for as many messages as possible to
> get returned in a single invocation. User space tools in at least all
> SLES versions depend on the old behavior.

What a weird assumption for using that interface. It does a simple
one-time read and assumes it will never block in that? If something
would clear the log, or it would not contain a message, that read will
block and the tool would just hang? :)

But sure, sounds needed to restore the old behaviour if such weird
users exist, and the patch looks fine from looking over it.

> This at once addresses the issue attempted to get fixed with commit
> b56a39ac263e5b8cafedd551a49c2105e68b98c2 ("printk: return -EINVAL if
> the message len is bigger than the buf size"), and since that commit
> widened the possibility for losing a message altogether, the patch
> here assumes that this other commit would get reverted first
> (otherwise the patch here won't apply).
>
> Furthermore, this patch also addresses the problem dealt with in
> commit 4a77a5a06ec66ed05199b301e7c25f42f979afdc ("printk: use mutex
> lock to stop syslog_seq from going wild"), so I'd recommend reverting
> that one too (albeit there's no direct collision between the two).

Are you sure that is covered? Doesn't the other thread would just
return 0 to the caller then, instead of continuing to stay in the
syscall when the first thread got the message?

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