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-next>] [day] [month] [year] [list]
Date: Thu, 10 Aug 2023 20:53:02 +0800
From: Gang Li <gang.li@...ux.dev>
To: Michal Kubecek <mkubecek@...e.cz>
Cc: netdev@...r.kernel.org
Subject: [PATCH 1/1] netlink: allow nl_sset return -EOPNOTSUPP to fallback to
 do_sset

netlink: Allow nl_sset return -EOPNOTSUPP to fallback to do_sset

Currently, nl_sset treats any negative value returned by nl_parser
(including -EOPNOTSUPP) as `1`. Consequently, netlink_run_handler
directly calls exit without returning to main and invoking do_sset
through ioctl_init.

To fallback to do_sset, this commit allows nl_sset return -EOPNOTSUPP.

Fixes: 392b12e ("netlink: add netlink handler for sset (-s)")
Signed-off-by: Gang Li <gang.li@...ux.dev>
---
  netlink/settings.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/netlink/settings.c b/netlink/settings.c
index 9aad8d9..a506618 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -1342,6 +1342,9 @@ int nl_sset(struct cmd_context *ctx)
  	nlctx->devname = ctx->devname;

  	ret = nl_parser(nlctx, sset_params, NULL, PARSER_GROUP_MSG, msgbuffs);
+	if (ret == -EOPNOTSUPP)
+		return ret;
+
  	if (ret < 0) {
  		ret = 1;
  		goto out_free;
-- 
2.20.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ