From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Abeni Subject: Re: [PATCH net] team: avoid adding twice the same option to the event list Date: Sun, 15 Apr 2018 21:53:38 +0200 Message-ID: <1523822018.2710.9.camel@redhat.com> References: <0e295e62358a68b22c646adece4272a9bd0473f8.1523620752.git.pabeni@redhat.com> <20180413.140705.1693433489799741559.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, jiri@resnulli.us To: David Miller Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40180 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752434AbeDOTxn (ORCPT ); Sun, 15 Apr 2018 15:53:43 -0400 In-Reply-To: <20180413.140705.1693433489799741559.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 2018-04-13 at 14:07 -0400, David Miller wrote: > From: Paolo Abeni > Date: Fri, 13 Apr 2018 13:59:25 +0200 > > > When parsing the options provided by the user space, > > team_nl_cmd_options_set() insert them in a temporary list to send > > multiple events with a single message. > > While each option's attribute is correctly validated, the code does > > not check for duplicate entries before inserting into the event > > list. > > > > Exploiting the above, the syzbot was able to trigger the following > > splat: > ... > > This changeset addresses the avoiding list_add() if the current > > option is already present in the event list. > > > > Reported-and-tested-by: syzbot+4d4af685432dc0e56c91@syzkaller.appspotmail.com > > Signed-off-by: Paolo Abeni > > Fixes: 2fcdb2c9e659 ("team: allow to send multiple set events in one message") > > Looks good to me. > > It's too bad that the tmp list entries don't get marked as they are > added, or get unlinked by the list processor. Either scheme would > make the "already added" test a lot simpler. Yes, I considered both changes, but than opted for this solution, beliving it would be less invasive and more suitable for -net. Cheers, Paolo