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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 7AEDFC433E0 for ; Sat, 9 Jan 2021 03:17:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46B6423A1E for ; Sat, 9 Jan 2021 03:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726510AbhAIDRY (ORCPT ); Fri, 8 Jan 2021 22:17:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:46564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbhAIDRY (ORCPT ); Fri, 8 Jan 2021 22:17:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7CB302399C; Sat, 9 Jan 2021 03:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610162203; bh=JktQALoNf5wtWzp6JI8N86X3dix51etwspzXbC0GKo8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nQHTBY2LqvE0TG97D1+CWWOvIj2l7iALMCsfdCZab3u8COei0P91mycrhEKWhQBWl uIosfIiUzoRgy3AqiLnY+ZjvrV9eo92n9dy4K7P+05Xbzw9rDEyZBuOE7WS9TlEtpM 1r+b29WpyhUNbtbriTBahC6uNCUvBJTKx9dYQm5OZaOCLAg1VxpI9+YO6vnSxDyQxN 3oPy4vlNSutZaHWfm8SxV5e6RGopATy7UGXGUikB0VvXMmrOJ392le1ARvfRlH3yeo qEj45Fa95+XV4vmf55C/U/ygjEmN0tyhq1eRPOybkvgH3VFK4mNUnrQaPggl0112eE fcQiO564CmHQw== Date: Fri, 8 Jan 2021 19:16:42 -0800 From: Jakub Kicinski To: Willem de Bruijn , Baptiste Lepers Cc: David Miller , Network Development Subject: Re: [PATCH] udp: Prevent reuseport_select_sock from reading uninitialized socks Message-ID: <20210108191642.1963d3aa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210107051110.12247-1-baptiste.lepers@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 7 Jan 2021 00:27:07 -0500 Willem de Bruijn wrote: > On Thu, Jan 7, 2021 at 12:11 AM Baptiste Lepers > wrote: > > > > reuse->socks[] is modified concurrently by reuseport_add_sock. To > > prevent reading values that have not been fully initialized, only read > > the array up until the last known safe index instead of incorrectly > > re-reading the last index of the array. > > > > Fixes: acdcecc61285f ("udp: correct reuseport selection with connected > > sockets") > > Signed-off-by: Baptiste Lepers > > Acked-by: Willem de Bruijn > > Thanks. This also matches local variable socks as used to calculate i > and j with reciprocal_scale immediately above. > > Please mark fixes [PATCH net] in the future. And please don't wrap the fixes tags. Applied, thanks!