mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai
       [not found] <201907150949139435825@zte.com.cn>
@ 2019-07-15  6:40 ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2019-07-15  6:40 UTC (permalink / raw)
  To: Wen Yang, alsa-devel, kernel-janitors
  Cc: linux-kernel, Cheng Shengyu, Jaroslav Kysela,
	Krzysztof Kozlowski, Liam Girdwood, Mark Brown, Sangbeom Kim,
	Sylwester Nawrocki, Takashi Iwai, Xue Zhihong, Yi Wang

> These two updates fix two different bugs.

I can follow this view to some degree.


> and the other is the double-free issue

This programming error affects also the use of data structures which became invalid.
https://cwe.mitre.org/data/definitions/415.html#oc_415_Notes


> So we sent two patches to fix them separately.

You would like to fix something according to two variables (of the data type “device_node *”)
in the same function implementation.
Please combine these corrections in an update step under a topic like
“ASoC: samsung: odroid: Fix handling of device node references in odroid_audio_probe()”.
(The previous update step would contain still a known programming mistake otherwise,
wouldn't it?)

Regards,
Markus

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

* Re: [2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai
  2019-07-13  3:46 [PATCH 2/2] " Wen Yang
@ 2019-07-14 12:47 ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2019-07-14 12:47 UTC (permalink / raw)
  To: Wen Yang, alsa-devel
  Cc: kernel-janitors, LKML, Cheng Shengyu, Jaroslav Kysela,
	Krzysztof Kozlowski, Liam Girdwood, Mark Brown, Sangbeom Kim,
	Sylwester Nawrocki, Takashi Iwai, Xue Zhihong, Yi Wang

> The cpu_dai variable is still being used after the of_node_put() call,

Such an implementation detail is questionable.
https://wiki.sei.cmu.edu/confluence/display/c/MEM30-C.+Do+not+access+freed+memory


> which may result in double-free:

This consequence is also undesirable.
https://cwe.mitre.org/data/definitions/415.html


Now I wonder if two update steps are really appropriate as a fix
instead of using a single update step for the desired correction
in this software module.
Should a commit (including previous ones) usually be correct by itself?

Regards,
Markus

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

end of thread, other threads:[~2019-07-15  6:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201907150949139435825@zte.com.cn>
2019-07-15  6:40 ` [2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai Markus Elfring
2019-07-13  3:46 [PATCH 2/2] " Wen Yang
2019-07-14 12:47 ` [2/2] " Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®