[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZEwmxt4vvw/+2zqI@corigine.com>
Date: Fri, 28 Apr 2023 22:04:22 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, Jay Vosburgh <j.vosburgh@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
Liang Li <liali@...hat.com>, Vincent Bernat <vincent@...nat.ch>
Subject: Re: [PATCHv2 net 1/4] bonding: fix send_peer_notif overflow
On Thu, Apr 27, 2023 at 11:39:06AM +0800, Hangbin Liu wrote:
...
> diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
> index c2d080fc4fc4..09a501cdea0c 100644
> --- a/drivers/net/bonding/bond_netlink.c
> +++ b/drivers/net/bonding/bond_netlink.c
> @@ -244,6 +244,12 @@ static int bond_changelink(struct net_device *bond_dev, struct nlattr *tb[],
> if (data[IFLA_BOND_PEER_NOTIF_DELAY]) {
> int delay = nla_get_u32(data[IFLA_BOND_PEER_NOTIF_DELAY]);
>
> + if (delay > 300000) {
> + NL_SET_ERR_MSG_ATTR(extack, data[IFLA_BOND_PEER_NOTIF_DELAY],
> + "peer_notif_delay should be less than 300s");
> + return -EINVAL;
> + }
Hi Hangbin,
can this limit be implemented using NLA_POLICY_MAX() in bond_policy ?
> +
> bond_opt_initval(&newval, delay);
> err = __bond_opt_set(bond, BOND_OPT_PEER_NOTIF_DELAY, &newval,
> data[IFLA_BOND_PEER_NOTIF_DELAY], extack);
...
Powered by blists - more mailing lists