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]
Date:   Fri, 18 Oct 2019 18:58:23 +0200
From:   Jiri Pirko <jiri@...nulli.us>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     netdev@...r.kernel.org, davem@...emloft.net,
        jakub.kicinski@...ronome.com, andrew@...n.ch, mlxsw@...lanox.com
Subject: Re: [patch net-next] devlink: add format requirement for devlink
 param names

Fri, Oct 18, 2019 at 06:35:09PM CEST, stephen@...workplumber.org wrote:
>On Fri, 18 Oct 2019 18:07:26 +0200
>Jiri Pirko <jiri@...nulli.us> wrote:
>
>> +static bool devlink_param_valid_name(const char *name)
>> +{
>> +	int len = strlen(name);
>> +	int i;
>> +
>> +	/* Name can contain lowercase characters or digits.
>> +	 * Underscores are also allowed, but not at the beginning
>> +	 * or end of the name and not more than one in a row.
>> +	 */
>> +
>> +	for (i = 0; i < len; i++) {
>> +		if (islower(name[i]) || isdigit(name[i]))
>> +			continue;
>> +		if (name[i] != '_')
>> +			return false;
>> +		if (i == 0 || i + 1 == len)
>> +			return false;
>> +		if (name[i - 1] == '_')
>> +			return false;
>> +	}
>> +	return true;
>> +}
>
>You might want to also impose a maximum length on name,

Well I don't really see why.

>and not allow slash in name (if you ever plan to use sysfs).

They are not allowed. Only islower, isdigit, '_'. That's it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ