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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180920202316.GA6038@jordon-HP-15-Notebook-PC>
Date:   Fri, 21 Sep 2018 01:53:16 +0530
From:   Souptick Joarder <jrdr.linux@...il.com>
To:     willy@...radead.org, miguel.ojeda.sandonis@...il.com
Cc:     linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Subject: [PATCH] auxdisplay/cfag12864bfb.c: Replace vm_insert_page

There is a plan to remove vm_insert_page permanently
and replace it with new API vmf_insert_page which will
return vm_fault_t type. As part of it vm_insert_page
is removed from this driver.

remap_pfn_range() will be used to map kernel memory to
user vma.

Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>
---
 drivers/auxdisplay/cfag12864bfb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index 40c8a55..3b4411d 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -52,8 +52,12 @@
 
 static int cfag12864bfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
-	return vm_insert_page(vma, vma->vm_start,
-		virt_to_page(cfag12864b_buffer));
+	struct page *page;
+	unsigned long size = vma->vm_end - vma->vm_start;
+
+	page = virt_to_page(cfag12864b_buffer);
+	return remap_pfn_range(vma, vma->vm_start, page_to_pfn(page),
+				size, vma->vm_page_prot);
 }
 
 static struct fb_ops cfag12864bfb_ops = {
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ