From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/shmctl05: new test for IPC file use-after-free bug
Date: Fri, 18 May 2018 15:25:36 +0200 [thread overview]
Message-ID: <20180518132536.GB32299@rei> (raw)
In-Reply-To: <20180513012325.877-1-ebiggers3@gmail.com>
Hi!
> +++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl05.c
> @@ -0,0 +1,113 @@
> +/*
> + * Copyright (c) 2018 Google, Inc.
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program, if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +/*
> + * Regression test for commit 3f05317d9889 ("ipc/shm: fix use-after-free of shm
> + * file via remap_file_pages()"). This bug allowed the remap_file_pages()
> + * syscall to use the file of a System V shared memory segment after its ID had
> + * been reallocated and the file freed. This test reproduces the bug as a NULL
> + * pointer dereference in touch_atime(), although it's a race condition so it's
> + * not guaranteed to work. This test is based on the reproducer provided in the
> + * fix's commit message.
> + */
Have you considered using the fuzzy sync library here?
https://github.com/linux-test-project/ltp/blob/master/include/tst_fuzzy_sync.h
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2018-05-18 13:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-13 1:23 [LTP] [PATCH] syscalls/shmctl05: new test for IPC file use-after-free bug Eric Biggers
2018-05-18 13:25 ` Cyril Hrubis [this message]
2018-06-26 11:35 ` Cyril Hrubis
2018-06-27 6:18 ` Eric Biggers
2018-06-27 10:51 ` Cyril Hrubis
2018-06-27 13:59 ` Cyril Hrubis
2018-06-28 6:46 ` Eric Biggers
2018-06-28 9:00 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180518132536.GB32299@rei \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox