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: <20240809090238.GF3075665@kernel.org>
Date: Fri, 9 Aug 2024 10:02:38 +0100
From: Simon Horman <horms@...nel.org>
To: Donald Hunter <donald.hunter@...il.com>
Cc: Pablo Neira Ayuso <pablo@...filter.org>,
	Jozsef Kadlecsik <kadlec@...filter.org>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
	donald.hunter@...hat.com
Subject: Re: [PATCH nf v1] netfilter: nfnetlink: Initialise extack before use
 in ACKs

On Tue, Aug 06, 2024 at 04:43:24PM +0100, Donald Hunter wrote:
> Add missing extack initialisation when ACKing BATCH_BEGIN and BATCH_END.
> 
> Fixes: bf2ac490d28c ("netfilter: nfnetlink: Handle ACK flags for batch messages")
> Signed-off-by: Donald Hunter <donald.hunter@...il.com>

Hi Donald,

I see two other places that extack is used in nfnetlink_rcv_batch().
Is it safe to leave them as-is?

> ---
>  net/netfilter/nfnetlink.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
> index 4abf660c7baf..932b3ddb34f1 100644
> --- a/net/netfilter/nfnetlink.c
> +++ b/net/netfilter/nfnetlink.c
> @@ -427,8 +427,10 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
>  
>  	nfnl_unlock(subsys_id);
>  
> -	if (nlh->nlmsg_flags & NLM_F_ACK)
> +	if (nlh->nlmsg_flags & NLM_F_ACK) {
> +		memset(&extack, 0, sizeof(extack));
>  		nfnl_err_add(&err_list, nlh, 0, &extack);
> +	}
>  
>  	while (skb->len >= nlmsg_total_size(0)) {
>  		int msglen, type;
> @@ -577,6 +579,7 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
>  			ss->abort(net, oskb, NFNL_ABORT_NONE);
>  			netlink_ack(oskb, nlmsg_hdr(oskb), err, NULL);
>  		} else if (nlh->nlmsg_flags & NLM_F_ACK) {
> +			memset(&extack, 0, sizeof(extack));
>  			nfnl_err_add(&err_list, nlh, 0, &extack);
>  		}
>  	} else {
> -- 
> 2.45.2
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ