diff mbox

[v2,net,1/2] net sched actions: fix access to uninitialized data

Message ID 20170418101322.27666-1-w.bumiller@proxmox.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Wolfgang Bumiller April 18, 2017, 10:13 a.m. UTC
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
(same as v1)

 net/sched/act_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jamal Hadi Salim April 18, 2017, 12:51 p.m. UTC | #1
On 17-04-18 06:13 AM, Wolfgang Bumiller wrote:
> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
> Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
> ---
> (same as v1)
>
>  net/sched/act_api.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index b70aa57319ea..8cc883c063f0 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -604,7 +604,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
>  	if (err < 0)
>  		goto err_mod;
>
> -	if (tb[TCA_ACT_COOKIE]) {
> +	if (name == NULL && tb[TCA_ACT_COOKIE]) {
>  		int cklen = nla_len(tb[TCA_ACT_COOKIE]);
>
>  		if (cklen > TC_COOKIE_MAX_SIZE) {
>

This one looks good.

cheers,
jamal
Daniel Borkmann April 19, 2017, 9:02 a.m. UTC | #2
Hi Wolfgang,

On 04/18/2017 12:13 PM, Wolfgang Bumiller wrote:
[...]

Since this patch goes to -net tree and is a bug fix, please
also add a proper analysis into the commit log instead of
just an empty commit message.

A Fixes tag to your bug fix would also be appropriate, so
that this helps tracking follow-ups to the original commit
that introduced the code. For this one, should be:

Fixes: 1045ba77a596 ("net sched actions: Add support for user cookies")

> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
> Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

Thanks,
Daniel
diff mbox

Patch

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index b70aa57319ea..8cc883c063f0 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -604,7 +604,7 @@  struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
 	if (err < 0)
 		goto err_mod;
 
-	if (tb[TCA_ACT_COOKIE]) {
+	if (name == NULL && tb[TCA_ACT_COOKIE]) {
 		int cklen = nla_len(tb[TCA_ACT_COOKIE]);
 
 		if (cklen > TC_COOKIE_MAX_SIZE) {