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] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7f6bf30-5094-b669-126d-e4751c17dcbb@samsung.com>
Date:   Thu, 20 Dec 2018 17:21:45 +0100
From:   Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To:     Konstantin Khorenko <khorenko@...tuozzo.com>
Cc:     linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH] fbcon: use kvmalloc() for scrollback buffer


Hi,

On 11/26/2018 11:02 AM, Konstantin Khorenko wrote:
> Scrollback frame buffer is rather big - 32K,
> so it requires 3rd order page, so let's use kvmalloc() instead of
> ordinary kmalloc() for it.

Is it actually safe to use non-contiguous memory for softback_buf?

> Signed-off-by: Konstantin Khorenko <khorenko@...tuozzo.com>
> ---
>  drivers/video/fbdev/core/fbcon.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index 8958ccc8b1ac..2b1a34d3f5e2 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -992,7 +992,7 @@ static const char *fbcon_startup(void)
>  			if (!softback_buf) {
>  				softback_buf =
>  				    (unsigned long)
> -				    kmalloc(fbcon_softback_size,
> +				    kvmalloc(fbcon_softback_size,
>  					    GFP_KERNEL);
>  				if (!softback_buf) {
>  					fbcon_softback_size = 0;
> @@ -1001,7 +1001,7 @@ static const char *fbcon_startup(void)
>  			}
>  		} else {
>  			if (softback_buf) {
> -				kfree((void *) softback_buf);
> +				kvfree((void *) softback_buf);
>  				softback_buf = 0;
>  				softback_top = 0;
>  			}
> @@ -3665,7 +3665,7 @@ static void fbcon_exit(void)
>  	}
>  #endif
>  
> -	kfree((void *)softback_buf);
> +	kvfree((void *)softback_buf);
>  	softback_buf = 0UL;
>  
>  	for_each_registered_fb(i) {

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ