netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jesse@nicira.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net v2] openvswitch: Zero flows on allocation.
Date: Tue, 22 Sep 2015 17:34:06 -0700 (PDT)	[thread overview]
Message-ID: <20150922.173406.335952800771776043.davem@davemloft.net> (raw)
In-Reply-To: <1442892080-68516-1-git-send-email-jesse@nicira.com>

From: Jesse Gross <jesse@nicira.com>
Date: Mon, 21 Sep 2015 20:21:20 -0700

> When support for megaflows was introduced, OVS needed to start
> installing flows with a mask applied to them. Since masking is an
> expensive operation, OVS also had an optimization that would only
> take the parts of the flow keys that were covered by a non-zero
> mask. The values stored in the remaining pieces should not matter
> because they are masked out.
> 
> While this works fine for the purposes of matching (which must always
> look at the mask), serialization to netlink can be problematic. Since
> the flow and the mask are serialized separately, the uninitialized
> portions of the flow can be encoded with whatever values happen to be
> present.
> 
> In terms of functionality, this has little effect since these fields
> will be masked out by definition. However, it leaks kernel memory to
> userspace, which is a potential security vulnerability. It is also
> possible that other code paths could look at the masked key and get
> uninitialized data, although this does not currently appear to be an
> issue in practice.
> 
> This removes the mask optimization for flows that are being installed.
> This was always intended to be the case as the mask optimizations were
> really targetting per-packet flow operations.
> 
> Fixes: 03f0d916 ("openvswitch: Mega flow implementation")
> Signed-off-by: Jesse Gross <jesse@nicira.com>

Applied and queued up for -stable, thanks.

      parent reply	other threads:[~2015-09-23  0:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22  3:21 [PATCH net v2] openvswitch: Zero flows on allocation Jesse Gross
2015-09-22 23:57 ` Pravin Shelar
2015-09-23  0:34 ` David Miller [this message]

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=20150922.173406.335952800771776043.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jesse@nicira.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).