lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 29 Jan 2020 11:11:16 +0100 (CET)
From:   David Miller <davem@...emloft.net>
To:     vinicius.gomes@...el.com
Cc:     netdev@...r.kernel.org, jhs@...atatu.com, xiyou.wangcong@...il.com,
        jiri@...nulli.us, vladimir.oltean@....com, po.liu@....com
Subject: Re: [PATCH net v2 1/3] taprio: Fix enabling offload with wrong
 number of traffic classes

From: Vinicius Costa Gomes <vinicius.gomes@...el.com>
Date: Tue, 28 Jan 2020 15:52:25 -0800

> @@ -1444,6 +1444,19 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
>  
>  	taprio_set_picos_per_byte(dev, q);
>  
> +	if (mqprio) {
> +		netdev_set_num_tc(dev, mqprio->num_tc);
> +		for (i = 0; i < mqprio->num_tc; i++)
> +			netdev_set_tc_queue(dev, i,
> +					    mqprio->count[i],
> +					    mqprio->offset[i]);
> +
> +		/* Always use supplied priority mappings */
> +		for (i = 0; i <= TC_BITMASK; i++)
> +			netdev_set_prio_tc_map(dev, i,
> +					       mqprio->prio_tc_map[i]);
> +	}
> +
>  	if (FULL_OFFLOAD_IS_ENABLED(taprio_flags))
>  		err = taprio_enable_offload(dev, mqprio, q, new_admin, extack);
>  	else

This feedback applies to the existing code too, but don't we need to have
a call to netdev_reset_tc() in the error paths after we commit these
settings?

Because ->num_tc for the device should be reset to zero for sure if we
can't complete this configuration change successfully.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ