From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF529C43613 for ; Mon, 24 Jun 2019 17:04:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C027020645 for ; Mon, 24 Jun 2019 17:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730703AbfFXREj (ORCPT ); Mon, 24 Jun 2019 13:04:39 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:57584 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726920AbfFXREi (ORCPT ); Mon, 24 Jun 2019 13:04:38 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id DB7DC15061484; Mon, 24 Jun 2019 10:04:37 -0700 (PDT) Date: Mon, 24 Jun 2019 10:04:35 -0700 (PDT) Message-Id: <20190624.100435.1535171955176516330.davem@davemloft.net> To: lucien.xin@gmail.com Cc: netdev@vger.kernel.org, edumazet@google.com, jon.maloy@ericsson.com, ying.xue@windriver.com, tipc-discussion@lists.sourceforge.net, syzkaller-bugs@googlegroups.com Subject: Re: [PATCHv2 net] tipc: check msg->req data len in tipc_nl_compat_bearer_disable From: David Miller In-Reply-To: <58c46f0c73a4c1aea970e52de69188e2dd20d3b4.1561393699.git.lucien.xin@gmail.com> References: <58c46f0c73a4c1aea970e52de69188e2dd20d3b4.1561393699.git.lucien.xin@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 24 Jun 2019 10:04:38 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Xin Long Date: Tue, 25 Jun 2019 00:28:19 +0800 > This patch is to fix an uninit-value issue, reported by syzbot: ... > TLV_GET_DATA_LEN() may return a negtive int value, which will be > used as size_t (becoming a big unsigned long) passed into memchr, > cause this issue. > > Similar to what it does in tipc_nl_compat_bearer_enable(), this > fix is to return -EINVAL when TLV_GET_DATA_LEN() is negtive in > tipc_nl_compat_bearer_disable(), as well as in > tipc_nl_compat_link_stat_dump() and tipc_nl_compat_link_reset_stats(). > > v1->v2: > - add the missing Fixes tags per Eric's request. > > Fixes: 0762216c0ad2 ("tipc: fix uninit-value in tipc_nl_compat_bearer_enable") > Fixes: 8b66fee7f8ee ("tipc: fix uninit-value in tipc_nl_compat_link_reset_stats") > Reported-by: syzbot+30eaa8bf392f7fafffaf@syzkaller.appspotmail.com > Signed-off-by: Xin Long Applied and queued up for -stable, thanks.