mbox series

[0/2,RFC] Refactor snd primitives refcounters

Message ID 20230824210339.1126993-1-cujomalainey@chromium.org (mailing list archive)
Headers show
Series Refactor snd primitives refcounters | expand

Message

Curtis Malainey Aug. 24, 2023, 9:02 p.m. UTC
From: Curtis Malainey <cujomalainey@chromium.org>

As previously identified in [1] there are some issues with how kobjs are
handled in sound/core. The solution provided in [2] is a workaround for
the issues to fix the failures.

This series is a first attempt at the larger refactor needed to properly
handle the objects.

[1] https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/message/3B2VMPFATCJCRD76DM36LZAICPDP2R6A/
[2] https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/message/JZIPB4OIC3OK6YAGTPMAEKXMLUWM5PTA/

Curtis Malainey (2):
  ALSA: core: add snd_device_init
  ALSA: core: split control primitives out of snd_card

 include/sound/control.h                  |   1 +
 include/sound/core.h                     |  34 +--
 sound/core/control.c                     | 330 +++++++++++++----------
 sound/core/control_compat.c              |   8 +-
 sound/core/control_led.c                 |  18 +-
 sound/core/init.c                        |  33 +--
 sound/pci/hda/hda_codec.c                |   3 +-
 sound/soc/intel/atom/sst-atom-controls.c |   8 +-
 sound/soc/soc-card.c                     |   2 +-
 sound/usb/media.c                        |   2 +-
 10 files changed, 249 insertions(+), 190 deletions(-)

Comments

Takashi Iwai Aug. 25, 2023, 11:15 a.m. UTC | #1
On Thu, 24 Aug 2023 23:02:51 +0200,
cujomalainey@chromium.org wrote:
> 
> From: Curtis Malainey <cujomalainey@chromium.org>
> 
> As previously identified in [1] there are some issues with how kobjs are
> handled in sound/core. The solution provided in [2] is a workaround for
> the issues to fix the failures.
> 
> This series is a first attempt at the larger refactor needed to properly
> handle the objects.
> 
> [1] https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/message/3B2VMPFATCJCRD76DM36LZAICPDP2R6A/
> [2] https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/message/JZIPB4OIC3OK6YAGTPMAEKXMLUWM5PTA/
> 
> Curtis Malainey (2):
>   ALSA: core: add snd_device_init
>   ALSA: core: split control primitives out of snd_card

Thanks for the patches.  But, as the 6.6 merge window open is pretty
close, I'd postpone those unless it's urgently needed.

Also, before moving the resource tied with the device object, we'll
need a refcount to the ctl dev from pcm dev, as PCM does release chmap
at its free path (calling free_chmap()).  Otherwise it'll lead to
another UAF, if both objects releases are done asynchronously without
dependency.


BTW, the cover letter and the subject prefix of the patches don't
match, and also the cover letter didn't include Cc.  Please try to
make both cover letter and patches sent properly.


thanks,


Takashi
Curtis Malainey Aug. 25, 2023, 5:42 p.m. UTC | #2
On Fri, Aug 25, 2023 at 4:16 AM Takashi Iwai <tiwai@suse.de> wrote:
>
> Thanks for the patches.  But, as the 6.6 merge window open is pretty
> close, I'd postpone those unless it's urgently needed.

I have no timeline since we have the workaround in, hence the RFC

>
> Also, before moving the resource tied with the device object, we'll
> need a refcount to the ctl dev from pcm dev, as PCM does release chmap
> at its free path (calling free_chmap()).  Otherwise it'll lead to
> another UAF, if both objects releases are done asynchronously without
> dependency.

Got it, thanks.

>
>
> BTW, the cover letter and the subject prefix of the patches don't
> match, and also the cover letter didn't include Cc.  Please try to
> make both cover letter and patches sent properly.

Thanks for catching that, I was struggling getting cc to copy across
with git from get_maintainers. I will give it another shot with v2.

Curtis

>
>
> thanks,
>
>
> Takashi