From: Ben Pfaff Date: Tue, 16 Jun 2009 21:16:14 +0000 (-0700) Subject: datapath: Remove unnecessary range check from put_actions(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f8c6cfb506aad3b9b498917878e65149c3b67b2;p=openvswitch datapath: Remove unnecessary range check from put_actions(). This code checked that the number of actions in a flow query did not exceed the maximum number of actions that are allowed on a given flow. But this check is unnecessary, since the code will never copy out any more actions than actually exist in a flow. It would be a shame to refuse a flow query simply on the basis that the caller allocated more memory than necessary, so eliminate the check. --- diff --git a/datapath/datapath.c b/datapath/datapath.c index 14d83cd9..ceaed153 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -959,8 +959,6 @@ static int put_actions(const struct sw_flow *flow, struct odp_flow __user *ufp) if (!n_actions) return 0; - if (ufp->n_actions > INT_MAX / sizeof(union odp_action)) - return -EINVAL; sf_acts = rcu_dereference(flow->sf_acts); if (__put_user(sf_acts->n_actions, &ufp->n_actions) ||