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: <20221013082913.0719721e@kernel.org>
Date:   Thu, 13 Oct 2022 08:29:13 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     <edward.cree@....com>
Cc:     <netdev@...r.kernel.org>, <linux-net-drivers@....com>,
        <davem@...emloft.net>, <pabeni@...hat.com>, <edumazet@...gle.com>,
        <habetsm.xilinx@...il.com>, <johannes@...solutions.net>,
        <marcelo.leitner@...il.com>, Edward Cree <ecree.xilinx@...il.com>
Subject: Re: [RFC PATCH v2 net-next 1/3] netlink: add support for formatted
 extack messages

On Thu, 13 Oct 2022 10:23:00 +0100 edward.cree@....com wrote:
> +	if (snprintf(__extack->_msg_buf, NETLINK_MAX_FMTMSG_LEN,	\
> +		     (fmt), ##args) >= NETLINK_MAX_FMTMSG_LEN)		\
> +		net_warn_ratelimited("truncated extack: " fmt "\n",	\
> +				     ##args);				\
> +									\

Some "take it or leave it" comments:
 - Jiri's idea of always printing may be worth exploring
 - my preference would also be to produce a warning on overflow,
   rather than the exact print, because I always worry about people
   starting to depend on the print.

   And WARN_ON() is really heavy and may trigger remediations even
   tho truncated extack is just a minor nuisance.

   I'd do:

   pr(extack formatting overflow $__FILE__:$__func__:$__LINE__ $needed_len)
   
   (I think splicing the "trunced extack:" with fmt will result
    in the format string getting stored in .ro twice?)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ