mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: matt.fleming@intel.com
Cc: cbouatmailru@gmail.com, ccross@android.com,
	keescook@chromium.org, tony.luck@intel.com,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	matthew.garrett@nebula.com, Richard Weinberger <richard@nod.at>
Subject: [PATCH 2/2] efivars: Implement no_storage_paranoia parameter
Date: Thu,  4 Apr 2013 15:01:40 +0200	[thread overview]
Message-ID: <1365080500-13677-2-git-send-email-richard@nod.at> (raw)
In-Reply-To: <1365080500-13677-1-git-send-email-richard@nod.at>

Using this parameter one can disable the storage_size/2 check if
he is really sure that the UEFI does sane gc.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/firmware/efivars.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 8e87f8d..0e1d669 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -105,8 +105,10 @@ MODULE_VERSION(EFIVARS_VERSION);
 
 static bool efivars_pstore_disable =
 	IS_ENABLED(CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE);
+static bool efivars_no_storage_paranoia;
 
 module_param_named(pstore_disable, efivars_pstore_disable, bool, 0644);
+module_param_named(no_storage_paranoia, efivars_no_storage_paranoia, bool, 0644);
 
 /*
  * The maximum size of VariableName + Data = 1024
@@ -450,7 +452,10 @@ check_var_size_locked(struct efivars *efivars, u32 attributes,
 		return status;
 
 	if (!storage_size || size > remaining_size ||
-	    (max_size && size > max_size) ||
+	    (max_size && size > max_size))
+		return EFI_OUT_OF_RESOURCES;
+
+	if (!efivars_no_storage_paranoia &&
 	    (remaining_size - size) < (storage_size / 2))
 		return EFI_OUT_OF_RESOURCES;
 
-- 
1.8.1.4


  reply	other threads:[~2013-04-04 13:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04 13:01 [PATCH 1/2] efivars: Check max_size only if it is non-zero Richard Weinberger
2013-04-04 13:01 ` Richard Weinberger [this message]
2013-04-04 16:00 ` Luck, Tony
2013-04-04 16:12   ` Richard Weinberger
2013-04-05 14:03     ` Matt Fleming
2013-04-07 22:32 [PATCH v2 " Richard Weinberger
2013-04-07 22:32 ` [PATCH 2/2] efivars: Implement no_storage_paranoia parameter Richard Weinberger
2013-04-09  9:38   ` Matt Fleming

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=1365080500-13677-2-git-send-email-richard@nod.at \
    --to=richard@nod.at \
    --cc=cbouatmailru@gmail.com \
    --cc=ccross@android.com \
    --cc=keescook@chromium.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=matthew.garrett@nebula.com \
    --cc=tony.luck@intel.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 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®