Changes in 4.9.161 mac80211: Free mpath object when rhashtable insertion fails libceph: handle an empty authorize reply ceph: avoid repeatedly adding inode to mdsc->snap_flush_list numa: change get_mempolicy() to use nr_node_ids instead of MAX_NUMNODES proc, oom: do not report alien mms when setting oom_score_adj KEYS: allow reaching the keys quotas exactly mfd: ti_am335x_tscadc: Use PLATFORM_DEVID_AUTO while registering mfd cells mfd: twl-core: Fix section annotations on {,un}protect_pm_master mfd: db8500-prcmu: Fix some section annotations mfd: mt6397: Do not call irq_domain_remove if PMIC unsupported mfd: ab8500-core: Return zero in get_register_interruptible() mfd: qcom_rpm: write fw_version to CTRL_REG mfd: wm5110: Add missing ASRC rate register mfd: mc13xxx: Fix a missing check of a register-read failure qed: Fix qed_ll2_post_rx_buffer_notify_fw() by adding a write memory barrier net: hns: Fix use after free identified by SLUB debug MIPS: ath79: Enable OF serial ports in the default config scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param scsi: isci: initialize shost fully before calling scsi_add_host() MIPS: jazz: fix 64bit build net: stmmac: Fix PCI module removal leak isdn: i4l: isdn_tty: Fix some concurrency double-free bugs atm: he: fix sign-extension overflow on large shift leds: lp5523: fix a missing check of return value of lp55xx_read mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky net/mlx5e: Fix wrong (zero) TX drop counter indication for representor isdn: avm: Fix string plus integer warning from Clang net: ethernet: stmmac: change dma descriptors to __le32 RDMA/srp: Rework SCSI device reset handling KEYS: user: Align the payload buffer KEYS: always initialize keyring_index_key::desc_len batman-adv: fix uninit-value in batadv_interface_tx() net/packet: fix 4gb buffer limit due to overflow check team: avoid complex list operations in team_nl_cmd_options_set() sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach() sctp: call gso_reset_checksum when computing checksum in sctp_gso_segment net/mlx4_en: Force CHECKSUM_NONE for short ethernet frames parisc: Fix ptrace syscall number modification ARCv2: Enable unaligned access in early ASM code ARC: U-boot: check arguments paranoidly ARC: define ARCH_SLAB_MINALIGN = 8 hpet: Make cmd parameter of hpet_ioctl_common() unsigned clocksource: Use GENMASK_ULL in definition of CLOCKSOURCE_MASK netpoll: Fix device name check in netpoll_setup() tracing: Use cpumask_available() to check if cpumask variable may be used x86/boot: Disable the address-of-packed-member compiler warning drm/i915: Consistently use enum pipe for PCH transcoders drm/i915: Fix enum pipe vs. enum transcoder for the PCH transcoder kbuild: move cc-option and cc-disable-warning after incl. arch Makefile kbuild: clang: fix build failures with sparse check kbuild: clang: remove crufty HOSTCFLAGS kbuild: clang: disable unused variable warnings only when constant kbuild: set no-integrated-as before incl. arch Makefile kbuild: add -no-integrated-as Clang option unconditionally irqchip/gic-v3: Convert arm64 GIC accessors to {read,write}_sysreg_s mm/zsmalloc.c: change stat type parameter to int mm/zsmalloc.c: fix -Wunneeded-internal-declaration warning Revert "bridge: do not add port to router list when receives query with source 0.0.0.0" netfilter: nf_tables: fix flush after rule deletion in the same batch pinctrl: max77620: Use define directive for max77620_pinconf_param values phy: tegra: remove redundant self assignment of 'map' sched/sysctl: Fix attributes of some extern declarations kbuild: consolidate Clang compiler flags Linux 4.9.161 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
64 lines
2.1 KiB
C
64 lines
2.1 KiB
C
/* user-type.h: User-defined key type
|
|
*
|
|
* Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the License, or (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef _KEYS_USER_TYPE_H
|
|
#define _KEYS_USER_TYPE_H
|
|
|
|
#include <linux/key.h>
|
|
#include <linux/rcupdate.h>
|
|
|
|
#ifdef CONFIG_KEYS
|
|
|
|
/*****************************************************************************/
|
|
/*
|
|
* the payload for a key of type "user" or "logon"
|
|
* - once filled in and attached to a key:
|
|
* - the payload struct is invariant may not be changed, only replaced
|
|
* - the payload must be read with RCU procedures or with the key semaphore
|
|
* held
|
|
* - the payload may only be replaced with the key semaphore write-locked
|
|
* - the key's data length is the size of the actual data, not including the
|
|
* payload wrapper
|
|
*/
|
|
struct user_key_payload {
|
|
struct rcu_head rcu; /* RCU destructor */
|
|
unsigned short datalen; /* length of this data */
|
|
char data[0] __aligned(__alignof__(u64)); /* actual data */
|
|
};
|
|
|
|
extern struct key_type key_type_user;
|
|
extern struct key_type key_type_logon;
|
|
|
|
struct key_preparsed_payload;
|
|
|
|
extern int user_preparse(struct key_preparsed_payload *prep);
|
|
extern void user_free_preparse(struct key_preparsed_payload *prep);
|
|
extern int user_update(struct key *key, struct key_preparsed_payload *prep);
|
|
extern void user_revoke(struct key *key);
|
|
extern void user_destroy(struct key *key);
|
|
extern void user_describe(const struct key *user, struct seq_file *m);
|
|
extern long user_read(const struct key *key,
|
|
char __user *buffer, size_t buflen);
|
|
|
|
static inline const struct user_key_payload *user_key_payload_rcu(const struct key *key)
|
|
{
|
|
return (struct user_key_payload *)dereference_key_rcu(key);
|
|
}
|
|
|
|
static inline struct user_key_payload *user_key_payload_locked(const struct key *key)
|
|
{
|
|
return (struct user_key_payload *)dereference_key_locked((struct key *)key);
|
|
}
|
|
|
|
#endif /* CONFIG_KEYS */
|
|
|
|
#endif /* _KEYS_USER_TYPE_H */
|