mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Panagiotis Issaris" <panagiotis.issaris@mech.kuleuven.ac.be>
To: Matt_Domsch@dell.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] EFI missing failure handling
Date: Sat, 5 Mar 2005 16:38:42 +0100	[thread overview]
Message-ID: <20050305153841.GA7808@mech.kuleuven.ac.be> (raw)

Hi,

The EFI driver allocates memory and writes into it without checking the
success of the allocation:

668     efi_char16_t *variable_name = kmalloc(1024, GFP_KERNEL);
...
696     memset(variable_name, 0, 1024);

The patch applies to 2.6.11-bk1.

Signed-off-by: Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>

diff -pruN linux-2.6.11-orig/drivers/firmware/efivars.c linux-2.6.11-pi/drivers/firmware/efivars.c
--- linux-2.6.11-orig/drivers/firmware/efivars.c	2005-03-05 02:23:29.000000000 +0100
+++ linux-2.6.11-pi/drivers/firmware/efivars.c	2005-03-05 02:23:04.000000000 +0100
@@ -670,6 +670,9 @@ efivars_init(void)
 	unsigned long variable_name_size = 1024;
 	int i, rc = 0, error = 0;
 
+	if (!variable_name)
+		return -ENOMEM;
+
 	if (!efi_enabled)
 		return -ENODEV;
 
-- 
  K.U.Leuven, Mechanical Eng.,  Mechatronics & Robotics Research Group
  http://people.mech.kuleuven.ac.be/~pissaris/

             reply	other threads:[~2005-03-05 15:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-05 15:38 Panagiotis Issaris [this message]
2005-03-05 17:06 ` Alexey Dobriyan
2005-03-05 20:17   ` Panagiotis Issaris
2005-03-05 21:18     ` Matt Domsch

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=20050305153841.GA7808@mech.kuleuven.ac.be \
    --to=panagiotis.issaris@mech.kuleuven.ac.be \
    --cc=Matt_Domsch@dell.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®