ltp.lists.linux.it archive mirror
 help / color / mirror / Atom feed
* [LTP] [PATCH] snd_timer01: Add missing tst_fzsync_start_race_*() calls
@ 2022-08-22 15:47 Martin Doucha
  2022-08-22 16:01 ` Petr Vorel
  2022-08-22 16:39 ` Petr Vorel
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Doucha @ 2022-08-22 15:47 UTC (permalink / raw)
  To: ltp

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---

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(-)

diff --git a/testcases/kernel/sound/snd_timer01.c b/testcases/kernel/sound/snd_timer01.c
index 3d8e715e3..123d1a2cb 100644
--- a/testcases/kernel/sound/snd_timer01.c
+++ b/testcases/kernel/sound/snd_timer01.c
@@ -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 */
-- 
2.37.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH] snd_timer01: Add missing tst_fzsync_start_race_*() calls
  2022-08-22 15:47 [LTP] [PATCH] snd_timer01: Add missing tst_fzsync_start_race_*() calls Martin Doucha
@ 2022-08-22 16:01 ` Petr Vorel
  2022-08-22 16:39 ` Petr Vorel
  1 sibling, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2022-08-22 16:01 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Martin,


> 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.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH] snd_timer01: Add missing tst_fzsync_start_race_*() calls
  2022-08-22 15:47 [LTP] [PATCH] snd_timer01: Add missing tst_fzsync_start_race_*() calls Martin Doucha
  2022-08-22 16:01 ` Petr Vorel
@ 2022-08-22 16:39 ` Petr Vorel
  1 sibling, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2022-08-22 16:39 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Martin,

merged, thanks!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2022-08-22 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22 15:47 [LTP] [PATCH] snd_timer01: Add missing tst_fzsync_start_race_*() calls Martin Doucha
2022-08-22 16:01 ` Petr Vorel
2022-08-22 16:39 ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).