From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mail.toke.dk (Postfix) with ESMTPS id 14D259C8187 for ; Tue, 29 Nov 2022 21:50:22 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WKzXT7R0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669755021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=e6YTHm9ddj51ycKVd3tWvOmE8DsgiVPRbFrXrJ2j+a4=; b=WKzXT7R0qOTWx4ViUjo3BogObZzKeOrWPGqqEl5Fe2TyCeuGr4AA/+iSzj+HlIvQq0NptH 8I/ebEUzf3J8iIqAUeoBc9FNNDZZGVx5Jq9TedvqmMSmlN/kSDaMW/VvUucPK4EJLZtsee bb7Q2fmHcB45/EXaruJtsna2BQ0xAPY= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-447-Im_TMpayOMC33X6NJ8ZUTg-1; Tue, 29 Nov 2022 15:50:17 -0500 X-MC-Unique: Im_TMpayOMC33X6NJ8ZUTg-1 Received: by mail-ej1-f71.google.com with SMTP id xh12-20020a170906da8c00b007413144e87fso7136247ejb.14 for ; Tue, 29 Nov 2022 12:50:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=e6YTHm9ddj51ycKVd3tWvOmE8DsgiVPRbFrXrJ2j+a4=; b=aTY54DPacnqtVRvUByWuZbWX/UF8HgfT2VdZt40etxR++toP16AZo86Zp9/JRlVoIo BZ1IjI7RpBlBy02/gSlvfO5ZMhED9aJK4YB9R5tM3tRIW2H3Sa71sBUOScvYQ1lzLKaQ CCRfcA7zX3RVOeut60moTjHmHRwfQ7G6hZ7Uf3hNnf61NNg85Du3ESP1EoPEvLQcFebE ng5IdmGx3Z3fBO3prH2u1f8YIMMYWmkrV4mjNGSMgMFkwmKG7eX3LQS3Ueg3aQAPi6mZ 2ry42yCMou3aOYJl6Dc6gPpeOcz8XfdyzFlz+mNClZ/us38QNbDXRtvMwU2uC6NVNjd0 Pp4g== X-Gm-Message-State: ANoB5pm80knwV2KWPLnNSgLvQtF+JwuaFs+6FdvivbgFzgHDLn6rsRay eY27c4UNOBZzEqwZ1LgkxVrFOxdBHLpwIZGE5Edv1cNz095mnH16B0BLZ0Ro72DzEPpStu5aDHm zlMp60f7RmToKNoYjvthP X-Received: by 2002:aa7:d34b:0:b0:46a:914c:9bc9 with SMTP id m11-20020aa7d34b000000b0046a914c9bc9mr24782773edr.418.1669755016270; Tue, 29 Nov 2022 12:50:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf4DSLtw0a3VL6pY53w8JHaW41rE+NRi4z6GaxNcoLERHT5Jw0Sx+mhZnhws5hbpWWpqEYQARQ== X-Received: by 2002:aa7:d34b:0:b0:46a:914c:9bc9 with SMTP id m11-20020aa7d34b000000b0046a914c9bc9mr24782750edr.418.1669755015914; Tue, 29 Nov 2022 12:50:15 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id e1-20020a170906c00100b00787f91a6b16sm6560571ejz.26.2022.11.29.12.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 12:50:15 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 0E92780AC52; Tue, 29 Nov 2022 21:50:14 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Stanislav Fomichev , bpf@vger.kernel.org In-Reply-To: <20221129193452.3448944-1-sdf@google.com> References: <20221129193452.3448944-1-sdf@google.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Tue, 29 Nov 2022 21:50:14 +0100 Message-ID: <8735a1zdrt.fsf@toke.dk> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Message-ID-Hash: 6CD3H3HIZL3GLGHUOWZ2BWT25QJUNVLA X-Message-ID-Hash: 6CD3H3HIZL3GLGHUOWZ2BWT25QJUNVLA X-MailFrom: toke@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v3 00/11] xdp: hints via kfuncs List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Stanislav Fomichev writes: > Please see the first patch in the series for the overall > design and use-cases. > > Changes since v2: > > - Rework bpf_prog_aux->xdp_netdev refcnt (Martin) > > Switched to dropping the count early, after loading / verification is > done. At attach time, the pointer value is used only for comparing > the actual netdev at attach vs netdev at load. So if we're not holding the netdev reference, we'll end up with a BPF program with hard-coded CALL instructions calling into a module that could potentially be unloaded while that BPF program is still alive, right? I suppose that since we're checking that the attach iface is the same that the program should not be able to run after the module is unloaded, but it still seems a bit iffy. And we should definitely block BPF_PROG_RUN invocations of programs with a netdev set (but we should do that anyway). > (potentially can be a problem if the same slub slot is reused > for another netdev later on?) Yeah, this would be bad as well, obviously. I guess this could happen? -Toke