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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <pj41zlsfdxymx0.fsf@u570694869fb251.ant.amazon.com>
Date:   Wed, 22 Mar 2023 14:39:49 +0200
From:   Shay Agroskin <shayagr@...zon.com>
To:     Paolo Abeni <pabeni@...hat.com>
CC:     David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, <netdev@...r.kernel.org>,
        "Woodhouse, David" <dwmw@...zon.com>,
        "Machulsky, Zorik" <zorik@...zon.com>,
        "Matushevsky, Alexander" <matua@...zon.com>,
        Saeed Bshara <saeedb@...zon.com>,
        "Wilson, Matt" <msw@...zon.com>,
        "Liguori, Anthony" <aliguori@...zon.com>,
        "Bshara, Nafea" <nafea@...zon.com>,
        "Belgazal, Netanel" <netanel@...zon.com>,
        "Saidi, Ali" <alisaidi@...zon.com>,
        "Herrenschmidt, Benjamin" <benh@...zon.com>,
        "Kiyanovski, Arthur" <akiyano@...zon.com>,
        "Dagan, Noam" <ndagan@...zon.com>,
        "Arinzon, David" <darinzon@...zon.com>,
        "Itzko, Shahar" <itzko@...zon.com>,
        "Abboud, Osama" <osamaabb@...zon.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Vladimir Oltean <vladimir.oltean@....com>,
        Andrew Lunn <andrew@...n.ch>,
        Guangbin Huang <huangguangbin2@...wei.com>,
        Jie Wang <wangjie125@...wei.com>,
        Johannes Berg <johannes@...solutions.net>,
        Edward Cree <ecree.xilinx@...il.com>,
        Florian Westphal <fw@...len.de>
Subject: Re: [PATCH v6 net-next 1/7] netlink: Add a macro to set policy message with
 format string


Paolo Abeni <pabeni@...hat.com> writes:

> CAUTION: This email originated from outside of the 
> organization. Do not click links or open attachments unless you 
> can confirm the sender and know the content is safe.
>
>
>
> On Mon, 2023-03-20 at 15:25 +0200, Shay Agroskin wrote:
>> Similar to NL_SET_ERR_MSG_FMT, add a macro which sets netlink 
>> policy
>> error message with a format string.
>>
>> Signed-off-by: Shay Agroskin <shayagr@...zon.com>
>> ---
>>  include/linux/netlink.h | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/include/linux/netlink.h b/include/linux/netlink.h
>> index 3e8743252167..2ca76ec1fc33 100644
>> --- a/include/linux/netlink.h
>> +++ b/include/linux/netlink.h
>> @@ -161,9 +161,22 @@ struct netlink_ext_ack {
>>       }                                                       \
>>  } while (0)
>>
>> +#define NL_SET_ERR_MSG_ATTR_POL_FMT(extack, attr, pol, fmt, 
>> args...) do {    \
>> +     struct netlink_ext_ack *__extack = (extack); 
>> \
>> + 
>> \
>> +     if (__extack) { 
>> \
>> +             NL_SET_ERR_MSG_FMT(extack, fmt, ##args); 
>> \

Thanks for reviewing the patch

>
> You should use '__extack' even above, to avoid multiple 
> evaluation of
> the 'extack' expression.

I've got to admit that I don't understand the cost of such 
evaluations. I thought that it was added to help readers of the 
source code to understand what is the type of this attribute and 
have a better warning message when the wrong variable is passed 
(kind of typing in Python which isn't strictly needed).
What cost is there for casting a pointer ?

>
> Side note: you dropped the acked-by/revied-by tags collected on
> previous iterations, you could and should have retained them for 
> the
> unmodified patches.

Yap that's an oversight by my side. Forgot to do it in the last 
patchset. I'll make sure to do it in the next patchset

>
> Thanks,
>
> Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ