All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] linux-pstore.git
@ 2012-08-07  5:05 Anton Vorontsov
  0 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2012-08-07  5:05 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, Stephen Rothwell, linux-kernel,
	Greg Kroah-Hartman, Randy Dunlap, Tony Luck, Colin Cross,
	Kees Cook

Hello Linus,

This pull request includes a few fixes for pstore that I posted some time
ago, plus Randy's printk format fix. Also, now pstore has a dedicated git
tree, and a few people (including me) ready to review any further changes
to the code, the fact is now reflected in the maintainers file.

Since the fixes are pretty small, for convenience I include all of them
in the end of this email.

Thanks!


The following changes since commit 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee:

  Linux 3.6-rc1 (2012-08-02 16:38:10 -0700)

are available in the git repository at:

  git://git.infradead.org/users/cbou/linux-pstore.git tags/v3.6-rc1-fixes

for you to fetch changes up to 8defe59969cb8d863fe46867809316350ec0fc8f:

  MAINTAINERS: Add pstore maintainers (2012-08-06 21:16:19 -0700)

----------------------------------------------------------------
Just a few fixes for v3.6-rc1, plus added maintainers for pstore.

----------------------------------------------------------------
Anton Vorontsov (3):
      pstore/ram: Fix possible NULL dereference
      pstore/ram: Mark ramoops_pstore_write_buf() as notrace
      MAINTAINERS: Add pstore maintainers

Randy Dunlap (1):
      pstore/ram: Fix printk format warning

 MAINTAINERS     |   12 ++++++++++++
 fs/pstore/ram.c |   27 ++++++++++++++-------------
 2 files changed, 26 insertions(+), 13 deletions(-)


commit 8defe59969cb8d863fe46867809316350ec0fc8f
Author: Anton Vorontsov <anton.vorontsov@linaro.org>
Date:   Fri Aug 3 18:07:20 2012 -0700

    MAINTAINERS: Add pstore maintainers
    
    Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
    Acked-by: Tony Luck <tony.luck@intel.com>
    Acked-by: Kees Cook <keescook@chromium.org>

diff --git a/MAINTAINERS b/MAINTAINERS
index 94b823f..9aa40c1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5496,6 +5496,18 @@ L:	cbe-oss-dev@lists.ozlabs.org
 S:	Maintained
 F:	drivers/block/ps3vram.c
 
+PSTORE FILESYSTEM
+M:	Anton Vorontsov <cbouatmailru@gmail.com>
+M:	Colin Cross <ccross@android.com>
+M:	Kees Cook <keescook@chromium.org>
+M:	Tony Luck <tony.luck@intel.com>
+S:	Maintained
+T:	git git://git.infradead.org/users/cbou/linux-pstore.git
+F:	fs/pstore/
+F:	include/linux/pstore*
+F:	drivers/firmware/efivars.c
+F:	drivers/acpi/apei/erst.c
+
 PTP HARDWARE CLOCK SUPPORT
 M:	Richard Cochran <richardcochran@gmail.com>
 S:	Maintained

commit 242030365eacb649161023a3a024373198c34d59
Author: Anton Vorontsov <anton.vorontsov@linaro.org>
Date:   Tue Jul 17 19:49:37 2012 -0700

    pstore/ram: Mark ramoops_pstore_write_buf() as notrace
    
    write_buf() should be marked as notrace, otherwise it is prone to
    recursion.
    
    Though, yet the issue is never triggered in real life, because we run
    inside the function tracer, where ftrace does its own recurse protection.
    
    But it's still no good, plus soon we might switch to our own tracer ops,
    and then the issue will be fatal. So, let's fix it.
    
    Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index fba8c72..9101604 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -32,6 +32,7 @@
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
+#include <linux/compiler.h>
 #include <linux/pstore_ram.h>
 
 #define RAMOOPS_KERNMSG_HDR "===="
@@ -181,12 +182,11 @@ static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz)
 	return len;
 }
 
-
-static int ramoops_pstore_write_buf(enum pstore_type_id type,
-				    enum kmsg_dump_reason reason,
-				    u64 *id, unsigned int part,
-				    const char *buf, size_t size,
-				    struct pstore_info *psi)
+static int notrace ramoops_pstore_write_buf(enum pstore_type_id type,
+					    enum kmsg_dump_reason reason,
+					    u64 *id, unsigned int part,
+					    const char *buf, size_t size,
+					    struct pstore_info *psi)
 {
 	struct ramoops_context *cxt = psi->data;
 	struct persistent_ram_zone *prz = cxt->przs[cxt->dump_write_cnt];

commit 0427193b691edc81c846c7d0ebd2561cae8709d8
Author: Randy Dunlap <rdunlap@xenotime.net>
Date:   Fri Aug 3 17:02:48 2012 -0700

    pstore/ram: Fix printk format warning
    
    Fix printk format warning (on i386) in pstore:
    
    fs/pstore/ram.c:409:3: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'size_t'
    
    Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
    Acked-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index bcd1bbd..fba8c72 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -406,7 +406,7 @@ static int __devinit ramoops_probe(struct platform_device *pdev)
 		goto fail_init_fprz;
 
 	if (!cxt->przs && !cxt->cprz && !cxt->fprz) {
-		pr_err("memory size too small, minimum is %lu\n",
+		pr_err("memory size too small, minimum is %zu\n",
 			cxt->console_size + cxt->record_size +
 			cxt->ftrace_size);
 		goto fail_cnt;

commit a384f6411734e763daa4bae30e8ff170d7d4c3e2
Author: Anton Vorontsov <anton.vorontsov@linaro.org>
Date:   Thu Jul 19 15:47:11 2012 -0700

    pstore/ram: Fix possible NULL dereference
    
    We can dereference 'cxt->cprz' if console and dump logging are disabled
    (which is unlikely, but still possible to do). This patch fixes the issue
    by changing the code so that we don't dereference przs at all, we can
    just calculate bufsize from console_size and record_size values.
    
    Plus, while at it, the patch improves the buffer size calculation.
    
    After Kay's printk rework, we know the optimal buffer size for console
    logging -- it is LOG_LINE_MAX (defined privately in printk.c). Previously,
    if only console logging was enabled, we would allocate unnecessary large
    buffer in pstore, while we only need LOG_LINE_MAX. (Pstore console logging
    is still capable of handling buffers > LOG_LINE_MAX, it will just do
    multiple calls to psinfo->write).
    
    Note that I don't export the constant, since we will do even a better
    thing soon: we will switch console logging to a new write_buf API, which
    will eliminate the need for the additional buffer; and so we won't need
    the constant.
    
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
    Acked-by: Kees Cook <keescook@chromium.org>

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 0b311bc..bcd1bbd 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -414,13 +414,14 @@ static int __devinit ramoops_probe(struct platform_device *pdev)
 
 	cxt->pstore.data = cxt;
 	/*
-	 * Console can handle any buffer size, so prefer dumps buffer
-	 * size since usually it is smaller.
+	 * Console can handle any buffer size, so prefer LOG_LINE_MAX. If we
+	 * have to handle dumps, we must have at least record_size buffer. And
+	 * for ftrace, bufsize is irrelevant (if bufsize is 0, buf will be
+	 * ZERO_SIZE_PTR).
 	 */
-	if (cxt->przs)
-		cxt->pstore.bufsize = cxt->przs[0]->buffer_size;
-	else
-		cxt->pstore.bufsize = cxt->cprz->buffer_size;
+	if (cxt->console_size)
+		cxt->pstore.bufsize = 1024; /* LOG_LINE_MAX */
+	cxt->pstore.bufsize = max(cxt->record_size, cxt->pstore.bufsize);
 	cxt->pstore.buf = kmalloc(cxt->pstore.bufsize, GFP_KERNEL);
 	spin_lock_init(&cxt->pstore.buf_lock);
 	if (!cxt->pstore.buf) {


-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [GIT PULL] linux-pstore.git
@ 2013-05-03  4:08 Anton Vorontsov
  0 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2013-05-03  4:08 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, linux-kernel, Tony Luck, Colin Cross, Kees Cook,
	Arve Hjønnevåg

Hello Linus,

Please pull a few updates for the pstore subsystem. Here is what is in:

- A new platform data parameter to specify ECC configuration;
- Rounding fixup to not waste memory in ecc_blocks;
- Restore ECC information printouts;
- A small code cleanup: use kmemdup where appropriate.

Thank you!

The following changes since commit a937536b868b8369b98967929045f1df54234323:

  Linux 3.9-rc3 (2013-03-17 15:59:32 -0700)

are available in the git repository at:

  git://git.infradead.org/users/cbou/linux-pstore.git tags/for-v3.10

for you to fetch changes up to bd08ec33b5c23833581e5a36b2a69ccae6b39a28:

  pstore/ram: Restore ecc information block (2013-04-03 21:50:10 -0700)

----------------------------------------------------------------
Alexandru Gheorghiu (1):
      pstore: Replace calls to kmalloc and memcpy with kmemdup

Arve Hjønnevåg (3):
      pstore/ram: Include ecc_size when calculating ecc_block
      pstore/ram: Allow specifying ecc parameters in platform data
      pstore/ram: Restore ecc information block

 fs/pstore/ram.c            | 26 +++++++++++-------
 fs/pstore/ram_core.c       | 66 ++++++++++++++++++++++++++--------------------
 include/linux/pstore_ram.h | 14 +++++++---
 3 files changed, 64 insertions(+), 42 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [GIT PULL] linux-pstore.git
@ 2012-12-13  6:39 Anton Vorontsov
  0 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2012-12-13  6:39 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, linux-kernel, Tony Luck, Colin Cross, Kees Cook

Hello Linus,

Here are just a few fixups for the pstore subsystem, nothing special this
time. Please pull.

Thank you!

The following changes since commit 70a6f46d7b0ec03653b9ab3f8063a9717a4a53ef:

  pstore: Fix NULL pointer dereference in console writes (2012-11-14 18:30:21 -0800)

are available in the git repository at:

  git://git.infradead.org/users/cbou/linux-pstore.git tags/for-v3.8

for you to fetch changes up to ebacfd1ece3bfa46296fc92c6f996cb5f7fc75e6:

  pstore/ftrace: Adjust for ftrace_ops->func prototype change (2012-12-12 19:50:04 -0800)

----------------------------------------------------------------
Anton Vorontsov (1):
      pstore/ftrace: Adjust for ftrace_ops->func prototype change

Arve Hjønnevåg (1):
      pstore/ram: Fix bounds checks for mem_size, record_size, console_size and ftrace_size

Hannes Reinecke (1):
      pstore/ram: Fixup section annotations

Maxime Bizon (1):
      pstore/ram: Fix undefined usage of rounddown_pow_of_two(0)

 fs/pstore/ftrace.c |  4 +++-
 fs/pstore/ram.c    | 42 +++++++++++++++++++++++++++++++-----------
 2 files changed, 34 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [GIT PULL] linux-pstore.git
@ 2012-11-15  3:06 Anton Vorontsov
  0 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2012-11-15  3:06 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, linux-kernel, Tony Luck, Colin Cross, Kees Cook,
	Colin King

Hello Linus,

Please pull a small fixup for the persistent storage subsystem. A small
buglet can prevent kernel booting on a APEI-enabled machines w/
CONFIG_PSTORE_CONSOLE=y (this is N by default, though).

Thanks!

The following changes since commit 77b67063bb6bce6d475e910d3b886a606d0d91f7:

  Linux 3.7-rc5 (2012-11-11 13:44:33 +0100)

are available in the git repository at:

  git://git.infradead.org/users/cbou/linux-pstore.git tags/for-v3.7-fixes

for you to fetch changes up to 70a6f46d7b0ec03653b9ab3f8063a9717a4a53ef:

  pstore: Fix NULL pointer dereference in console writes (2012-11-14 18:30:21 -0800)

----------------------------------------------------------------
A small fixup for the persistent storage subsystem. The bug can prevent
kernel booting on a APEI-enabled machines w/ CONFIG_PSTORE_CONSOLE=y (this
is N by default, though).

----------------------------------------------------------------
Colin Ian King (1):
      pstore: Fix NULL pointer dereference in console writes

 fs/pstore/platform.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


commit 70a6f46d7b0ec03653b9ab3f8063a9717a4a53ef
Author: Colin Ian King <colin.king@canonical.com>
Date:   Wed Nov 14 11:49:53 2012 +0000

    pstore: Fix NULL pointer dereference in console writes
    
    Passing a NULL id causes a NULL pointer deference in writers such as
    erst_writer and efi_pstore_write because they expect to update this id.
    Pass a dummy id instead.
    
    This avoids a cascade of oopses caused when the initial
    pstore_console_write passes a null which in turn causes writes to the
    console causing further oopses in subsequent pstore_console_write calls.
    
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Acked-by: Kees Cook <keescook@chromium.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index a40da07..947fbe0 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -161,6 +161,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c)
 
 	while (s < e) {
 		unsigned long flags;
+		u64 id;
 
 		if (c > psinfo->bufsize)
 			c = psinfo->bufsize;
@@ -172,7 +173,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c)
 			spin_lock_irqsave(&psinfo->buf_lock, flags);
 		}
 		memcpy(psinfo->buf, s, c);
-		psinfo->write(PSTORE_TYPE_CONSOLE, 0, NULL, 0, c, psinfo);
+		psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, c, psinfo);
 		spin_unlock_irqrestore(&psinfo->buf_lock, flags);
 		s += c;
 		c = e - s;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [GIT PULL] linux-pstore.git
@ 2012-10-05  3:09 Anton Vorontsov
  0 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2012-10-05  3:09 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, Stephen Rothwell, linux-kernel,
	Greg Kroah-Hartman, Randy Dunlap, Tony Luck, Colin Cross,
	Kees Cook

Hello Linus,

Please also pull a few pstore updates,

The following changes since commit 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee:

  Linux 3.6-rc1 (2012-08-02 16:38:10 -0700)

are available in the git repository at:

  git://git.infradead.org/users/cbou/linux-pstore.git tags/for-v3.7

for you to fetch changes up to 80c9d03c22f13a17df67b4b99a83ed5e9acf6093:

  pstore: Avoid recursive spinlocks in the oops_in_progress case (2012-09-20 17:04:50 -0700)

----------------------------------------------------------------
1. We no longer ad-hoc to the function tracer "high level" infrastructure
   and no longer use its debugfs knobs. The change slightly touches
   kernel/trace directory, but it got the needed ack from Steven Rostedt:
   http://lkml.org/lkml/2012/8/21/688
2. Added maintainers entry;
3. A bunch of fixes, nothing special.

----------------------------------------------------------------
Anton Vorontsov (4):
      pstore/ram: Fix possible NULL dereference
      pstore/ram: Mark ramoops_pstore_write_buf() as notrace
      MAINTAINERS: Add pstore maintainers
      pstore/ftrace: Convert to its own enable/disable debugfs knob

Chuansheng Liu (1):
      pstore: Avoid recursive spinlocks in the oops_in_progress case

Jovi Zhang (1):
      pstore/ram: Add missing platform_device_unregister

Randy Dunlap (1):
      pstore/ram: Fix printk format warning

 Documentation/ramoops.txt      |  4 +-
 MAINTAINERS                    | 12 +++++
 fs/pstore/Kconfig              |  1 +
 fs/pstore/ftrace.c             | 96 +++++++++++++++++++++++++++++++++++-
 fs/pstore/internal.h           |  6 +++
 fs/pstore/platform.c           |  9 +++-
 fs/pstore/ram.c                | 28 ++++++-----
 include/linux/pstore.h         |  8 ---
 kernel/trace/trace_functions.c | 15 +-----
 9 files changed, 139 insertions(+), 40 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-03  4:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-07  5:05 [GIT PULL] linux-pstore.git Anton Vorontsov
2012-10-05  3:09 Anton Vorontsov
2012-11-15  3:06 Anton Vorontsov
2012-12-13  6:39 Anton Vorontsov
2013-05-03  4:08 Anton Vorontsov

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.