#include #include #include "tests.h" #include "debug.h" #include "util.h" #include "perf-hooks.h" static void sigsegv_handler(int sig __maybe_unused) { pr_debug("SIGSEGV is observed as expected, try to recover.\n"); perf_hooks__recover(); signal(SIGSEGV, SIG_DFL); raise(SIGSEGV); exit(-1); } static void the_hook(void *_hook_flags) { int *hook_flags = _hook_flags; int *p = NULL; *hook_flags = 1234; /* Generate a segfault, test perf_hooks__recover */ *p = 0; } int test__perf_hooks(int subtest __maybe_unused) { int hook_flags = 0; signal(SIGSEGV, sigsegv_handler); perf_hooks__set_hook("test", the_hook, &hook_flags); perf_hooks__invoke_test(); /* hook is triggered? */ if (hook_flags != 1234) { pr_debug("Setting failed: %d (%p)\n", hook_flags, &hook_flags); return TEST_FAIL; } /* the buggy hook is removed? */ if (perf_hooks__get_hook("test")) return TEST_FAIL; return TEST_OK; } ec2434d8fb46'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsh Jain <harsh@chelsio.com>2017-02-01 21:10:28 +0530
committerHerbert Xu <herbert@gondor.apana.org.au>2017-02-03 17:45:48 +0800
commit0b529f143e8baad441a5aac9ad55ec2434d8fb46 (patch)
treefd816e548e12745d4776ad0bd661bec142d3ea06 /net/nfc/hci/hci.h
parentc26819900036f5b91608051a0fc7c76f6b4ffc7b (diff)
crypto: algif_aead - Fix kernel panic on list_del
Kernel panics when userspace program try to access AEAD interface. Remove node from Linked List before freeing its memory. Cc: <stable@vger.kernel.org> Signed-off-by: Harsh Jain <harsh@chelsio.com> Reviewed-by: Stephan Müller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'net/nfc/hci/hci.h')