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]
Date:   Thu, 8 Jun 2017 08:21:48 +0200
From:   Boris Brezillon <boris.brezillon@...e-electrons.com>
To:     Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:     Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 46/58] clocksource/drivers: Add a new driver for the
 Atmel ARM TC blocks

Le Wed, 7 Jun 2017 23:08:48 +0200,
Daniel Lezcano <daniel.lezcano@...aro.org> a écrit :

> On Wed, Jun 07, 2017 at 05:27:50PM +0200, Alexandre Belloni wrote:
> > On 07/06/2017 at 16:17:35 +0200, Daniel Lezcano wrote:  
> > > > You mean you don't like how it is used? Or you don't think having the
> > > > timer full name is useful?  
> > > 
> > > The field is not needed, the only place where it is used is where we affect it.
> > >    
> > 
> > It is used in tcb_clksrc_register:
> > 
> > tc.clksrc.name = tc.name;  
> 
> Yes, but tc.name is only in the scope of the function, so there is no need to
> include this field in the structure, just a working buffer in the function is
> enough.

Hm, do you mean allocating the buffer dynamically and leaking the
resource (not a real leak here, since we're talking about something
that cannot be unregistered) or defining a 'static char name[]' variable
in the function and passing this pointer to clksrc.name? Note
that putting the name var on the stack won't work, because the core
does not seem to duplicate the name, and uses clksrc->name after
tcb_clksrc_register() has returned.

Anyway, I'm not sure dynamically generating the name is really
needed because we only accept a single tcb-clocksource device. We can
just set tc.clksrc.name to "atmel-tcb-clocksource" and we should be
good.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ