From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from lechat.rtp-net.org ([88.191.19.38]:33033 "EHLO lechat.rtp-net.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754012Ab0HWVGJ (ORCPT ); Mon, 23 Aug 2010 17:06:09 -0400 Message-Id: <20100823210335.493454739@rtp-net.org> Date: Mon, 23 Aug 2010 23:02:22 +0200 From: Arnaud Patard (Rtp) To: Ivo van Doorn Cc: Gertjan van Wingerde , linux-wireless@vger.kernel.org Subject: [patch 1/1 v2] rt2x00: fix "buffer size not provably correct" build warning References: <20100823210221.126521640@rtp-net.org> Sender: linux-wireless-owner@vger.kernel.org List-ID: rt2x00 debugfs interface doesn't check the size of the data coming from userspace, leading to a build warning. Fix That. v2: return EINVAL if input is too long Signed-off-by: Arnaud Patard Index: rt2x00/drivers/net/wireless/rt2x00/rt2x00debug.c =================================================================== --- rt2x00.orig/drivers/net/wireless/rt2x00/rt2x00debug.c 2010-08-23 18:03:31.414826113 +0200 +++ rt2x00/drivers/net/wireless/rt2x00/rt2x00debug.c 2010-08-23 20:37:24.894366547 +0200 @@ -480,6 +480,9 @@ static ssize_t rt2x00debug_write_##__nam if (index >= debug->__name.word_count) \ return -EINVAL; \ \ + if (length > sizeof(line)) \ + return -EINVAL; \ + \ if (copy_from_user(line, buf, length)) \ return -EFAULT; \ \