From patchwork Mon Apr 23 01:29:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 902722 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="kEgReCab"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40Tplw3gr3z9s1B for ; Mon, 23 Apr 2018 11:29:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753851AbeDWB33 (ORCPT ); Sun, 22 Apr 2018 21:29:29 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:40358 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753821AbeDWB32 (ORCPT ); Sun, 22 Apr 2018 21:29:28 -0400 Received: by mail-pg0-f65.google.com with SMTP id e9so7212205pgr.7 for ; Sun, 22 Apr 2018 18:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=00FXygE5PBFpTw+hEFaa9ujSpnSbVD/C4PTVTQFhYoc=; b=kEgReCab/Piza0JBWXXmWn7YSb0lIOb8ffgHWKQAJaQYzDtCrFWrNpcixqPB0y6k61 nK/6481hcWNvlFhxHropCYeOh8PKVcL9Gv1GbM5OTq9APb22DnQzeRE+46Jw/EE4WfYN OPXej97fq2AXg57ESu+ZYqqkIBugT8IezwtG9I6abp3CkrSSCo8rm1/r6SYzpOypTZwU A91YvpD2+wRD0byv+ec5Ee0cBEUptw4Mafao32gFjlvAF6yf0bnYWeUunSUwgAHBNYsV pqRf+Aq/s0soFPop6jvUGa8Z5jTXf+RTlOiRNvQ/dyJ3Syh7DVxSe0Fa5O5ycgKCkZAu scUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=00FXygE5PBFpTw+hEFaa9ujSpnSbVD/C4PTVTQFhYoc=; b=m11MsSkFPeSO05mBybBM4sOvT3YsjudwvegyPLALenUd6IZkqhTTgMBPQoG24gDuC7 FvH7vzDI2AHx3CXRcdocLUVMNtU5CLnftgS2shLiR+qysTSj1f0RlV1Sybbj1RgSxof0 ydWxSHbn/nq2JYGYkYDO3k+ikQ57ktdB5f2Zd+Sv04+UMdRl+5Ge2bq6g1XiFk0ed/uT P+pp57ry9oiEorRVcw/n9cnP36PYrJyoZ0tnxF5sdTMZvs/9cXbT3zmbZOEKko8hkbOO ct9jA+cjoU7d7SX03w2Se1tgsG1n8GwmLAnZQecOBFowJqhgeXREyB9asQUahhn87dds ZVig== X-Gm-Message-State: ALQs6tB0NtqK61Z1pB1n6V5QGhd/sHha3hhiTFyN5WTt5G0VXCkh9PG7 WEp/T+56CVq1jOMxUkEZTb5D6A== X-Google-Smtp-Source: AIpwx49LTAKfIJVf7DFuKJjzacXUSWfDOkYf8OpbtCxrXbQzbG56m+evk8bvbtdz5orScijxIiALlg== X-Received: by 10.99.152.84 with SMTP id l20mr15131168pgo.16.1524446967317; Sun, 22 Apr 2018 18:29:27 -0700 (PDT) Received: from localhost ([2620:15c:2c4:1:7e6f:1e60:1805:893c]) by smtp.gmail.com with ESMTPSA id c64sm23338298pfe.152.2018.04.22.18.29.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Apr 2018 18:29:25 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net] ipv6: add RTA_TABLE and RTA_PREFSRC to rtm_ipv6_policy Date: Sun, 22 Apr 2018 18:29:23 -0700 Message-Id: <20180423012923.121147-1-edumazet@google.com> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org KMSAN reported use of uninit-value that I tracked to lack of proper size check on RTA_TABLE attribute. I also believe RTA_PREFSRC lacks a similar check. Fixes: 86872cb57925 ("[IPv6] route: FIB6 configuration using struct fib6_config") Fixes: c3968a857a6b ("ipv6: RTA_PREFSRC support for ipv6 route source address selection") Signed-off-by: Eric Dumazet Reported-by: syzbot Acked-by: David Ahern --- net/ipv6/route.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 49b954d6d0fa44ea0c4427e2918b3ab9c1610fe0..cde7d8251377c1a115e02c46843d361d3c0b4313 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3975,6 +3975,7 @@ void rt6_mtu_change(struct net_device *dev, unsigned int mtu) static const struct nla_policy rtm_ipv6_policy[RTA_MAX+1] = { [RTA_GATEWAY] = { .len = sizeof(struct in6_addr) }, + [RTA_PREFSRC] = { .len = sizeof(struct in6_addr) }, [RTA_OIF] = { .type = NLA_U32 }, [RTA_IIF] = { .type = NLA_U32 }, [RTA_PRIORITY] = { .type = NLA_U32 }, @@ -3986,6 +3987,7 @@ static const struct nla_policy rtm_ipv6_policy[RTA_MAX+1] = { [RTA_EXPIRES] = { .type = NLA_U32 }, [RTA_UID] = { .type = NLA_U32 }, [RTA_MARK] = { .type = NLA_U32 }, + [RTA_TABLE] = { .type = NLA_U32 }, }; static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,