mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Junichi Nomura <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: j-nomura@ce.jp.nec.com, mingo@kernel.org, hpa@zytor.com,
	bp@suse.de, tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: [tip:x86/urgent] x86/microcode/intel: Fix allocation size of struct ucode_patch
Date: Mon, 9 Jan 2017 14:17:42 -0800	[thread overview]
Message-ID: <tip-9fcf5ba2ef908af916e9002891fbbca20ce4dc98@git.kernel.org> (raw)
In-Reply-To: <7a730dc9-ac17-35c4-fe76-dfc94e5ecd95@ce.jp.nec.com>

Commit-ID:  9fcf5ba2ef908af916e9002891fbbca20ce4dc98
Gitweb:     http://git.kernel.org/tip/9fcf5ba2ef908af916e9002891fbbca20ce4dc98
Author:     Junichi Nomura <j-nomura@ce.jp.nec.com>
AuthorDate: Mon, 9 Jan 2017 12:41:46 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 9 Jan 2017 23:11:14 +0100

x86/microcode/intel: Fix allocation size of struct ucode_patch

We allocate struct ucode_patch here. @size is the size of microcode data
and used for kmemdup() later in this function.

Fixes: 06b8534cb728 ("x86/microcode: Rework microcode loading")
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/7a730dc9-ac17-35c4-fe76-dfc94e5ecd95@ce.jp.nec.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/kernel/cpu/microcode/intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index faec8fa..9434865 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -150,7 +150,7 @@ static struct ucode_patch *__alloc_microcode_buf(void *data, unsigned int size)
 {
 	struct ucode_patch *p;
 
-	p = kzalloc(size, GFP_KERNEL);
+	p = kzalloc(sizeof(struct ucode_patch), GFP_KERNEL);
 	if (!p)
 		return ERR_PTR(-ENOMEM);
 

      parent reply	other threads:[~2017-01-09 22:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05  1:03 [PATCH] " Junichi Nomura
2017-01-05 10:23 ` Borislav Petkov
2017-01-05 17:44 ` Andy Shevchenko
2017-01-05 23:52   ` Junichi Nomura
2017-01-06  0:02     ` Borislav Petkov
2017-01-06  0:14       ` Junichi Nomura
2017-01-06 10:56         ` Borislav Petkov
2017-01-09 22:17 ` tip-bot for Junichi Nomura [this message]

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=tip-9fcf5ba2ef908af916e9002891fbbca20ce4dc98@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome