[ovs-git] [openvswitch/ovs] 5e27fe: classifier: Fix race condition leading to NULL der...

GitHub noreply at github.com
Sun Apr 17 16:44:09 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 5e27fe9781132d50cc5af88b1d98e15c3c033b91
      https://github.com/openvswitch/ovs/commit/5e27fe9781132d50cc5af88b1d98e15c3c033b91
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M lib/classifier-private.h
    M lib/classifier.c
    M lib/classifier.h
    M tests/test-classifier.c

  Log Message:
  -----------
  classifier: Fix race condition leading to NULL dereference.

Addition of table versioning exposed struct cls_rule member
'cls_match' to RCU readers and made it possible for 'cls_match' become
NULL while being accessed by an RCU reader, but we failed to check for
this condition.  This may have resulted in NULL pointer dereference
and ovs-vswitchd crash.

Fix this by making the 'cls_match' member an RCU pointer and checking
the value whenever it potentially read by an RCU reader.  In these
instances we use ovsrcu_get(), whereas functions accessible only by
the exclusive writers use ovsrcu_get_protected() and do not need to
check the result.

VMware-BZ: 1643642
Fixes: 2b7b1427 ("classifier: Support table versioning")
Signed-off-by: Jarno Rajahalme <jarno at ovn.org>


  Commit: d87091c2a1f9d3db1a2352eba1b609405122d15a
      https://github.com/openvswitch/ovs/commit/d87091c2a1f9d3db1a2352eba1b609405122d15a
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M lib/classifier.h

  Log Message:
  -----------
  classifier: Reorganize classifier.h

Group functions clearly to ones accessible by exclusive writers only
and ones accessible to RCU readers as well.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/8ff5a966b8a5...d87091c2a1f9


More information about the git mailing list