From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3] Add regression test for CVE-2017-17052
Date: Fri, 19 Jan 2018 18:54:03 +0100 [thread overview]
Message-ID: <20180119175402.GA13508@rei> (raw)
In-Reply-To: <20180119160347.GB7954@rei>
Hi!
> > +static void setup(void)
> > +{
> > + shm = SAFE_MMAP(NULL, sizeof(struct my_shm_data), PROT_READ|PROT_WRITE,
> ^
> The system aligns the length to be a
> multiple of pagesize, so we may as well
> pass result of getpagesize() here.
> > + MAP_SHARED | MAP_ANONYMOUS, -1, 0);
> > +
> > + shm->exit = 0;
> > +}
> > +
> > +static void cleanup(void)
> > +{
> > + SAFE_MUNMAP(shm, sizeof(struct my_shm_data));
> ^
> Here we must pass length that is multiple of
> pagesize, at least manual pages says so.
Sorry, I've misread the manual page, that applies only for huge page
mappings, so passing sizeof(*shm) to mmap() and munmap() should work
just fine, it would still allocate whole page though.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2018-01-19 17:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-12 11:59 [LTP] [PATCH v3] Add regression test for CVE-2017-17052 Michael Moese
2018-01-19 16:03 ` Cyril Hrubis
2018-01-19 17:54 ` Cyril Hrubis [this message]
2018-01-20 11:32 ` Michael Moese
2018-01-22 15:48 ` 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=20180119175402.GA13508@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.