/* * vdso_restorer.c - tests vDSO-based signal restore * Copyright (c) 2015 Andrew Lutomirski * * This program is free software; you can redistribute it and/or modify * it under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope 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. * * This makes sure that sa_restorer == NULL keeps working on 32-bit * configurations. Modern glibc doesn't use it under any circumstances, * so it's easy to overlook breakage. * * 64-bit userspace has never supported sa_restorer == NULL, so this is * 32-bit only. */ #define _GNU_SOURCE #include #include #include #include #include #include #include /* Open-code this -- the headers are too messy to easily use them. */ struct real_sigaction { void *handler; unsigned long flags; void *restorer; unsigned int mask[2]; }; static volatile sig_atomic_t handler_called; static void handler_with_siginfo(int sig, siginfo_t *info, void *ctx_void) { handler_called = 1; } static void handler_without_siginfo(int sig) { handler_called = 1; } int main() { int nerrs = 0; struct real_sigaction sa; memset(&sa, 0, sizeof(sa)); sa.handler = handler_with_siginfo; sa.flags = SA_SIGINFO; sa.restorer = NULL; /* request kernel-provided restorer */ if (syscall(SYS_rt_sigaction, SIGUSR1, &sa, NULL, 8) != 0) err(1, "raw rt_sigaction syscall"); raise(SIGUSR1); if (handler_called) { printf("[OK]\tSA_SIGINFO handler returned successfully\n"); } else { printf("[FAIL]\tSA_SIGINFO handler was not called\n"); nerrs++; } sa.flags = 0; sa.handler = handler_without_siginfo; if (syscall(SYS_sigaction, SIGUSR1, &sa, 0) != 0) err(1, "raw sigaction syscall"); handler_called = 0; raise(SIGUSR1); if (handler_called) { printf("[OK]\t!SA_SIGINFO handler returned successfully\n"); } else { printf("[FAIL]\t!SA_SIGINFO handler was not called\n"); nerrs++; } } gi/linux/net-next.git/log/net/dccp/ccids/lib/tfrc.h'>
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-01-17 13:46:29 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2017-01-23 22:41:33 +0800
commit11e3b725cfc282efe9d4a354153e99d86a16af08 (patch)
tree8b5b9e0e1bcae1ab98ee652ffb7b13b05c209bd6 /net/dccp/ccids/lib/tfrc.h
parentd6040764adcb5cb6de1489422411d701c158bb69 (diff)
crypto: arm64/aes-blk - honour iv_out requirement in CBC and CTR modes
Update the ARMv8 Crypto Extensions and the plain NEON AES implementations in CBC and CTR modes to return the next IV back to the skcipher API client. This is necessary for chaining to work correctly. Note that for CTR, this is only done if the request is a round multiple of the block size, since otherwise, chaining is impossible anyway. Cc: <stable@vger.kernel.org> # v3.16+ Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'net/dccp/ccids/lib/tfrc.h')