From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx133.postini.com [74.125.245.133]) by kanga.kvack.org (Postfix) with SMTP id 64E7B6B0031 for ; Sat, 10 Aug 2013 12:47:45 -0400 (EDT) Received: by mail-ob0-f180.google.com with SMTP id up14so7404580obb.39 for ; Sat, 10 Aug 2013 09:47:44 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1376080406-4r7r3uye-mutt-n-horiguchi@ah.jp.nec.com> From: KOSAKI Motohiro Date: Sat, 10 Aug 2013 12:47:24 -0400 Message-ID: Subject: Re: [PATCH 1/1] pagemap: fix buffer overflow in add_page_map() Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: yonghua zheng Cc: Naoya Horiguchi , LKML , "linux-mm@kvack.org" On Fri, Aug 9, 2013 at 8:49 PM, yonghua zheng 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 > 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 Acked-by: KOSAKI Motohiro -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org