From: Joe Stringer <hidden> Date: 2015-10-14 18:10:56
Currently, 0-bits are generated in ct_state where the bit position is
undefined, and matches are accepted on these bit-positions. If userspace
requests to match the 0-value for this bit then it may expect only a
subset of traffic to match this value, whereas currently all packets
will have this bit set to 0. Fix this by rejecting such masks.
Signed-off-by: Joe Stringer <redacted>
---
net/openvswitch/conntrack.h | 11 +++++------
net/openvswitch/flow_netlink.c | 5 ++++-
2 files changed, 9 insertions(+), 7 deletions(-)
From: Joe Stringer <hidden> Date: 2015-10-14 18:10:58
If OVS receives a packet from another namespace, then the packet should
be scrubbed. However, people have already begun to rely on the behaviour
that skb->mark is preserved across namespaces, so retain this one field.
This is mainly to address information leakage between namespaces when
using OVS internal ports, but by placing it in ovs_vport_receive() it is
more generally applicable, meaning it should not be overlooked if other
port types are allowed to be moved into namespaces in future.
Signed-off-by: Joe Stringer <redacted>
---
I originally proposed this patch as part of the conntrack changes to OVS,
and there was some discussion on that thread, culminating here:
http://www.spinics.net/lists/netdev/msg338626.html
We also discussed this a bit in Seattle, however I didn't follow up
immediately so I don't exactly recall what the consensus was. Following
Jesse's direction in the above thread, I'm proposing that we preserve the
mark, but scrub the rest. Also fixed the use-after-free bug present in the
previous version.
I think this is relevant for 'net', because this is the first time that
the metadata_dst and nfct are exposed (albeit indirectly) through OVS so it
would be nice to get agreement on the expected behaviour.
---
net/openvswitch/vport.c | 7 +++++++
1 file changed, 7 insertions(+)
From: Joe Stringer <hidden> Date: 2015-10-14 18:10:59
New, related connections are marked as such as part of ovs_ct_lookup(),
but they are not marked as "new" if the commit flag is used. Make this
consistent by treating IP_CT_RELATED as new as well.
Reported-by: Jarno Rajahalme <redacted>
Signed-off-by: Joe Stringer <redacted>
---
net/openvswitch/conntrack.c | 2 ++
1 file changed, 2 insertions(+)
From: Joe Stringer <hidden> Date: 2015-10-14 18:11:00
If userspace provides a ct action with no nested mark or label, then the
storage for these fields is zeroed. Later when actions are requested,
such zeroed fields are serialized even though userspace didn't
originally specify them. Fix the behaviour by ensuring that no action is
serialized in this case, and reject actions where userspace attempts to
set these fields with mask=0. This should make netlink marshalling
consistent across deserialization/reserialization.
Reported-by: Jarno Rajahalme <redacted>
Signed-off-by: Joe Stringer <redacted>
---
net/openvswitch/conntrack.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
On Wed, Oct 14, 2015 at 11:10 AM, Joe Stringer [off-list ref] wrote:
quoted hunk
If OVS receives a packet from another namespace, then the packet should
be scrubbed. However, people have already begun to rely on the behaviour
that skb->mark is preserved across namespaces, so retain this one field.
This is mainly to address information leakage between namespaces when
using OVS internal ports, but by placing it in ovs_vport_receive() it is
more generally applicable, meaning it should not be overlooked if other
port types are allowed to be moved into namespaces in future.
Signed-off-by: Joe Stringer <redacted>
---
I originally proposed this patch as part of the conntrack changes to OVS,
and there was some discussion on that thread, culminating here:
http://www.spinics.net/lists/netdev/msg338626.html
We also discussed this a bit in Seattle, however I didn't follow up
immediately so I don't exactly recall what the consensus was. Following
Jesse's direction in the above thread, I'm proposing that we preserve the
mark, but scrub the rest. Also fixed the use-after-free bug present in the
previous version.
I think this is relevant for 'net', because this is the first time that
the metadata_dst and nfct are exposed (albeit indirectly) through OVS so it
would be nice to get agreement on the expected behaviour.
---
net/openvswitch/vport.c | 7 +++++++
1 file changed, 7 insertions(+)
On Wed, Oct 14, 2015 at 11:10 AM, Joe Stringer [off-list ref] wrote:
quoted hunk
Currently, 0-bits are generated in ct_state where the bit position is
undefined, and matches are accepted on these bit-positions. If userspace
requests to match the 0-value for this bit then it may expect only a
subset of traffic to match this value, whereas currently all packets
will have this bit set to 0. Fix this by rejecting such masks.
Signed-off-by: Joe Stringer <redacted>
---
net/openvswitch/conntrack.h | 11 +++++------
net/openvswitch/flow_netlink.c | 5 ++++-
2 files changed, 9 insertions(+), 7 deletions(-)
Can you also remove definition of ovs_ct_state_supported() in case
where conntrack is not enabled.
Otherwise looks good.
Acked-by: Pravin B Shelar <redacted>
On Wed, Oct 14, 2015 at 11:10 AM, Joe Stringer [off-list ref] wrote:
New, related connections are marked as such as part of ovs_ct_lookup(),
but they are not marked as "new" if the commit flag is used. Make this
consistent by treating IP_CT_RELATED as new as well.
Reported-by: Jarno Rajahalme <redacted>
Signed-off-by: Joe Stringer <redacted>
On Wed, Oct 14, 2015 at 11:10 AM, Joe Stringer [off-list ref] wrote:
quoted hunk
If userspace provides a ct action with no nested mark or label, then the
storage for these fields is zeroed. Later when actions are requested,
such zeroed fields are serialized even though userspace didn't
originally specify them. Fix the behaviour by ensuring that no action is
serialized in this case, and reject actions where userspace attempts to
set these fields with mask=0. This should make netlink marshalling
consistent across deserialization/reserialization.
Reported-by: Jarno Rajahalme <redacted>
Signed-off-by: Joe Stringer <redacted>
---
net/openvswitch/conntrack.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
From: Joe Stringer <hidden> Date: 2015-10-16 16:06:04
On 14 October 2015 at 17:34, Pravin Shelar [off-list ref] wrote:
On Wed, Oct 14, 2015 at 11:10 AM, Joe Stringer [off-list ref] wrote:
quoted
If OVS receives a packet from another namespace, then the packet should
be scrubbed. However, people have already begun to rely on the behaviour
that skb->mark is preserved across namespaces, so retain this one field.
This is mainly to address information leakage between namespaces when
using OVS internal ports, but by placing it in ovs_vport_receive() it is
more generally applicable, meaning it should not be overlooked if other
port types are allowed to be moved into namespaces in future.
Signed-off-by: Joe Stringer <redacted>
---
I originally proposed this patch as part of the conntrack changes to OVS,
and there was some discussion on that thread, culminating here:
http://www.spinics.net/lists/netdev/msg338626.html
We also discussed this a bit in Seattle, however I didn't follow up
immediately so I don't exactly recall what the consensus was. Following
Jesse's direction in the above thread, I'm proposing that we preserve the
mark, but scrub the rest. Also fixed the use-after-free bug present in the
previous version.
I think this is relevant for 'net', because this is the first time that
the metadata_dst and nfct are exposed (albeit indirectly) through OVS so it
would be nice to get agreement on the expected behaviour.
---
net/openvswitch/vport.c | 7 +++++++
1 file changed, 7 insertions(+)
From: Joe Stringer <hidden> Date: 2015-10-16 16:18:58
On 15 October 2015 at 11:13, Pravin Shelar [off-list ref] wrote:
On Wed, Oct 14, 2015 at 11:10 AM, Joe Stringer [off-list ref] wrote:
quoted
If userspace provides a ct action with no nested mark or label, then the
storage for these fields is zeroed. Later when actions are requested,
such zeroed fields are serialized even though userspace didn't
originally specify them. Fix the behaviour by ensuring that no action is
serialized in this case, and reject actions where userspace attempts to
set these fields with mask=0. This should make netlink marshalling
consistent across deserialization/reserialization.
Reported-by: Jarno Rajahalme <redacted>
Signed-off-by: Joe Stringer <redacted>
---
net/openvswitch/conntrack.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)