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]
Message-ID: <20250721175243.5e620997@kernel.org>
Date: Mon, 21 Jul 2025 17:52:43 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: chia-yu.chang@...ia-bell-labs.com
Cc: alok.a.tiwari@...cle.com, pctammela@...atatu.com, horms@...nel.org,
 donald.hunter@...il.com, xandfury@...il.com, netdev@...r.kernel.org,
 dave.taht@...il.com, pabeni@...hat.com, jhs@...atatu.com,
 stephen@...workplumber.org, xiyou.wangcong@...il.com, jiri@...nulli.us,
 davem@...emloft.net, edumazet@...gle.com, andrew+netdev@...n.ch,
 ast@...erby.net, liuhangbin@...il.com, shuah@...nel.org,
 linux-kselftest@...r.kernel.org, ij@...nel.org, ncardwell@...gle.com,
 koen.de_schepper@...ia-bell-labs.com, g.white@...lelabs.com,
 ingemar.s.johansson@...csson.com, mirja.kuehlewind@...csson.com,
 cheshire@...le.com, rs.ietf@....at, Jason_Livingood@...cast.com,
 vidhi_goel@...le.com
Subject: Re: [PATCH v25 net-next 1/6] sched: Struct definition and parsing
 of dualpi2 qdisc

On Sat, 19 Jul 2025 22:41:24 +0200 chia-yu.chang@...ia-bell-labs.com
wrote:
> +	q = qdisc_priv(sch);
> +	sch_tree_lock(sch);
> +
> +	if (tb[TCA_DUALPI2_STEP_THRESH_PKTS] && tb[TCA_DUALPI2_STEP_THRESH_US]) {
> +		NL_SET_ERR_MSG_MOD(extack, "multiple step thresh attributes");
> +		sch_tree_unlock(sch);
> +		return -EINVAL;
> +	}

tb[] is local state on the stack, parsed from the netlink message
(also local). You can move the:

	q = qdisc_priv(sch);
	sch_tree_lock(sch);

lines after the check and then you won't have to unlock on the error 
path.
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ