Skip to contentSkip to conversation

snd_timer01: Add missing tst_fzsync_start_race_*() calls

PATCH Applied Martin Doucha 2 participants 3 messages Aug 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 snd_timer01: Add missing tst_fzsync_start_race_*() calls

---

The missing start_race() calls made the test essentially useless. Now it works correctly, tested on SLE-12SP2 GM kernel which was vulnerable.

 testcases/kernel/sound/snd_timer01.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
testcases/kernel/sound/snd_timer01.c +3 -6
index 3d8e715e3..123d1a2cb 100644
@@ -50,15 +50,11 @@ static void *ioctl_thread(void *unused)
 	tp.filter = 0xf;
 
 	while (tst_fzsync_run_b(&fzsync_pair)) {
-
+		tst_fzsync_start_race_b(&fzsync_pair);
 		ioctl(snd_fd, SNDRV_TIMER_IOCTL_TREAD, &tread_arg);
-
 		ioctl(snd_fd, SNDRV_TIMER_IOCTL_SELECT, &ts);
-
 		ioctl(snd_fd, SNDRV_TIMER_IOCTL_PARAMS, &tp);
-
 		ioctl(snd_fd, SNDRV_TIMER_IOCTL_START, 0);
-
 		tst_fzsync_end_race_b(&fzsync_pair);
 	}
 	return unused;
@@ -101,8 +97,9 @@ static void run(void)
 	while (tst_fzsync_run_a(&fzsync_pair)) {
 		nz = 0;
 		memset(read_buf, 0, sizeof(read_buf));
-		size = readv(snd_fd, &iov, 1);
 
+		tst_fzsync_start_race_a(&fzsync_pair);
+		size = readv(snd_fd, &iov, 1);
 		tst_fzsync_end_race_a(&fzsync_pair);
 
 		/* check if it could be a valid ioctl result */
Signature · 5 lines
2.37.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi Martin,

Quoted 2 lines

The missing start_race() calls made the test essentially useless. Now it works correctly, tested on SLE-12SP2 GM kernel which was vulnerable.

I was able to reproduce the problem on some old SLE-12SP2 even without tst_fzsync_start_race_[ab], but it's obviously correct => going to merge it.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp