Skip to contentSkip to conversation

ARM: amba: Fix leak of driver_override attribute value

PATCH In review Trent Piepho 3 participants 5 messages Sep 19, 2018 – Sep 20, 2018 Arm primecell bus support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: amba: Fix leak of driver_override attribute value

If driver_override was set when a device was released the string would not be kfree'ed in amba_device_release and thus leaked when the amba device was freed.

Cc Russell King <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/amba/bus.c | 1 +
 1 file changed, 1 insertion(+)
drivers/amba/bus.c +1 -0
index 41b706403ef7..ff3cb96526bc 100644
@@ -347,6 +347,7 @@ static void amba_device_release(struct device *dev)
 
 	if (d->res.parent)
 		release_resource(&d->res);
+	kfree(d->driver_override);
 	kfree(d);
 }
 
Signature · 1 line
2.14.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Trent Piepho

If driver_override was set when a device was released the string would not be kfree'ed in amba_device_release and thus leaked when the amba device was freed.

Cc Russell King <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Fixes 3cf385713460eb2b ("ARM: 8256/1: driver coamba: add device

binding path 'driver_override'")

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#2 lore raw
Quoted 11 lines · Geert Uytterhoeven
Quoted 9 lines · Trent Piepho

If driver_override was set when a device was released the string would not be kfree'ed in amba_device_release and thus leaked when the amba device was freed.

Cc Russell King <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Quoted 3 lines
Fixes 3cf385713460eb2b ("ARM: 8256/1: driver coamba: add device

binding path 'driver_override'")

Then it should also have a cc: stable, right?

thanks,

greg k-h

#3 lore raw

Hi Greg,

Quoted 12 lines · Greg KH
Quoted 11 lines · Geert Uytterhoeven
Quoted 9 lines · Trent Piepho

If driver_override was set when a device was released the string would not be kfree'ed in amba_device_release and thus leaked when the amba device was freed.

Cc Russell King <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Quoted 5 lines
Quoted 3 lines
Fixes 3cf385713460eb2b ("ARM: 8256/1: driver coamba: add device

binding path 'driver_override'")

Then it should also have a cc: stable, right?

Perhaps. I usually leave that up to the maintainer, else git send-email sends it to stable immediately.

The modern backporting AI will consider it anyway, due to the subject, and the Fixes tag, right?

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#4 lore raw
Quoted 15 lines · Geert Uytterhoeven

Hi Greg,

Quoted 12 lines · Greg KH
Quoted 11 lines · Geert Uytterhoeven
Quoted 9 lines · Trent Piepho

If driver_override was set when a device was released the string would not be kfree'ed in amba_device_release and thus leaked when the amba device was freed.

Cc Russell King <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Fixes 3cf385713460eb2b ("ARM: 8256/1: driver coamba: add device

binding path 'driver_override'")

Then it should also have a cc: stable, right?

Perhaps. I usually leave that up to the maintainer, else git send-email sends it to stable immediately.

That's fine, no one ever complains about that. In fact it is _good_ to have that happen, as it gives us stable people a "heads up" that something is coming to resolve a reported problems.

Quoted 2 lines

The modern backporting AI will consider it anyway, due to the subject, and the Fixes tag, right?

Don't count on the "AI" to pick things up if you _know_ it resolves a problem, like you have said here.

So please, just add it when you know it needs to be backported, otherwise it might never get backported.

thanks,

greg k-h