From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:48508 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752534AbdIRIbC (ORCPT ); Mon, 18 Sep 2017 04:31:02 -0400 Subject: Patch "libnvdimm, btt: check memory allocation failure" has been added to the 4.13-stable tree To: christophe.jaillet@wanadoo.fr, dan.j.williams@intel.com, gregkh@linuxfoundation.org, vishal.l.verma@intel.com Cc: , From: Date: Mon, 18 Sep 2017 10:31:12 +0200 Message-ID: <15057234723062@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled libnvdimm, btt: check memory allocation failure to the 4.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: libnvdimm-btt-check-memory-allocation-failure.patch and it can be found in the queue-4.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From ed36b4dba54a421ce5551638f6a9790b2c2116b1 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sun, 27 Aug 2017 08:30:34 +0200 Subject: libnvdimm, btt: check memory allocation failure From: Christophe Jaillet commit ed36b4dba54a421ce5551638f6a9790b2c2116b1 upstream. Check memory allocation failures and return -ENOMEM in such cases, as already done few lines below for another memory allocation. This avoids NULL pointers dereference. Fixes: 14e494542636 ("libnvdimm, btt: BTT updates for UEFI 2.7 format") Signed-off-by: Christophe JAILLET Reviewed-by: Vishal Verma Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/nvdimm/btt.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -1429,6 +1429,8 @@ int nvdimm_namespace_attach_btt(struct n } btt_sb = devm_kzalloc(&nd_btt->dev, sizeof(*btt_sb), GFP_KERNEL); + if (!btt_sb) + return -ENOMEM; /* * If this returns < 0, that is ok as it just means there wasn't Patches currently in stable-queue which might be from christophe.jaillet@wanadoo.fr are queue-4.13/libnvdimm-btt-check-memory-allocation-failure.patch