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]
Message-ID: <CAHO5Pa2_D_L6wKPWccaYH2BYWYFc=4Khe0Om5GWU3D-tcAH0OQ@mail.gmail.com>
Date:	Wed, 28 Nov 2012 14:33:14 +0100
From:	Michael Kerrisk <mtk.manpages@...il.com>
To:	Kay Sievers <kay@...y.org>
Cc:	Greg Kroah-Hartmann <greg@...ah.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
	Michael Kerrisk <mtk.manpages@...il.com>
Subject: Re: [PATCH RESEND 1/3] printk: convert byte-buffer to variable-length
 record buffer

Hi Kay,

On Thu, May 3, 2012 at 2:29 AM, Kay Sievers <kay@...y.org> wrote:
> From: Kay Sievers <kay@...y.org>
[...]
>         case SYSLOG_ACTION_SIZE_UNREAD:
> -               error = log_end - log_start;
> +               raw_spin_lock_irq(&logbuf_lock);
> +               if (syslog_seq < log_first_seq) {
> +                       /* messages are gone, move to first one */
> +                       syslog_seq = log_first_seq;
> +                       syslog_idx = log_first_idx;
> +               }
> +               if (from_file) {
> +                       /*
> +                        * Short-cut for poll(/"proc/kmsg") which simply checks
> +                        * for pending data, not the size; return the count of
> +                        * records, not the length.
> +                        */
> +                       error = log_next_idx - syslog_idx;
> +               } else {
> +                       u64 seq;
> +                       u32 idx;
> +
> +                       error = 0;
> +                       seq = syslog_seq;
> +                       idx = syslog_idx;
> +                       while (seq < log_next_seq) {
> +                               error += syslog_print_line(idx, NULL, 0);
> +                               idx = log_next(idx);
> +                               seq++;
> +                       }
> +               }
> +               raw_spin_unlock_irq(&logbuf_lock);
>                 break;
[...]

It looks as though the changes here have broken SYSLOG_ACTION_SIZE_UNREAD.

On a 2.6.31 system, immediately after SYSLOG_ACTION_READ_CLEAR, a
SYSLOG_ACTION_SIZE_UNREAD returns 0.

On 3.5, immediately after SYSLOG_ACTION_READ_CLEAR, the value returned
by SYSLOG_ACTION_SIZE_UNREAD is unchanged (i.e., assuming that the
value returned was non-zero before SYSLOG_ACTION_SIZE_UNREAD, it is
still nonzero afterward), even though a subsequent
SYSLOG_ACTION_READ_CLEAR indicates that there are zero bytes to read.

(All tests conducted with (r)syslogd stopped.)

Cheers,

Michael


-- 
Michael Kerrisk Linux man-pages maintainer;
http://www.kernel.org/doc/man-pages/
--
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