From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753121AbdATQli (ORCPT ); Fri, 20 Jan 2017 11:41:38 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:33022 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752724AbdATQle (ORCPT ); Fri, 20 Jan 2017 11:41:34 -0500 Date: Fri, 20 Jan 2017 11:31:17 -0500 (EST) Message-Id: <20170120.113117.1592305434267734738.davem@davemloft.net> To: colin.king@canonical.com Cc: vyasevich@gmail.com, nhorman@tuxdriver.com, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][V2] net: sctp: fix array overrun read on sctp_timer_tbl From: David Miller In-Reply-To: <20170120134542.21104-1-colin.king@canonical.com> References: <20170120134542.21104-1-colin.king@canonical.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-7 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 20 Jan 2017 07:32:13 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v0KGflH0007059 From: Colin King Date: Fri, 20 Jan 2017 13:45:42 +0000 > From: Colin Ian King > > Table sctp_timer_tbl is missing a TIMEOUT_RECONF string so > add this in. Also compare timeout with the size of the array > sctp_timer_tbl rather than SCTP_EVENT_TIMEOUT_MAX. Also add > a build time check that SCTP_EVENT_TIMEOUT_MAX is correct > so we don't ever get this kind of mismatch between the table > and SCTP_EVENT_TIMEOUT_MAX in the future. > > Kudos to Marcel Ricardo Leitner for spotting the missing string > and suggesting the build time sanity check. > > Fixes CoverityScan CID#1397639 ("Out-of-bounds read") > > Signed-off-by: Colin Ian King Well, my bad... I reverted V1, that's fine. But this patch doesn't even compile. In file included from ./include/uapi/linux/stddef.h:1:0, from ./include/linux/stddef.h:4, from ./include/uapi/linux/posix_types.h:4, from ./include/uapi/linux/types.h:13, from ./include/linux/types.h:5, from ./include/net/sctp/sctp.h:58, from net/sctp/debug.c:41: net/sctp/debug.c: In function ¡sctp_tname¢: ./include/linux/compiler.h:518:38: error: call to ¡__compiletime_assert_170¢ declared with attribute error: BUILD_BUG_ON failed: SCTP_EVENT_TIMEOUT_MAX + 1 != ARRAY_SIZE(sctp_timer_tbl) _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)