/* * Copyright 2014 Google, Inc. * * 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 #include #include #include #include "internal.h" static DEFINE_MUTEX(pmsg_lock); static ssize_t write_pmsg(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { u64 id; int ret; if (!count) return 0; /* check outside lock, page in any data. write_buf_user also checks */ if (!access_ok(VERIFY_READ, buf, count)) return -EFAULT; mutex_lock(&pmsg_lock); ret = psinfo->write_buf_user(PSTORE_TYPE_PMSG, 0, &id, 0, buf, 0, count, psinfo); mutex_unlock(&pmsg_lock); return ret ? ret : count; } static const struct file_operations pmsg_fops = { .owner = THIS_MODULE, .llseek = noop_llseek, .write = write_pmsg, }; static struct class *pmsg_class; static int pmsg_major; #define PMSG_NAME "pmsg" #undef pr_fmt #define pr_fmt(fmt) PMSG_NAME ": " fmt static char *pmsg_devnode(struct device *dev, umode_t *mode) { if (mode) *mode = 0220; return NULL; } void pstore_register_pmsg(void) { struct device *pmsg_device; pmsg_major = register_chrdev(0, PMSG_NAME, &pmsg_fops); if (pmsg_major < 0) { pr_err("register_chrdev failed\n"); goto err; } pmsg_class = class_create(THIS_MODULE, PMSG_NAME); if (IS_ERR(pmsg_class)) { pr_err("device class file already in use\n"); goto err_class; } pmsg_class->devnode = pmsg_devnode; pmsg_device = device_create(pmsg_class, NULL, MKDEV(pmsg_major, 0), NULL, "%s%d", PMSG_NAME, 0); if (IS_ERR(pmsg_device)) { pr_err("failed to create device\n"); goto err_device; } return; err_device: class_destroy(pmsg_class); err_class: unregister_chrdev(pmsg_major, PMSG_NAME); err: return; } void pstore_unregister_pmsg(void) { device_destroy(pmsg_class, MKDEV(pmsg_major, 0)); class_destroy(pmsg_class); unregister_chrdev(pmsg_major, PMSG_NAME); } i/linux/net-next.git/log/net/ceph/auth_none.c'>
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2017-01-18 14:29:21 +0100
committerIngo Molnar <mingo@kernel.org>2017-01-19 08:39:44 +0100
commitb5b46c4740aed1538544f0fa849c5b76c7823469 (patch)
tree125e7aced4835bad6f6a0c0d02d012f333caf922 /net/ceph/auth_none.c
parentfa19a769f82fb9a5ca000b83cacd13fcaeda51ac (diff)
objtool: Fix IRET's opcode
The IRET opcode is 0xcf according to the Intel manual and also to objdump of my vmlinux: 1ea8: 48 cf iretq Fix the opcode in arch_decode_instruction(). The previous value (0xc5) seems to correspond to LDS. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20170118132921.19319-1-jslaby@suse.cz Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/ceph/auth_none.c')