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:   Mon, 17 Oct 2022 13:00:55 +0100
From:   Edward Cree <ecree.xilinx@...il.com>
To:     Jiri Pirko <jiri@...nulli.us>, ecree@...inx.com
Cc:     netdev@...r.kernel.org, linux-net-drivers@....com,
        davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
        edumazet@...gle.com, habetsm.xilinx@...il.com,
        johannes@...solutions.net, marcelo.leitner@...il.com
Subject: Re: [RFC PATCH net-next 1/3] netlink: add support for formatted
 extack messages

On 13/10/2022 13:55, Jiri Pirko wrote:
> Fri, Oct 07, 2022 at 03:25:12PM CEST, ecree@...inx.com wrote:
>> #define NL_SET_ERR_MSG_MOD(extack, msg)			\
>> 	NL_SET_ERR_MSG((extack), KBUILD_MODNAME ": " msg)
>>
>> +#define NL_SET_ERR_MSG_FMT_MOD(extack, fmt, args...)	\
> 
> I wonder, wouldn't it be better to just have NL_SET_ERR_MSG_MOD which
> accepts format string and that's it. I understand there is an extra
> overhead for the messages that don't use formatting, but do we care?
> This is no fastpath and usually happens only seldom. The API towards
> the driver would be more simple.

Could do, but this way a fixed string isn't limited to
 NETLINK_MAX_FMTMSG_LEN like it would be if we tried to stuff it
 in _msg_buf.  Unless you're suggesting some kind of macro magic
 that detects whether args is empty and chooses which
 implementation to use, but that seems like excessive hidden
 cleverness — better to have driver authors aware of the
 limitations of each choice.

> I like this a lot!
:)

Powered by blists - more mailing lists