mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/3] pstore: remove superfluous memory size check
@ 2015-01-06 17:15 Mark Salyzyn
  2015-01-13 17:34 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Salyzyn @ 2015-01-06 17:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mark Salyzyn, Anton Vorontsov, Colin Cross, Kees Cook, Tony Luck

All previous checks will fail with error if memory size
is not sufficient to register a zone, so this legacy
check has become redundant.

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
---
 fs/pstore/ram.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 8613e5b..34ed8f8 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -474,14 +474,6 @@ static int ramoops_probe(struct platform_device *pdev)
 	if (err)
 		goto fail_init_fprz;
 
-	if (!cxt->przs && !cxt->cprz && !cxt->fprz) {
-		pr_err("memory size too small, minimum is %zu\n",
-			cxt->console_size + cxt->record_size +
-			cxt->ftrace_size);
-		err = -EINVAL;
-		goto fail_cnt;
-	}
-
 	cxt->pstore.data = cxt;
 	/*
 	 * Console can handle any buffer size, so prefer LOG_LINE_MAX. If we
@@ -525,7 +517,6 @@ fail_buf:
 	kfree(cxt->pstore.buf);
 fail_clear:
 	cxt->pstore.bufsize = 0;
-fail_cnt:
 	kfree(cxt->fprz);
 fail_init_fprz:
 	kfree(cxt->cprz);
-- 
2.2.0.rc0.207.ga3a616c


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

* Re: [PATCH 2/3] pstore: remove superfluous memory size check
  2015-01-06 17:15 [PATCH 2/3] pstore: remove superfluous memory size check Mark Salyzyn
@ 2015-01-13 17:34 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2015-01-13 17:34 UTC (permalink / raw)
  To: Mark Salyzyn; +Cc: LKML, Anton Vorontsov, Colin Cross, Tony Luck

On Tue, Jan 6, 2015 at 9:15 AM, Mark Salyzyn <salyzyn@android.com> wrote:
> All previous checks will fail with error if memory size
> is not sufficient to register a zone, so this legacy
> check has become redundant.
>
> Signed-off-by: Mark Salyzyn <salyzyn@android.com>
> ---
>  fs/pstore/ram.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index 8613e5b..34ed8f8 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -474,14 +474,6 @@ static int ramoops_probe(struct platform_device *pdev)
>         if (err)
>                 goto fail_init_fprz;
>
> -       if (!cxt->przs && !cxt->cprz && !cxt->fprz) {
> -               pr_err("memory size too small, minimum is %zu\n",
> -                       cxt->console_size + cxt->record_size +
> -                       cxt->ftrace_size);
> -               err = -EINVAL;
> -               goto fail_cnt;
> -       }
> -

Yup, good call. ramoops_init_przs and ramoops_init_prz do all the
checks already.

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

>         cxt->pstore.data = cxt;
>         /*
>          * Console can handle any buffer size, so prefer LOG_LINE_MAX. If we
> @@ -525,7 +517,6 @@ fail_buf:
>         kfree(cxt->pstore.buf);
>  fail_clear:
>         cxt->pstore.bufsize = 0;
> -fail_cnt:
>         kfree(cxt->fprz);
>  fail_init_fprz:
>         kfree(cxt->cprz);
> --
> 2.2.0.rc0.207.ga3a616c
>



-- 
Kees Cook
Chrome OS Security

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

end of thread, other threads:[~2015-01-13 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-06 17:15 [PATCH 2/3] pstore: remove superfluous memory size check Mark Salyzyn
2015-01-13 17:34 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®