[ovs-git] Open vSwitch: datapath: Check device name length more carefully in create_dp(). (master)

dev at openvswitch.org dev at openvswitch.org
Tue Apr 27 18:21:35 UTC 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  968f7c8d772e704ff96bd2923d474c7f969c7c6b (commit)
       via  092a872d6e8009ef547dc66274936dc879c55419 (commit)
       via  1224e8fc1da9cddef6bdb24814300893bb2ace89 (commit)
      from  43253595291318833572088595769b45a79c9c54 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 968f7c8d772e704ff96bd2923d474c7f969c7c6b
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=968f7c8d772e704ff96bd2923d474c7f969c7c6b
Author: Ben Pfaff <blp at nicira.com>
		
datapath: Check device name length more carefully in create_dp().
		
I don't see any value in silently truncating device names.  Doing so will
sow confusion in userspace.  This commit makes too-long device names
return ENAMETOOLONG.


commit 092a872d6e8009ef547dc66274936dc879c55419
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=092a872d6e8009ef547dc66274936dc879c55419
Author: Ben Pfaff <blp at nicira.com>
		
datapath: Always null-terminate network device name in create_dp().
		
strncpy() does not null-terminate its output buffer if the source string's
length is at least as large as its 'count' argument.  We know that the
source and destination buffers are the same size and that the source buffer
is null-terminated, so just use strcpy().

This fixes a kernel BUG message that often occurred when strlen(devname)
was exactly IFNAMSIZ-1.  In such a case, if
internal_dev_port.devname[IFNAMSIZ-1] happened to be nonzero, it would
eventually fail the following check in alloc_netdev_mq():
	BUG_ON(strlen(name) >= sizeof(dev->name));

Bug #2722.


commit 1224e8fc1da9cddef6bdb24814300893bb2ace89
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=1224e8fc1da9cddef6bdb24814300893bb2ace89
Author: Ben Pfaff <blp at nicira.com>
		
datapath: Fix argument to strncpy_from_user().
		
The strncpy_from_user() function's 'count' argument is documented to
include the trailing null byte, but create_dp() did not include it.  This
commit adds it in.


-----------------------------------------------------------------------

Summary of changes:
 datapath/datapath.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Open vSwitch




More information about the git mailing list