lkml.org 
[lkml]   [2013]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/1] pagemap: fix buffer overflow in add_page_map()
On Fri, Aug 9, 2013 at 8:49 PM, yonghua zheng <younghua.zheng@gmail.com> wrote:
> Update the patch according to Naoya's comment, I also run
> ./scripts/checkpatch.pl, and it passed ;D.
>
> From 96826b0fdf9ec6d6e16c2c595f371dbb841250f7 Mon Sep 17 00:00:00 2001
> From: Yonghua Zheng <younghua.zheng@gmail.com>
> Date: Mon, 5 Aug 2013 12:12:24 +0800
> Subject: [PATCH 1/1] pagemap: fix buffer overflow in add_to_pagemap()
>
> In struc pagemapread:
>
> struct pagemapread {
> int pos, len;
> pagemap_entry_t *buffer;
> bool v2;
> };
>
> pos is number of PM_ENTRY_BYTES in buffer, but len is the size of buffer,
> it is a mistake to compare pos and len in add_to_pagemap() for checking
> buffer is full or not, and this can lead to buffer overflow and random
> kernel panic issue.
>
> Correct len to be total number of PM_ENTRY_BYTES in buffer.
>
> Signed-off-by: Yonghua Zheng <younghua.zheng@gmail.com>

Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>


\
 
 \ /
  Last update: 2013-08-10 19:01    [W:0.229 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site