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: <20241003151601.2404a28c@kernel.org>
Date: Thu, 3 Oct 2024 15:16:01 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: martin.lau@...ux.dev, razor@...ckwall.org, jrife@...gle.com,
 tangchen.1@...edance.com, bpf@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH bpf-next 1/4] netkit: Add option for scrubbing skb meta
 data

On Thu,  3 Oct 2024 20:03:17 +0200 Daniel Borkmann wrote:
> +static int netkit_check_scrub(int scrub, struct nlattr *tb,
> +			      struct netlink_ext_ack *extack)
> +{
> +	switch (scrub) {
> +	case NETKIT_SCRUB_DEFAULT:
> +	case NETKIT_SCRUB_NONE:
> +		return 0;
> +	default:
> +		NL_SET_ERR_MSG_ATTR(extack, tb,
> +				    "Provided device scrub setting can only be default/none");
> +		return -EINVAL;
> +	}
> +}

Set the parsing policy to NLA_POLICY_MAX(NLA_U32, NETKIT_SCRUB_NONE)
and delete this open coded checking, please.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ