All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: zhe.he@windriver.com, rostedt@goodmis.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G
Date: Tue, 9 Oct 2018 15:05:38 +0200	[thread overview]
Message-ID: <20181009130538.7rtd3du2d7l6m63w@pathway.suse.cz> (raw)
In-Reply-To: <20181008145950.GA1473@tigerII.localdomain>

On Mon 2018-10-08 23:59:50, Sergey Senozhatsky wrote:
> On (10/08/18 15:59), Petr Mladek wrote:
> > I tried this patch with log_buf_len=5G. The kernel did not crash
> > but dmesg shown some mess. There are several 32-bit variables
> > to store the size, for example:
> > 
> > static u32 log_buf_len = __LOG_BUF_LEN;
> > u32 log_buf_len_get(void)
> > static u32 log_first_idx;
> > static u32 log_next_idx;
> > 
> > I guess that the code somewhere does not detect an overflows
> > correctly.
> > 
> > I am not motivated enought to add support for such huge message
> > buffer. Therefore I suggest to limit it to 32G for now.
> 
> Yeah, I think we gonna have problems even with a 4G logbuf and a 32-bit
> user-space doing syslog(int len).
> 
> I agree on the "not motivated enough" part ;)

OK, I have pushed an updated patch that has the limit 2GB
into printk.git, for-4.20 branch.

Note that it is slightly different than the yesterday's proposal.
I made a mistake in testing and still compared with UNIT_MAX.

The pushed version can be seen at
https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commit/?h=for-4.20&id=e6fe3e5b7d16e8f146a4ae7fe481bc6e97acde1e

Best Regards,
Petr

  reply	other threads:[~2018-10-09 13:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29 16:45 [PATCH v5 1/4] printk: Fix panic caused by passing log_buf_len to command line zhe.he
2018-09-29 16:45 ` [PATCH v5 2/4] printk: Correct wrong casting zhe.he
2018-10-02  5:50   ` Sergey Senozhatsky
2018-10-08 13:03     ` Petr Mladek
2018-09-29 16:45 ` [PATCH v5 3/4] printk: Add KBUILD_MODNAME and remove a redundant print prefix zhe.he
2018-10-02  5:52   ` Sergey Senozhatsky
2018-10-08 13:04   ` Petr Mladek
2018-09-29 16:45 ` [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G zhe.he
2018-10-02  5:51   ` Sergey Senozhatsky
2018-10-08 13:59   ` Petr Mladek
2018-10-08 14:59     ` Sergey Senozhatsky
2018-10-09 13:05       ` Petr Mladek [this message]
2018-10-09 13:57         ` Sergey Senozhatsky
2018-10-10  8:09           ` Petr Mladek
2018-10-10  8:21             ` Sergey Senozhatsky
2018-10-08 16:30     ` He Zhe
2018-10-02  5:48 ` [PATCH v5 1/4] printk: Fix panic caused by passing log_buf_len to command line Sergey Senozhatsky
2018-10-08 13:01 ` Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181009130538.7rtd3du2d7l6m63w@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=zhe.he@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.