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] [day] [month] [year] [list]
Message-ID: <ZBCSOi6y8w8NUtTe@corigine.com>
Date:   Tue, 14 Mar 2023 16:26:50 +0100
From:   Simon Horman <simon.horman@...igine.com>
To:     Pedro Tammela <pctammela@...atatu.com>
Cc:     netdev@...r.kernel.org, jhs@...atatu.com, xiyou.wangcong@...il.com,
        jiri@...nulli.us, davem@...emloft.net, edumazet@...gle.com,
        kuba@...nel.org, pabeni@...hat.com
Subject: Re: [PATCH net-next 3/3] net/sched: act_pedit: rate limit datapath
 messages

On Mon, Mar 13, 2023 at 03:24:47PM -0300, Pedro Tammela wrote:
> On 10/03/2023 11:21, Simon Horman wrote:
> > On Thu, Mar 09, 2023 at 03:51:58PM -0300, Pedro Tammela wrote:
> > > Unbounded info messages in the pedit datapath can flood the printk ring buffer quite easily
> > > depending on the action created. As these messages are informational, usually printing
> > > some, not all, is enough to bring attention to the real issue.
> > 
> > Would this reasoning also apply to other TC actions?
> 
> Hi Simon,
> 
> So far, the only action that has datapath pr_info() messages is pedit.
> This seems like it comes from the old days, according to git.

I'd be in favour of unifying things.
But perhaps that is a topic for another day.

> > > Reviewed-by: Jamal Hadi Salim <jhs@...atatu.com>
> > > Signed-off-by: Pedro Tammela <pctammela@...atatu.com>
> > > ---
> > >   net/sched/act_pedit.c | 17 +++++++----------
> > >   1 file changed, 7 insertions(+), 10 deletions(-)
> > > 
> > > diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
> > > index e42cbfc369ff..b5a8fc19ee55 100644
> > > --- a/net/sched/act_pedit.c
> > > +++ b/net/sched/act_pedit.c
> > > @@ -388,9 +388,8 @@ TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
> > >   		}
> > >   		rc = pedit_skb_hdr_offset(skb, htype, &hoffset);
> > > -		if (rc) {
> > > -			pr_info("tc action pedit bad header type specified (0x%x)\n",
> > > -				htype);
> > > +		if (unlikely(rc)) {
> > 
> > Do you really need unlikely() here (and no where else?)
> 
> This case in particular is already checked in the netlink parsing code on
> create/update.
> I was gonna delete the condition initially but then thought of hiding it
> under an unlikely branch.
> As for the other branches, I didn't see much of a reason.

TBH, I'd drop the unlikely() unless there is some performance data.
Perhaps you can drop the log entirely, can it occur given the checking
elsewhere?

> > 
> > > +			pr_info_ratelimited("tc action pedit bad header type specified (0x%x)\n", htype);
> > >   			goto bad;
> > >   		}
> > 
> > ...
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ