/* * Kernel module for testing static keys. * * Copyright 2015 Akamai Technologies Inc. All Rights Reserved * * Authors: * Jason Baron * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that 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. */ #include #include /* old keys */ struct static_key base_old_true_key = STATIC_KEY_INIT_TRUE; EXPORT_SYMBOL_GPL(base_old_true_key); struct static_key base_inv_old_true_key = STATIC_KEY_INIT_TRUE; EXPORT_SYMBOL_GPL(base_inv_old_true_key); struct static_key base_old_false_key = STATIC_KEY_INIT_FALSE; EXPORT_SYMBOL_GPL(base_old_false_key); struct static_key base_inv_old_false_key = STATIC_KEY_INIT_FALSE; EXPORT_SYMBOL_GPL(base_inv_old_false_key); /* new keys */ DEFINE_STATIC_KEY_TRUE(base_true_key); EXPORT_SYMBOL_GPL(base_true_key); DEFINE_STATIC_KEY_TRUE(base_inv_true_key); EXPORT_SYMBOL_GPL(base_inv_true_key); DEFINE_STATIC_KEY_FALSE(base_false_key); EXPORT_SYMBOL_GPL(base_false_key); DEFINE_STATIC_KEY_FALSE(base_inv_false_key); EXPORT_SYMBOL_GPL(base_inv_false_key); static void invert_key(struct static_key *key) { if (static_key_enabled(key)) static_key_disable(key); else static_key_enable(key); } static int __init test_static_key_base_init(void) { invert_key(&base_inv_old_true_key); invert_key(&base_inv_old_false_key); invert_key(&base_inv_true_key.key); invert_key(&base_inv_false_key.key); return 0; } static void __exit test_static_key_base_exit(void) { } module_init(test_static_key_base_init); module_exit(test_static_key_base_exit); MODULE_AUTHOR("Jason Baron "); MODULE_LICENSE("GPL"); /net-next.git/diff/net/8021q/vlanproc.h?id=0b529f143e8baad441a5aac9ad55ec2434d8fb46'>diff
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/8021q/vlanproc.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/8021q/vlanproc.h')