public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Flavio Leitner <fbl@sysclose.org>
To: Ilya Maximets <i.maximets@ovn.org>
Cc: netdev@vger.kernel.org, dev@openvswitch.org,
	linux-kernel@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Simon Horman <horms@kernel.org>, Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [ovs-dev] [PATCH net-next] net: openvswitch: allow providing upcall pid for the 'execute' command
Date: Thu, 3 Jul 2025 08:04:11 -0300	[thread overview]
Message-ID: <20250703080411.21c45920@uranium> (raw)
In-Reply-To: <5c0e9359-6bdd-4d49-b427-8fd1e8802b7c@ovn.org>

On Thu, 3 Jul 2025 10:38:49 +0200
Ilya Maximets <i.maximets@ovn.org> wrote:

> On 7/3/25 1:08 AM, Flavio Leitner wrote:
> >>>> @@ -651,6 +654,10 @@ static int ovs_packet_cmd_execute(struct sk_buff
> >>>> *skb, struct genl_info *info) !!(hash & OVS_PACKET_HASH_L4_BIT));
> >>>>  	}
> >>>>  
> >>>> +	if (a[OVS_PACKET_ATTR_UPCALL_PID])
> >>>> +		upcall_pid =
> >>>> nla_get_u32(a[OVS_PACKET_ATTR_UPCALL_PID]);
> >>>> +	OVS_CB(packet)->upcall_pid = upcall_pid;  
> > 
> > Since this is coming from userspace, does it make sense to check if the
> > upcall_pid is one of the pids in the dp->upcall_portids array?  
> 
> Not really.  IMO, this would be an unnecessary artificial restriction.
> We're not concerned about security here since OVS_PACKET_CMD_EXECUTE
> requires the same privileges as the OVS_DP_CMD_NEW or the
> OVS_DP_CMD_SET.

What if the userspace is buggy or compromised?
It seems netlink API will return -ECONNREFUSED and the upcall is dropped.
Therefore, we would be okay either way, correct?


  reply	other threads:[~2025-07-03 11:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 22:01 [PATCH net-next] net: openvswitch: allow providing upcall pid for the 'execute' command Ilya Maximets
2025-06-27 22:09 ` Ilya Maximets
2025-07-02  2:21 ` Jakub Kicinski
2025-07-02  8:10   ` Ilya Maximets
2025-07-02 12:14 ` Aaron Conole
2025-07-02 12:37   ` Ilya Maximets
2025-07-02 12:46     ` Aaron Conole
2025-07-02 13:53 ` [ovs-dev] " Flavio Leitner
2025-07-02 14:41   ` Ilya Maximets
2025-07-02 23:08     ` Flavio Leitner
2025-07-03  8:38       ` Ilya Maximets
2025-07-03 11:04         ` Flavio Leitner [this message]
2025-07-03 11:15           ` Ilya Maximets
2025-07-03 11:26             ` Flavio Leitner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250703080411.21c45920@uranium \
    --to=fbl@sysclose.org \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=i.maximets@ovn.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox