Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3994299imm; Mon, 14 May 2018 00:37:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp4sURTLvvG9MXSuwgQtnT227juLBa+CejrpBG6CUqZDuwxCzNw0ymGwFz6L8/oxQCmX0f5 X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr8871277pla.328.1526283479801; Mon, 14 May 2018 00:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526283479; cv=none; d=google.com; s=arc-20160816; b=EynMh/+9Y4KFVClPUj1gmAGhwW3HwUTGqQ0OXsMw5YvGL9lFhaIgegnkIT5k4f58aB Zsbw+B8UN+xlxSyzjzetXZyaBMsjbxHgEAhNWLj+JW9t8Vd/52m9pwukhucn5q5my+hF KqcP6n9IKw0eedYDsm2wd5f228j3W4X8Ig1M9TMiPRgep/czb/BoLMERP+FxDDhAlIdk 2nAMWqdJjKEGt/uTdCmxsPMMFLWecq3mZzMVbdTMa9sWYeBdYNS45KmPpaAneMMn59Ij ShkmOcvjKl1vgSIF5/+OYeUueJ+AV7lSk+9f/Ks6MsOsscR8jTZhkorif05ZikZqHpm3 HOBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=spV7c41ZQUcbfxqASjMsHqec+cGmrkl3OHTSEI+r4Ww=; b=yMHT9Myu0XmyNKpPXyHUzlTUvQ0F6RVRZxylcGTeqV722sYEl2i03vht2f487l6Dn4 mudkNIV6a64mYNOuTN9Pby2F95+Iz/jhewqhgNBzNOzMFpvopUdok8hrY2VbSr9DaUtq GeJImUQ1O7GDbqNl/F4zNwxEXmJNKcJRDFY/qfLIbG6zhvogpnm3XhfR1qizjasKfu5n AzVca9iGmlkSK+5QGcFWonAc4JSXZwmc07Pv0uYQh+0n8CObOX0VXFvaJGyJ8zCxwOuo BNvInhDOUH6PpQwA1vQopwHZcyIhEJbeFj/Qk/tvzncL4IF8hLqy2wFfdRLUkW0+uM+k nSRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t8qztNpL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12-v6si9127688plr.467.2018.05.14.00.37.44; Mon, 14 May 2018 00:37:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t8qztNpL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752791AbeENGxR (ORCPT + 99 others); Mon, 14 May 2018 02:53:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:59558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752777AbeENGxO (ORCPT ); Mon, 14 May 2018 02:53:14 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 16D2C21746; Mon, 14 May 2018 06:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526280793; bh=TNbwqP6GmtH0yrLIeoTfCh7cGZHcB5aIYFTLp9CDB1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t8qztNpL2KdbsETmxwwRj05wCIEG68vmdq/bJOWhuojOdIBo1+Gx6sARw3GWVyh1a QKG63NFWF1FYHyqYPuHdWt3HzAXmGjlMRri7BhJDylh2e3OX7DG4T+0UqtiGdtdeV5 tam2nffgZQDy6c0VeyInftO8nNpeVedajx/+qUIg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , syzbot , "David S. Miller" Subject: [PATCH 4.4 34/56] net: fix rtnh_ok() Date: Mon, 14 May 2018 08:48:39 +0200 Message-Id: <20180514064758.079254201@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180514064754.853201981@linuxfoundation.org> References: <20180514064754.853201981@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet commit b1993a2de12c9e75c35729e2ffbc3a92d50c0d31 upstream. syzbot reported : BUG: KMSAN: uninit-value in rtnh_ok include/net/nexthop.h:11 [inline] BUG: KMSAN: uninit-value in fib_count_nexthops net/ipv4/fib_semantics.c:469 [inline] BUG: KMSAN: uninit-value in fib_create_info+0x554/0x8d20 net/ipv4/fib_semantics.c:1091 @remaining is an integer, coming from user space. If it is negative we want rtnh_ok() to return false. Fixes: 4e902c57417c ("[IPv4]: FIB configuration using struct fib_config") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/nexthop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/net/nexthop.h +++ b/include/net/nexthop.h @@ -6,7 +6,7 @@ static inline int rtnh_ok(const struct rtnexthop *rtnh, int remaining) { - return remaining >= sizeof(*rtnh) && + return remaining >= (int)sizeof(*rtnh) && rtnh->rtnh_len >= sizeof(*rtnh) && rtnh->rtnh_len <= remaining; }