Skip to content

ALSA: PCM state reference optimization

Takashi Iwai alsa-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11ALSA: pcm: Avoid reference to status->stateinclude/sound/pcm.h sound/core/oss/pcm_oss.c sound/core/pcm.c +3 more+118 -1000 replies
2/11ALSA: pcm: Make mmap status read-onlysound/core/pcm_native.c+1 -00 replies
3/11ALSA: aloop: Replace runtime->status->state reference to runtime->statesound/drivers/aloop.c+2 -20 replies
4/11ALSA: firewire: Replace runtime->status->state reference to runtime->statesound/firewire/bebob/bebob_pcm.c sound/firewire/dice/dice-pcm.c sound/firewire/digi00x/digi00x-pcm.c +5 more+18 -180 replies
5/11ALSA: hda: Replace runtime->status->state reference to runtime->statesound/hda/hdmi_chmap.c+1 -10 replies
6/11ALSA: asihpi: Replace runtime->status->state reference to runtime->statesound/pci/asihpi/asihpi.c+1 -10 replies
7/11ALSA: usb-audio: Replace runtime->status->state reference to runtime->statesound/usb/pcm.c+2 -20 replies
8/11ALSA: usx2y: Replace runtime->status->state reference to runtime->statesound/usb/usx2y/usbusx2yaudio.c sound/usb/usx2y/usx2yhwdeppcm.c+2 -40 replies
9/11ASoC: intel: Replace runtime->status->state reference to runtime->statesound/soc/intel/skylake/skl-pcm.c+2 -21 reply
10/11ASoC: sh: Replace runtime->status->state reference to runtime->statesound/soc/sh/rz-ssi.c+1 -11 reply
11/11usb: gadget: Replace runtime->status->state reference to runtime->statedrivers/usb/gadget/function/u_uac1_legacy.c+2 -21 reply

Reviews trailers per patch

3 of 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchGreg Kroah-HartmanJaroslav KyselaMark Brown
SeriesR-b
1/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11A-b
10/11A-b
11/11R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/11] ALSA: PCM state reference optimization

Hi,

this is a patch set for simplifying the reference to the current PCM state by having the local copy in runtime instead of relying on runtime->status indirection. This also hardens against the attack by modifying the mmapped status record.

The first patch does the basic job in the core PCM side, and the second patch flips the PCM status mmap to read-only for hardening, while the remaining patches are for drivers to follow the core change.

The conversions are straightforward. In most places, it's just replacing runtime->status->state with runtime->state.

Takashi

===

Takashi Iwai (11):
ALSA: pcm: Avoid reference to status->state
ALSA: pcm: Make mmap status read-only
ALSA: aloop: Replace runtime->status->state reference to

    runtime->state
  ALSA: firewire: Replace runtime->status->state reference to
    runtime->state
  ALSA: hda: Replace runtime->status->state reference to runtime->state
  ALSA: asihpi: Replace runtime->status->state reference to
    runtime->state
  ALSA: usb-audio: Replace runtime->status->state reference to
    runtime->state
  ALSA: usx2y: Replace runtime->status->state reference to
    runtime->state
  ASoC: intel: Replace runtime->status->state reference to
    runtime->state
  ASoC: sh: Replace runtime->status->state reference to runtime->state
  usb: gadget: Replace runtime->status->state reference to
    runtime->state
 drivers/usb/gadget/function/u_uac1_legacy.c |   4 +-
 include/sound/pcm.h                         |  20 ++-
 sound/core/oss/pcm_oss.c                    |  42 +++----
 sound/core/pcm.c                            |   9 +-
 sound/core/pcm_compat.c                     |   4 +-
 sound/core/pcm_lib.c                        |  16 +--
 sound/core/pcm_native.c                     | 128 ++++++++++----------
 sound/drivers/aloop.c                       |   4 +-
 sound/firewire/bebob/bebob_pcm.c            |   4 +-
 sound/firewire/dice/dice-pcm.c              |   4 +-
 sound/firewire/digi00x/digi00x-pcm.c        |   4 +-
 sound/firewire/fireface/ff-pcm.c            |   4 +-
 sound/firewire/fireworks/fireworks_pcm.c    |   4 +-
 sound/firewire/motu/motu-pcm.c              |   4 +-
 sound/firewire/oxfw/oxfw-pcm.c              |   8 +-
 sound/firewire/tascam/tascam-pcm.c          |   4 +-
 sound/hda/hdmi_chmap.c                      |   2 +-
 sound/pci/asihpi/asihpi.c                   |   2 +-
 sound/soc/intel/skylake/skl-pcm.c           |   4 +-
 sound/soc/sh/rz-ssi.c                       |   2 +-
 sound/usb/pcm.c                             |   4 +-
 sound/usb/usx2y/usbusx2yaudio.c             |   3 +-
 sound/usb/usx2y/usx2yhwdeppcm.c             |   3 +-
 23 files changed, 150 insertions(+), 133 deletions(-)

===

Cc Bard Liao <[email protected]>
Cc Cezary Rojewski <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Kai Vehmanen <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Mark Brown <[email protected]>
Cc Peter Ujfalusi <[email protected]>
Cc Pierre-Louis Bossart <[email protected]>
Cc Ranjani Sridharan <[email protected]>
Cc Takashi Sakamoto <[email protected]>
Signature · 1 line
2.35.3