lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <1759269.Z5Z5RrJiUP@amdc3058>
Date:   Mon, 30 Jan 2017 16:59:22 +0100
From:   Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To:     Arvind Yadav <arvind.yadav.cs@...il.com>
Cc:     jejb@...isc-linux.org, deller@....de, linux-parisc@...r.kernel.org,
        linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] video : fbdev : stifb :- Handle return NULL error from
 ioremap_nocache.


Hi,

On Wednesday, January 18, 2017 03:51:51 PM Arvind Yadav wrote:
> Here, If ioremap_nocache will fail. It will return NULL.
> Kernel can run into a NULL-pointer dereference.
> This error check will avoid NULL pointer dereference.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>

Thanks, I queued your patch with some minor changes for 4.11
(you can see the final version of the patch below).

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


From: Arvind Yadav <arvind.yadav.cs@...il.com>
Subject: [PATCH v1] video: fbdev: stifb: handle NULL return value from ioremap_nocache

Add missing error check for ioremap_nocache() failure
(prevents NULL pointer dereference on error).

Cc: "James E.J. Bottomley" <jejb@...isc-linux.org>
Cc: Helge Deller <deller@....de>
Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
[b.zolnierkie: minor fixes]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
---
 drivers/video/fbdev/stifb.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: b/drivers/video/fbdev/stifb.c
===================================================================
--- a/drivers/video/fbdev/stifb.c	2017-01-30 16:55:15.766435453 +0100
+++ b/drivers/video/fbdev/stifb.c	2017-01-30 16:55:15.750435453 +0100
@@ -1294,6 +1294,10 @@ static int __init stifb_init_fb(struct s
 	strcpy(fix->id, "stifb");
 	info->fbops = &stifb_ops;
 	info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len);
+	if (!info->screen_base) {
+		printk(KERN_ERR "stifb: failed to map memory\n");
+		goto out_err0;
+	}
 	info->screen_size = fix->smem_len;
 	info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA;
 	info->pseudo_palette = &fb->pseudo_palette;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ