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: <1305195150.2914.268.camel@laptop>
Date:	Thu, 12 May 2011 12:12:30 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Cheng Xu <chengxu@...ux.vnet.ibm.com>
Cc:	Ingo Molnar <mingo@...e.hu>,
	Paul Mckenney <paulmck@...ux.vnet.ibm.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched: rt_rq runtime leakage bug fix

On Thu, 2011-05-12 at 01:30 +0800, Cheng Xu wrote:
> 
> I tried but hit a boot-time error "Unable to handle kernel paging
> request for data at address 0x100000008", and therefore would like to
> propose an alternative patch like,
> 
I probably made a silly mistake somehwere, it was after all something
quickly typed in an email :-)

> #define for_each_rt_rq(rt_rq, iter, rq) \
>         for (iter = list_entry_rcu(task_groups.next, typeof(*iter), list); \
>              (&iter->list != &task_groups) && (rt_rq = iter->rt_rq[cpu_of(rq)]); \
>              iter = list_entry_rcu(iter->list.next, typeof(*iter), list))
> 
> This worked, it seems to pass the tests.  Is this correct from a scheduler perspective?

Creative ;-), it would be nice to know why the , operator version
doesn't work though, since that looks to be the more conventional way to
write it.

That said, I don't see a problem with using your existing on.

> For the not CONFIG_RT_GROUP_SCHED part, I used 
> 
> typedef struct rt_rq *rt_rq_iter_t;
> 
> #define for_each_rt_rq(rt_rq, iter, rq) \
>         (void) iter; \
>         for (rt_rq = &rq->rt; rt_rq; rt_rq = NULL)
> 
> An alternative is 
> #define for_each_rt_rq(rt_rq, iter, rq) \
>         for (rt_rq = iter = &rq->rt; iter; rt_rq = iter = NULL)

Tough call that, the first has a multi-statement macro, which is
generally discouraged because then:

  for()
   for_each_rt_rq() {
   }

will not work as expected, so I think we want the second version.

> The patch is attached below. Could you check whether it is workable? Thank you. 

Yes, given how things are I can't really see it getting any better,
thanks!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ