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] [day] [month] [year] [list]
Date:   Tue, 17 Jan 2023 19:51:09 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Paul Blakey <paulb@...dia.com>
Cc:     <netdev@...r.kernel.org>, Saeed Mahameed <saeedm@...dia.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Oz Shlomo <ozsh@...dia.com>, Jiri Pirko <jiri@...dia.com>,
        Roi Dayan <roid@...dia.com>, Vlad Buslov <vladbu@...dia.com>
Subject: Re: [PATCH net-next v2 2/6] net/sched: flower: Move filter handle
 initialization earlier

On Tue, 17 Jan 2023 10:33:40 +0200 Paul Blakey wrote:
> +	if (!fold) {
> +		spin_lock(&tp->lock);
> +		if (!handle) {
> +			handle = 1;
> +			err = idr_alloc_u32(&head->handle_idr, fnew, &handle,
> +					    INT_MAX, GFP_ATOMIC);
> +			if (err)
> +				goto errout;

sparse says you should release the spin lock

> +		} else {
> +			err = idr_alloc_u32(&head->handle_idr, fnew, &handle,
> +					    handle, GFP_ATOMIC);
> +
> +			/* Filter with specified handle was concurrently
> +			 * inserted after initial check in cls_api. This is not
> +			 * necessarily an error if NLM_F_EXCL is not set in
> +			 * message flags. Returning EAGAIN will cause cls_api to
> +			 * try to update concurrently inserted rule.
> +			 */
> +			if (err == -ENOSPC)
> +				err = -EAGAIN;
> +		}
> +		spin_unlock(&tp->lock);
> +
> +		if (err)
> +			goto errout;
> +	}
> +	fnew->handle = handle;
> +
> +	err = tcf_exts_init(&fnew->exts, net, TCA_FLOWER_ACT, 0);
> +	if (err < 0)
> +		goto errout_idr;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ