lkml.org 
[lkml]   [2013]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH linux-next-20131029] IB/ipath: Fix random stack overflow.
From
Date
>From bbba584a502b9417af06e4a55401c013a7e90eb1 Mon Sep 17 00:00:00 2001
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: Wed, 30 Oct 2013 16:12:58 +0900
Subject: [PATCH linux-next-20131029] IB/ipath: Fix random stack overflow.

Commit 18fec3c6 "IB/ipath: Convert ipath_user_sdma_pin_pages() to use
get_user_pages_fast()" requested for undefined number of pages with buffer for
2 pages.

drivers/infiniband/hw/ipath/ipath_user_sdma.c: In function 'ipath_user_sdma_pin_pages':
drivers/infiniband/hw/ipath/ipath_user_sdma.c:283: warning: 'j' is used uninitialized in this function

ipath_user_sdma_pin_pages() assumes that npages is either 1 or 2 because
ipath_user_sdma_queue_pkts() checks that 0 < iov->iov_len <= PAGE_SIZE
which lets ipath_user_sdma_num_pages() return either 1 or 2.

Please check whether commit 18fec3c6 was backported
because that commit has "Cc: <stable@vger.kernel.org>" line.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: <stable@vger.kernel.org>
---
drivers/infiniband/hw/ipath/ipath_user_sdma.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_user_sdma.c b/drivers/infiniband/hw/ipath/ipath_user_sdma.c
index 06cbfd4..cc04b7b 100644
--- a/drivers/infiniband/hw/ipath/ipath_user_sdma.c
+++ b/drivers/infiniband/hw/ipath/ipath_user_sdma.c
@@ -280,7 +280,7 @@ static int ipath_user_sdma_pin_pages(const struct ipath_devdata *dd,
int j;
int ret;

- ret = get_user_pages_fast(addr, j, 0, pages);
+ ret = get_user_pages_fast(addr, npages, 0, pages);
if (ret != npages) {
int i;

--
1.7.1

\
 
 \ /
  Last update: 2013-10-30 13:21    [W:0.037 / U:28.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site