public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 1/9] lib: Add support for guarded buffers
Date: Fri, 02 Aug 2019 16:36:06 +0200	[thread overview]
Message-ID: <877e7vd489.fsf@rpws.prws.suse.cz> (raw)
In-Reply-To: <20190802135944.GA17684@rei>

Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
>> >> This commit adds a support for guarder buffers. Guarded buffer is a
>> >> buffer allocated so that there is PROT_NONE page immediatelly after the
>> >> end of the buffer i.e. any access after the buffer generates
>> >> SEGFAULT/EFAULT etc.
>> >> 
>> >> The library is hooked into the tst_test structure so that all you need
>> >> is to fill up an NULL terminated array of buffer pointers and sizes to
>> >> get the respective buffers allocated. The library supports allocating
>> >> memory in test runtime as well as well as allocating more complex
>> >> buffers, which currently are iovec vectors.
>> >
>> > Runtime alloc in loop could be an issue, do we need also runtime free?
>> 
>> I think tst_alloc needs a bit more documentation at the least.
>
> I will write an paragraph to test-writing-guidelines.txt about this
> functionality.
>
>> If we have runtime free then we need to figure out which map the
>> address belongs to or what its offset is (if any).
>
> That's easy, we will store the returned pointer to the map structure
> and use it for comparsion...

So that free() is an O(n) operation where n is the number of maps or you
will use a hash map to make it O(1)?

-- 
Thank you,
Richard.

  parent reply	other threads:[~2019-08-02 14:36 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01  9:26 [LTP] [RFC PATCH 0/9] Introduce guarded buffers Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 1/9] lib: Add support for " Cyril Hrubis
2019-08-01 10:39   ` Jan Stancek
2019-08-01 11:45     ` Cyril Hrubis
2019-08-02 14:03       ` Richard Palethorpe
2019-08-02 13:57     ` Richard Palethorpe
2019-08-02 13:59       ` Cyril Hrubis
2019-08-02 14:23         ` Cyril Hrubis
2019-08-02 14:36         ` Richard Palethorpe [this message]
2019-08-02 14:50           ` Cyril Hrubis
2019-08-02 14:20   ` Cyril Hrubis
2019-08-03 12:55   ` Li Wang
2019-08-06  7:36     ` Richard Palethorpe
2019-08-06  9:03   ` Richard Palethorpe
2019-08-08  9:06     ` Cyril Hrubis
2019-08-08  9:13       ` Li Wang
2019-08-08 15:41       ` Richard Palethorpe
2019-08-01  9:26 ` [LTP] [RFC PATCH 2/9] lib: Add a canary " Cyril Hrubis
2019-08-01 10:43   ` Jan Stancek
2019-08-01 11:54     ` Cyril Hrubis
2019-08-01 16:32       ` Jan Stancek
2019-08-02  9:47         ` Cyril Hrubis
2019-08-02 10:54           ` Jan Stancek
2019-08-03 13:02   ` Li Wang
2019-08-08  9:27     ` Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 3/9] syscalls/preadv01: Make use of " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 4/9] syscalls/accept4_01: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 5/9] syscalls/add_key04: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 6/9] syscalls/adjtimex: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 7/9] syscalls/clock_getres01: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 8/9] syscalls/clock_settime01: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 9/9] syscalls/sendmmsg01: " Cyril Hrubis
2019-08-06  9:47 ` [LTP] [PATCH v3 0/4] eBPF tests using guarded buffers API Richard Palethorpe
2019-08-06  9:47   ` [LTP] [PATCH v3 1/4] BPF: Essential headers for map creation Richard Palethorpe
2019-08-06  9:47   ` [LTP] [PATCH v3 2/4] BPF: Sanity check creating and updating maps Richard Palethorpe
2019-08-06  9:47   ` [LTP] [PATCH v3 3/4] BPF: Essential headers for a basic program Richard Palethorpe
2019-08-06  9:47   ` [LTP] [PATCH v3 4/4] BPF: Sanity check creating a program Richard Palethorpe

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=877e7vd489.fsf@rpws.prws.suse.cz \
    --to=rpalethorpe@suse.de \
    --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