netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] sfq: timer is deferrable
@ 2008-01-19  0:11 Stephen Hemminger
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2008-01-19  0:11 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

The perturbation timer used for re-keying can be deferred, it doesn't
need to be deterministic.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/net/sched/sch_sfq.c	2008-01-17 08:29:24.000000000 -0800
+++ b/net/sched/sch_sfq.c	2008-01-17 09:00:58.000000000 -0800
@@ -426,7 +426,9 @@ static int sfq_init(struct Qdisc *sch, s
 	struct sfq_sched_data *q = qdisc_priv(sch);
 	int i;
 
-	setup_timer(&q->perturb_timer, sfq_perturbation, (unsigned long)sch);
+	q->perturb_timer.function = sfq_perturbation;
+	q->perturb_timer.data = (unsigned long)sch;;
+	init_timer_deferrable(&q->perturb_timer);
 
 	for (i=0; i<SFQ_HASH_DIVISOR; i++)
 		q->ht[i] = SFQ_DEPTH;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] sfq: timer is deferrable
       [not found] <20080118144900.1df0dd90@deepthought>
@ 2008-01-19  4:34 ` Paul E. McKenney
  2008-01-19  4:36   ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2008-01-19  4:34 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Miller, netdev

On Fri, Jan 18, 2008 at 02:49:00PM -0800, Stephen Hemminger wrote:
> The perturbation timer used for re-keying can be deferred, it doesn't
> need to be deterministic.

The only concern that I can come up with is that the sfq_perturbation
timer might be on one CPU, and all the operations using the corresponding
SFQ on another.  This could in theory allow a nearly omniscient attacker
to exploit an SFQ imbalance while preventing perturbation of the hash
function.

This does not seem to be a valid concern at this point, since there are
very few uses of init_timer_deferrable().  And if it should become a
problem, one approach would be to have some sort of per-timer limit to
the deferral.  Of course, at that point one would need to figure out
what this limit should be!

Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
> 
> 
> --- a/net/sched/sch_sfq.c	2008-01-17 08:29:24.000000000 -0800
> +++ b/net/sched/sch_sfq.c	2008-01-17 09:00:58.000000000 -0800
> @@ -426,7 +426,9 @@ static int sfq_init(struct Qdisc *sch, s
>  	struct sfq_sched_data *q = qdisc_priv(sch);
>  	int i;
> 
> -	setup_timer(&q->perturb_timer, sfq_perturbation, (unsigned long)sch);
> +	q->perturb_timer.function = sfq_perturbation;
> +	q->perturb_timer.data = (unsigned long)sch;;
> +	init_timer_deferrable(&q->perturb_timer);
> 
>  	for (i=0; i<SFQ_HASH_DIVISOR; i++)
>  		q->ht[i] = SFQ_DEPTH;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] sfq: timer is deferrable
  2008-01-19  4:34 ` [PATCH 1/3] sfq: timer is deferrable Paul E. McKenney
@ 2008-01-19  4:36   ` Stephen Hemminger
  2008-01-19  5:57     ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2008-01-19  4:36 UTC (permalink / raw)
  To: paulmck; +Cc: Stephen Hemminger, David Miller, netdev

On Fri, 18 Jan 2008 20:34:46 -0800
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:

> On Fri, Jan 18, 2008 at 02:49:00PM -0800, Stephen Hemminger wrote:
> > The perturbation timer used for re-keying can be deferred, it doesn't
> > need to be deterministic.
> 
> The only concern that I can come up with is that the sfq_perturbation
> timer might be on one CPU, and all the operations using the corresponding
> SFQ on another.  This could in theory allow a nearly omniscient attacker
> to exploit an SFQ imbalance while preventing perturbation of the hash
> function.
> 
> This does not seem to be a valid concern at this point, since there are
> very few uses of init_timer_deferrable().  And if it should become a
> problem, one approach would be to have some sort of per-timer limit to
> the deferral.  Of course, at that point one would need to figure out
> what this limit should be!
> 
> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

But the only threat is getting more bandwidth for a longer interval.
It is all kind of moot anyway because the bandwidth hogs all open
multiple connections anyway, so SFQ is of no use.

-- 
Stephen Hemminger <stephen.hemminger@vyatta.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] sfq: timer is deferrable
  2008-01-19  4:36   ` Stephen Hemminger
@ 2008-01-19  5:57     ` Paul E. McKenney
  2008-01-21  1:18       ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2008-01-19  5:57 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Stephen Hemminger, David Miller, netdev

On Fri, Jan 18, 2008 at 08:36:55PM -0800, Stephen Hemminger wrote:
> On Fri, 18 Jan 2008 20:34:46 -0800
> "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> 
> > On Fri, Jan 18, 2008 at 02:49:00PM -0800, Stephen Hemminger wrote:
> > > The perturbation timer used for re-keying can be deferred, it doesn't
> > > need to be deterministic.
> > 
> > The only concern that I can come up with is that the sfq_perturbation
> > timer might be on one CPU, and all the operations using the corresponding
> > SFQ on another.  This could in theory allow a nearly omniscient attacker
> > to exploit an SFQ imbalance while preventing perturbation of the hash
> > function.
> > 
> > This does not seem to be a valid concern at this point, since there are
> > very few uses of init_timer_deferrable().  And if it should become a
> > problem, one approach would be to have some sort of per-timer limit to
> > the deferral.  Of course, at that point one would need to figure out
> > what this limit should be!
> > 
> > Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> But the only threat is getting more bandwidth for a longer interval.
> It is all kind of moot anyway because the bandwidth hogs all open
> multiple connections anyway, so SFQ is of no use.

Good point, and an additional reason for my Acked-by above.  ;-)

						Thanx, Paul

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] sfq: timer is deferrable
  2008-01-19  5:57     ` Paul E. McKenney
@ 2008-01-21  1:18       ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2008-01-21  1:18 UTC (permalink / raw)
  To: paulmck; +Cc: shemminger, stephen.hemminger, netdev

From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Fri, 18 Jan 2008 21:57:00 -0800

> On Fri, Jan 18, 2008 at 08:36:55PM -0800, Stephen Hemminger wrote:
> > On Fri, 18 Jan 2008 20:34:46 -0800
> > "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> > 
> > > On Fri, Jan 18, 2008 at 02:49:00PM -0800, Stephen Hemminger wrote:
> > > > The perturbation timer used for re-keying can be deferred, it doesn't
> > > > need to be deterministic.
> > > 
> > > The only concern that I can come up with is that the sfq_perturbation
> > > timer might be on one CPU, and all the operations using the corresponding
> > > SFQ on another.  This could in theory allow a nearly omniscient attacker
> > > to exploit an SFQ imbalance while preventing perturbation of the hash
> > > function.
> > > 
> > > This does not seem to be a valid concern at this point, since there are
> > > very few uses of init_timer_deferrable().  And if it should become a
> > > problem, one approach would be to have some sort of per-timer limit to
> > > the deferral.  Of course, at that point one would need to figure out
> > > what this limit should be!
> > > 
> > > Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > 
> > But the only threat is getting more bandwidth for a longer interval.
> > It is all kind of moot anyway because the bandwidth hogs all open
> > multiple connections anyway, so SFQ is of no use.
> 
> Good point, and an additional reason for my Acked-by above.  ;-)

I've applied this patch, thanks :-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-21  1:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080118144900.1df0dd90@deepthought>
2008-01-19  4:34 ` [PATCH 1/3] sfq: timer is deferrable Paul E. McKenney
2008-01-19  4:36   ` Stephen Hemminger
2008-01-19  5:57     ` Paul E. McKenney
2008-01-21  1:18       ` David Miller
2008-01-19  0:11 Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).