From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3] crypto/af_alg02: fixed read() being stuck
Date: Tue, 14 May 2019 15:48:39 +0200 [thread overview]
Message-ID: <20190514134838.GA1516@rei> (raw)
In-Reply-To: <20190508071636.13804-1-camann@suse.com>
> -static void run(void)
> +void *verify_encrypt(void *arg LTP_ATTRIBUTE_UNUSED)
> {
> char buf[16];
> int reqfd = tst_alg_setup_reqfd("skcipher", "salsa20", NULL, 16);
>
> + TST_CHECKPOINT_WAKE(0);
> +
> /* With the bug the kernel crashed here */
> if (read(reqfd, buf, 16) == 0)
> tst_res(TPASS, "Successfully \"encrypted\" an empty message");
> else
> - tst_res(TBROK, "read() didn't return 0");
> + tst_res(TFAIL, "read() didn't return 0");
> + return arg;
Actually there is no point in adding the LTP_ATTRIBUTE_UNUSED since you
do return arg; at the end of the function.
So I've removed the LTP_ATTRIBUTE_UNUSED, changed the function to be
static and pushed. thanks.
> +}
> +
> +static void run(void)
> +{
> + pthread_t thr;
> +
> + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
> + SAFE_PTHREAD_CREATE(&thr, NULL, verify_encrypt, NULL);
> +
> + TST_CHECKPOINT_WAIT(0);
> +
> + while (pthread_kill(thr, 0) != ESRCH) {
> + if (tst_timeout_remaining() <= 10) {
> + pthread_cancel(thr);
> + tst_brk(TBROK,
> + "Timed out while reading from request socket.");
> + }
> + usleep(1000);
> + }
> }
>
> static struct tst_test test = {
> .test_all = run,
> + .timeout = 20,
> + .needs_checkpoints = 1,
> };
> --
> 2.16.4
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
prev parent reply other threads:[~2019-05-14 13:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 7:16 [LTP] [PATCH v3] crypto/af_alg02: fixed read() being stuck Christian Amann
2019-05-09 4:59 ` Li Wang
2019-05-14 13:48 ` Cyril Hrubis [this message]
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=20190514134838.GA1516@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.