Skip to contentSkip to conversation

ALSA: use designated initializers

PATCH Applied Kees Cook 3 participants 3 messages Dec 17, 2016 – Dec 28, 2016 Sound

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 ALSA: use designated initializers

Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity.

---
 sound/synth/emux/emux_seq.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
sound/synth/emux/emux_seq.c +7 -7
index a0209204ae48..55579f6b8cb2 100644
@@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
  * MIDI emulation operators
  */
 static struct snd_midi_op emux_ops = {
-	snd_emux_note_on,
-	snd_emux_note_off,
-	snd_emux_key_press,
-	snd_emux_terminate_note,
-	snd_emux_control,
-	snd_emux_nrpn,
-	snd_emux_sysex,
+	.note_on = snd_emux_note_on,
+	.note_off = snd_emux_note_off,
+	.key_press = snd_emux_key_press,
+	.note_terminate = snd_emux_terminate_note,
+	.control = snd_emux_control,
+	.nrpn = snd_emux_nrpn,
+	.sysex = snd_emux_sysex,
 };
 
 
Signature · 6 lines
2.7.4


-- 
Kees Cook
Nexus Security
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Kees Cook

Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity.

---
 sound/synth/emux/emux_seq.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Quoted 13 lines
sound/synth/emux/emux_seq.c +0 -5
index a0209204ae48..55579f6b8cb2 100644
@@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
  * MIDI emulation operators
  */
 static struct snd_midi_op emux_ops = {
-	snd_emux_note_on,
-	snd_emux_note_off,
-	snd_emux_key_press,
-	snd_emux_terminate_note,
-	snd_emux_control,

sound/synth/emux/emux_seq.c static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf · line 43

Quoted 10 lines
sound/synth/emux/emux_seq.c +7 -2
-	snd_emux_nrpn,
-	snd_emux_sysex,
+	.note_on = snd_emux_note_on,
+	.note_off = snd_emux_note_off,
+	.key_press = snd_emux_key_press,
+	.note_terminate = snd_emux_terminate_note,
+	.control = snd_emux_control,
+	.nrpn = snd_emux_nrpn,
+	.sysex = snd_emux_sysex,
 };

Regards

Takashi Sakamoto

Applied
#2 lore raw
In reply to Kees Cook
Quoted 7 lines · Kees Cook

Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity.

Applied, thanks.

Takashi

Quoted 37 lines
---
 sound/synth/emux/emux_seq.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
sound/synth/emux/emux_seq.c +7 -7
index a0209204ae48..55579f6b8cb2 100644
@@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
  * MIDI emulation operators
  */
 static struct snd_midi_op emux_ops = {
-	snd_emux_note_on,
-	snd_emux_note_off,
-	snd_emux_key_press,
-	snd_emux_terminate_note,
-	snd_emux_control,
-	snd_emux_nrpn,
-	snd_emux_sysex,
+	.note_on = snd_emux_note_on,
+	.note_off = snd_emux_note_off,
+	.key_press = snd_emux_key_press,
+	.note_terminate = snd_emux_terminate_note,
+	.control = snd_emux_control,
+	.nrpn = snd_emux_nrpn,
+	.sysex = snd_emux_sysex,
 };
 
 
Signature · 6 lines
2.7.4


-- 
Kees Cook
Nexus Security