Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3067157lqo; Tue, 14 May 2024 20:32:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpQfQ2dMQNKOhovKxumccam7040A5+x6c3ydIrZrysHNYixSr5omwN5nftgUP4dML+x3Y/fc/TgGJ7gOZT7WUrJ5IB4vpt4N2tKPwLzA== X-Google-Smtp-Source: AGHT+IGD+8alZJ9MyVt7XRoRjNXRQ8bqXvPC6z1SXDXBCAsaxGnhxYBuwnREeMbJ6u3qB7L20+T0 X-Received: by 2002:a05:6102:14a2:b0:47e:eeaa:90af with SMTP id ada2fe7eead31-48077eb6456mr17836305137.34.1715743976485; Tue, 14 May 2024 20:32:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715743976; cv=pass; d=google.com; s=arc-20160816; b=V1XsFgAmp/v7e4w63MEbj8AzYUsoA1GvEPBBGR2kU6Bf1J6acqAMBy4I58hicHMifH 0pc5nSY79jNIlKolqdPq4nv5fD6Orx07hpkqJXa5dgBE4/5GzQfJ90062X9k2EQmlUh9 GNxuZapx1GZ2wSm+0Pgckk1KXk+gBttK+FLC4BDtbFrqnyG7Lj1+RUytUigAKFZOlFYQ osfQWiV357Haw78wFoCm0N377ZDPFKAwogkbXm+RQkQK2JfwbRHuo7TT052YR3tJM9ZW lyUXVoMoqXRBGx+pASUN82ODkgBITqho6Eh7cm61cIuifdQGJV8CH/iN8nRrPuM+jU04 TH3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=n78oaAZRyO+VAfWO7SduK6Bbx6aSAbla91zbFFaUVww=; fh=zVWhlVdEZkWkXHcGSFt20PjQVPkq1G7+lP91nmrtZ14=; b=zBETdVX8OLIRWwXOZs3PnjoikqYkr7e4lQFCrje6JkiiyxeBADkHByf/wBFStWDvzI brCGPXwK2dWyd7NOex0CbeEqauMY+lIpCz+I9HoQ2Lp1hk40cr2y3ZPWYb5J74Ev6Par RS4fmbcFB8OF0piDCVzvGc4mFGPToh3W+NdncXgbVhhNh8oWYE+qAuoKScxrrSgUgHLN sIOTWyofGFFnrJvf0wXBZXgzJlmobcys9dLwCAdos7ZlqI6a5MTE1iD6gZImqlBPHfGf eztGyHYFgeBgKefwv9xVmSmmgQYsWbmIQ/tO1qYYorhCJbOuWqEYSN4tKZL0sgvtwYA8 KdXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=IQFb+fnc; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-179375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179375-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df549edb1si132884241cf.148.2024.05.14.20.32.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 20:32:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=IQFb+fnc; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-179375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179375-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 397EC1C21027 for ; Wed, 15 May 2024 03:32:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67140383A0; Wed, 15 May 2024 03:32:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="IQFb+fnc" Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B874B38385 for ; Wed, 15 May 2024 03:32:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715743965; cv=none; b=GxuAm09lltvPzGBiDuks2yz30CYhazzuKmSNkh5AID+Ye3QOgcJfQXfGXhb6v7j52Im3Qs7hLRK8anHAQX99pLBl8xJu4I6MEHIPPbzdLcS6VdXGHJ7LfqUrXSM39Jqak59dUCquVr69zdRzr8gww14NtzaV8KVj3yoQ6l8TQRc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715743965; c=relaxed/simple; bh=IwjxX6lGjtRR4HsC+Tx98ybpDz/8CNenXrNP0R7dQk8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=sqrLoo2bz0xI2+Bwf3HZf9U4XNiLlgV2LACz+/zV+As3EGx/mOSLjG+Tm8rKVPEN7QJzVcFtxD4+FDkztMuXDUOkKdqp9vci2Il3l12xUr3MG8zrUp/ZoE/wQAamffl+QSaA2ClbcOHd3c/cVaRHQPNaRJZIOJbw+J0vXuzNOkk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=IQFb+fnc; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a59ce1e8609so124764166b.0 for ; Tue, 14 May 2024 20:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1715743962; x=1716348762; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=n78oaAZRyO+VAfWO7SduK6Bbx6aSAbla91zbFFaUVww=; b=IQFb+fnchIRC7GqVva+r8lW7Xi4SHJiGntne8eKqzYa3ARlBxbtWGrrJyALoWIuw7c mz4PZmkXItCiBUybEh9TtE4Aj3DdzPeckGDAqDQ5H3XgFWnDYuCEyyGUDFCA6WxmPQ/K Gw2poZGgOlhCEx+0YxVFQs+IydHtdsQ4/5x1c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715743962; x=1716348762; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n78oaAZRyO+VAfWO7SduK6Bbx6aSAbla91zbFFaUVww=; b=kR5KpM8+8poMyY58fjFUB60MiWN9cu3WLbSa26NAIrKanIP73L0PVEO8TW0gNQawMi 4TYxC8rRnCK54A9F3CW2E6OCEseWkAemCRVvPc5dL8TPnhaZsqdsnrkeBQ+rSLskHCaF H5mQNX4FemEq4+PPxMFmAHrbe6CdKN5LgCQODJvkRHT9umMA4wBR+CchsDxqqMsBLnSd Ko9v68WdcRMc0LFK+4MUfFbAGtb2qGJCRBhVXvq9LdK8y6g/JmoEHFbLJ2XVJkXOcY7+ md1rJOIem36L2kGSAVVl+/VUv6DcLdhuWjrVVpTF1esdrfkJAwm0jw753jSk/s6kvMub jdyw== X-Forwarded-Encrypted: i=1; AJvYcCVwZTrus/jeWpkn5y+hmUlhNS6YtE06AH3kGNsFPxQ90BFLDUQDYVcgfxJjLfuBjKgEXk0wR1OATFL7qm/9neYYKHjoL8NXY+Cbopaq X-Gm-Message-State: AOJu0YxD837cfm9NamJfSvn0fMOad+XIl29g7sfc75hT39xi/zCN+MI0 mu/CgE4vmNuY2b38gGZny86TaH1hEg+G0SS+cjPif8vG7GhsaKlcT5+BN44m6MZhuZvLQ3SKF0d 9udsxcw== X-Received: by 2002:a17:907:7dac:b0:a59:adb9:6c2a with SMTP id a640c23a62f3a-a5a115ef957mr1883983666b.11.1715743961697; Tue, 14 May 2024 20:32:41 -0700 (PDT) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com. [209.85.218.53]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b17d02sm798722266b.218.2024.05.14.20.32.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 May 2024 20:32:41 -0700 (PDT) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a59a609dd3fso135423966b.0 for ; Tue, 14 May 2024 20:32:41 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUysFbKoQ+Ci2m30YHJONv616gTmTgykuN9q+UO/Lq2Tk3hLHZNeNRFL13APRXBsd5Dk99I6DSpqvdrjWi8EOlmG3GREt3ByqSlMDge X-Received: by 2002:a17:906:70f:b0:a5a:7493:5b68 with SMTP id a640c23a62f3a-a5a74935c7emr527515666b.24.1715743960872; Tue, 14 May 2024 20:32:40 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240514231155.1004295-1-kuba@kernel.org> In-Reply-To: <20240514231155.1004295-1-kuba@kernel.org> From: Linus Torvalds Date: Tue, 14 May 2024 20:32:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] Networking for v6.10 To: Jakub Kicinski Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, pabeni@redhat.com, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Tue, 14 May 2024 at 16:12, Jakub Kicinski wrote: > > Full disclosure I hit a KASAN OOB read warning in BPF when testing > on Meta's production servers (which load a lot of BPF). > BPF folks aren't super alarmed by it, and also they are partying at > LSFMM so I don't think it's worth waiting for the fix. > But you may feel differently... https://pastebin.com/0fzqy3cW Hmm. As long as people are aware of it, I don't think a known issue needs to hold up any pull request. Even if that whole 'struct bpf_map can be embedded in many different structures", combined with "users just magically know which structure it is and use container_of()" looks like a horrid pattern. Why does it do that disgusting struct bpf_array *array = container_of(map, struct bpf_array, map); ... *insn++ = BPF_ALU32_IMM(BPF_AND, BPF_REG_0, array->index_mask); thing? As far as I can tell, a bpf map can be embedded in many different structures, not just that 'bpf_array' thing. That spectre-v1 code generation is disgusting. But worse, it's stupid. The way to turn the index into a data dependency isn't to just 'and' it with some fixed mask (that is wrong anyway and requires that whole "round up to the next power-of-two), it's to just teach the JIT to generate the proper Spectre-v1 sequence. So that code should be able to rely purely on map->max_entries, and not do that disgusting "look up struct 'bpf_array'" Anyway, I've pulled it - the bpf code looks broken, but it looks fairly straightforward to do it right if I understood that code correctly. Linus