From: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
To: kexec@lists.infradead.org
Cc: kumagai-atsushi@mxc.nes.nec.co.jp
Subject: [PATCH 03/10] Scrub all entries in the keyring
Date: Thu, 27 Feb 2014 12:01:15 +0530 [thread overview]
Message-ID: <20140227063115.5924.24207.stgit@aruna-ThinkPad-T420> (raw)
In-Reply-To: <20140227063007.5924.5819.stgit@aruna-ThinkPad-T420>
Clear all entries in the keyring
Scan the keyring_name_hash hash table
static struct list_head keyring_name_hash[KEYRING_NAME_HASH_SIZE];
for (i = 0; i < KEYRING_NAME_HASH_SIZE; i++)
if (!list_empty(&keyring_name_hash[i])) {
...
}
For each non-empty list walk all keyring entries
struct key {
...
struct key_type *type; /* type of key */
...
unsigned short datalen; /* payload data length */
...
union {
struct list_head link;
...
} type_data;
...
union {
unsigned long value;
void __rcu *rcudata;
void *data;
struct keyring_list __rcu *subscriptions;
} payload;
};
struct key *key;
list_for_each_entry(key, &keyring_name_hash[i], type_data.link) {
...
}
Clear value/rcudata/data dependent on the type of the key.
Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
---
eppic_scripts/keyring.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 eppic_scripts/keyring.c
diff --git a/eppic_scripts/keyring.c b/eppic_scripts/keyring.c
new file mode 100644
index 0000000..22e7db8
--- /dev/null
+++ b/eppic_scripts/keyring.c
@@ -0,0 +1,57 @@
+string
+skey_opt()
+{
+ return "l";
+}
+
+string
+skey_usage()
+{
+ return "\n";
+}
+
+static void
+skey_showusage()
+{
+ printf("usage : skey %s", skey_usage());
+}
+
+string
+skey_help()
+{
+ return "Help";
+}
+
+int
+skey()
+{
+ int i;
+ struct list_head **tab;
+
+ tab = &keyring_name_hash;
+
+ for (i = 0; i < 32; i++)
+ {
+ struct list_head *next, *head;
+
+ head = (struct list_head *) (tab + i);
+ next = (struct list_head *) head->next;
+
+ if (!next)
+ continue;
+
+ while (next != head)
+ {
+ struct key *mykey, *off = 0;
+
+ mykey = (struct key *)((unsigned long)(next) - ((unsigned long)&(off->type_data)));
+
+ memset((char *)&(mykey->payload.value), 'A', 0x8);
+ memset((char *)mykey->payload.rcudata, 'A', 0x20);
+ memset((char *)mykey->payload.data, 'A', 0x20);
+
+ next = (struct list_head *) mykey->type_data.link.next;
+ }
+ }
+ return 1;
+}
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2014-02-27 6:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-27 6:31 [PATCH 00/10] makedumpfile/eppic: Sample eppic scripts Aruna Balakrishnaiah
2014-02-27 6:31 ` [PATCH 01/10] Scrub executable name for each user process Aruna Balakrishnaiah
2014-02-27 6:31 ` [PATCH 02/10] Scrub filenames of cached dentries Aruna Balakrishnaiah
2014-02-27 6:31 ` Aruna Balakrishnaiah [this message]
2014-02-27 6:31 ` [PATCH 04/10] Clear the message data of all ap_bus requests Aruna Balakrishnaiah
2014-02-27 6:31 ` [PATCH 05/10] Scrub data in tcp socket buffers Aruna Balakrishnaiah
2014-02-27 6:31 ` [PATCH 06/10] Scrub data of udp " Aruna Balakrishnaiah
2014-02-27 6:31 ` [PATCH 07/10] Scrub data of unix " Aruna Balakrishnaiah
2014-02-27 6:31 ` [PATCH 08/10] Scrub socket buffers of guest network I/O Aruna Balakrishnaiah
2014-02-27 6:31 ` [PATCH 09/10] Scrub buffers involved in guest block I/O Aruna Balakrishnaiah
2014-02-27 6:32 ` [PATCH 10/10] Install sample eppic scripts Aruna Balakrishnaiah
2014-03-05 4:54 ` Atsushi Kumagai
2014-03-05 4:54 ` [PATCH 00/10] makedumpfile/eppic: Sample " Atsushi Kumagai
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=20140227063115.5924.24207.stgit@aruna-ThinkPad-T420 \
--to=aruna@linux.vnet.ibm.com \
--cc=kexec@lists.infradead.org \
--cc=kumagai-atsushi@mxc.nes.nec.co.jp \
/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