This is the 4.4.276 stable release # gpg: Signature made Tue Jul 20 17:23:10 2021 EEST # gpg: using RSA key 647F28654894E3BD457199BE38DBBDC86092693E # gpg: Good signature from "Greg Kroah-Hartman <gregkh@kernel.org>" [full] # gpg: gregkh@kernel.org: Verified 26 signatures in the past 2 hours. Encrypted # 0 messages. # By Zhen Lei (10) and others # Via Greg Kroah-Hartman * tag 'v4.4.276': Linux 4.4.276 seq_file: disallow extremely large seq buffer allocations MIPS: vdso: Invalid GIC access through VDSO mips: disable branch profiling in boot/decompress.o scsi: be2iscsi: Fix an error handling path in beiscsi_dev_probe() memory: fsl_ifc: fix leak of private memory on probe failure memory: fsl_ifc: fix leak of IO mapping on probe failure rtc: fix snprintf() checking in is_rtc_hctosys() ARM: dts: exynos: fix PWM LED max brightness on Odroid XU4 hexagon: use common DISCARDS macro ALSA: isa: Fix error return code in snd_cmi8330_probe() nfs: fix acl memory leak of posix_acl_create() um: fix error return code in winch_tramp() um: fix error return code in slip_open() PCI/sysfs: Fix dsm_label_utf16s_to_utf8s() buffer overrun virtio_console: Assure used length from device is limited virtio-blk: Fix memory leak among suspend/resume procedure power: supply: ab8500: add missing MODULE_DEVICE_TABLE power: supply: charger-manager: add missing MODULE_DEVICE_TABLE ceph: remove bogus checks and WARN_ONs from ceph_set_page_dirty watchdog: Fix possible use-after-free by calling del_timer_sync() watchdog: sc520_wdt: Fix possible use-after-free in wdt_turnoff() watchdog: Fix possible use-after-free in wdt_startup() ARM: 9087/1: kprobes: test-thumb: fix for LLVM_IAS=1 power: reset: gpio-poweroff: add missing MODULE_DEVICE_TABLE power: supply: ab8500: Avoid NULL pointers pwm: spear: Don't modify HW state in .remove callback lib/decompress_unlz4.c: correctly handle zero-padding around initrds. ALSA: hda: Add IRQ check for platform_get_irq() backlight: lm3630a: Fix return code of .update_status() callback powerpc/boot: Fixup device-tree on little endian usb: gadget: hid: fix error return code in hid_bind() usb: gadget: f_hid: fix endianness issue with descriptors ALSA: bebob: add support for ToneWeal FW66 ASoC: soc-core: Fix the error return code in snd_soc_of_parse_audio_routing() selftests/powerpc: Fix "no_handler" EBB selftest ALSA: ppc: fix error return code in snd_pmac_probe() gpio: zynq: Check return value of pm_runtime_get_sync powerpc/ps3: Add dma_mask to ps3_dma_region ALSA: sb: Fix potential double-free of CSP mixer elements mfd: da9052/stmpe: Add and modify MODULE_DEVICE_TABLE scsi: iscsi: Add iscsi_cls_conn refcount helpers fs/jfs: Fix missing error code in lmLogInit() tty: serial: 8250: serial_cs: Fix a memory leak in error handling path scsi: lpfc: Fix "Unexpected timeout" error in direct attach topology Revert "ALSA: bebob/oxfw: fix Kconfig entry for Mackie d.2 Pro" misc/libmasm/module: Fix two use after free in ibmasm_init_one tty: serial: fsl_lpuart: fix the potential risk of division or modulo by zero KVM: X86: Disable hardware breakpoints unconditionally before kvm_x86->run() KVM: x86: Use guest MAXPHYADDR from CPUID.0x8000_0008 iff TDP is enabled jfs: fix GPF in diFree media: uvcvideo: Fix pixel format change for Elgato Cam Link 4K media: gspca/sunplus: fix zero-length control requests media: gspca/sq905: fix control-request direction media: zr364xx: fix memory leak in zr364xx_start_readpipe dm btree remove: assign new_root only when removal succeeds ipack/carriers/tpci200: Fix a double free in tpci200_pci_probe seq_buf: Fix overflow in seq_buf_putmem_hex() power: supply: ab8500: Fix an old bug ipmi/watchdog: Stop watchdog timer when the current action is 'none' ASoC: tegra: Set driver_name=tegra for all machine drivers ata: ahci_sunxi: Disable DIPM mmc: sdhci: Fix warning message when accessing RPMB in HS400 mode powerpc/barrier: Avoid collision with clang's __lwsync macro mac80211: fix memory corruption in EAPOL handling can: bcm: delay release of struct bcm_op after synchronize_rcu() can: gw: synchronize rcu operations before removing gw job entry fuse: reject internal errno sctp: add size validation when walking chunks Bluetooth: btusb: fix bt fiwmare downloading failure issue for qca btsoc. Bluetooth: Shutdown controller after workqueues are flushed or cancelled Bluetooth: Fix the HCI to MGMT status conversion table RDMA/cma: Fix rdma_resolve_route() memory leak wireless: wext-spy: Fix out-of-bounds warning sfc: error code if SRIOV cannot be disabled sfc: avoid double pci_remove of VFs atm: nicstar: register the interrupt handler in the right place atm: nicstar: use 'dma_free_coherent' instead of 'kfree' cw1200: add missing MODULE_DEVICE_TABLE wl1251: Fix possible buffer overflow in wl1251_cmd_scan wlcore/wl12xx: Fix wl12xx get_mac error if device is in ELP xfrm: Fix error reporting in xfrm_state_construct. selinux: use __GFP_NOWARN with GFP_NOWAIT in the AVC net: micrel: check return value after calling platform_get_resource() dm space maps: don't reset space map allocation cursor when committing RDMA/cxgb4: Fix missing error code in create_qp() ipv6: use prandom_u32() for ID generation e100: handle eeprom as little endian udf: Fix NULL pointer dereference in udf_symlink function drm/virtio: Fix double free on probe failure reiserfs: add check for invalid 1st journal block net: Treat __napi_schedule_irqoff() as __napi_schedule() on PREEMPT_RT atm: nicstar: Fix possible use-after-free in nicstar_cleanup() mISDN: fix possible use-after-free in HFC_cleanup() atm: iphase: fix possible use-after-free in ia_module_exit() hugetlb: clear huge pte during flush function on mips platform net: pch_gbe: Use proper accessors to BE data in pch_ptp_match() scsi: core: Retry I/O for Notify (Enable Spinup) Required error mmc: vub3000: fix control-request direction extcon: max8997: Add missing modalias string extcon: sm5502: Drop invalid register write in sm5502_reg_data phy: ti: dm816x: Fix the error handling path in 'dm816x_usb_phy_probe() scsi: mpt3sas: Fix error return value in _scsih_expander_add() staging: gdm724x: check for overflow in gdm_lte_netif_rx() staging: gdm724x: check for buffer overflow in gdm_lte_multi_sdu_pkt() s390: appldata depends on PROC_SYSCTL scsi: FlashPoint: Rename si_flags field tty: nozomi: Fix the error handling path of 'nozomi_card_init()' char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol() Input: hil_kbd - fix error return code in hil_dev_connect() iio: accel: stk8ba50: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: accel: stk8312: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: accel: bma180: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: adis_buffer: do not return ints in irq handlers tty: nozomi: Fix a resource leak in an error handling function writeback: fix obtain a reference to a freeing memcg css i40e: Fix error handling in i40e_vsi_open vxlan: add missing rcu_read_lock() in neigh_reduce() net: ethernet: ezchip: fix error handling net: ethernet: ezchip: fix UAF in nps_enet_remove net: ethernet: aeroflex: fix UAF in greth_of_remove netfilter: nft_exthdr: check for IPv6 packet before further processing netlabel: Fix memory leak in netlbl_mgmt_add_common ath10k: Fix an error code in ath10k_add_interface() brcmsmac: mac80211_if: Fix a resource leak in an error handling path wireless: carl9170: fix LEDS build errors & warnings drm: qxl: ensure surf.data is ininitialized ehea: fix error return code in ehea_restart_qps() net: pch_gbe: Propagate error from devm_gpio_request_one() ACPI: sysfs: Fix a buffer overrun problem with description_show() crypto: nx - Fix RCU warning in nx842_OF_upd_status spi: spi-sun6i: Fix chipselect/clock bug media: s5p-g2d: Fix a memory leak on ctx->fh.m2m_ctx mmc: usdhi6rol0: fix error return code in usdhi6_probe() media: siano: Fix out-of-bounds warnings in smscore_load_firmware_family2() media: tc358743: Fix error return code in tc358743_probe_of() pata_ep93xx: fix deferred probing pata_octeon_cf: avoid WARN_ON() in ata_host_activate() media: I2C: change 'RST' to "RSET" to fix multiple build errors pata_rb532_cf: fix deferred probing sata_highbank: fix deferred probing crypto: ux500 - Fix error return code in hash_hw_final() crypto: ixp4xx - dma_unmap the correct address ia64: mca_drv: fix incorrect array size calculation platform/x86: toshiba_acpi: Fix missing error code in toshiba_acpi_setup_keyboard() ACPI: bus: Call kobject_put() in acpi_init() error path random32: Fix implicit truncation warning in prandom_seed_state() fs: dlm: cancel work sync othercon block_dump: remove block_dump feature in mark_inode_dirty() ACPI: processor idle: Fix up C-state latency if not ordered regulator: da9052: Ensure enough delay time for .set_voltage_time_sel btrfs: disable build on platforms having page size 256K media: dvb_net: avoid speculation from net slot crypto: shash - avoid comparing pointers to exported functions under CFI mmc: via-sdmmc: add a check against NULL pointer dereference media: bt8xx: Fix a missing check bug in bt878_probe media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release crypto: qat - remove unused macro in FW loader crypto: qat - check return code of qat_hal_rd_rel_reg() media: pvrusb2: fix warning in pvr2_i2c_core_done media: cpia2: fix memory leak in cpia2_usb_probe crypto: nx - add missing MODULE_DEVICE_TABLE spi: omap-100k: Fix the length judgment problem spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages() fuse: check connected before queueing on fpq->io seq_buf: Make trace_seq_putmem_hex() support data longer than 8 ssb: sdio: Don't overwrite const buffer if block_write fails ath9k: Fix kernel NULL pointer dereference during ath_reset_internal() serial_cs: Add Option International GSM-Ready 56K/ISDN modem iio: ltr501: ltr501_read_ps(): add missing endianness conversion iio: ltr501: ltr559: fix initialization of LTR501_ALS_CONTR iio: ltr501: mark register holding upper 8 bits of ALS_DATA{0,1} and PS_DATA as volatile, too s390/cio: dont call css_wait_for_slow_path() inside a lock SUNRPC: Should wake up the privileged task firstly. SUNRPC: Fix the batch tasks count wraparound. ext4: fix avefreec in find_group_orlov ext4: remove check for zero nr_to_scan in ext4_es_scan() ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit ext4: fix kernel infoleak via ext4_extent_header btrfs: clear defrag status of a root if starting transaction fails ARM: dts: at91: sama5d4: fix pinctrl muxing Input: joydev - prevent use of not validated data in JSIOCSBTNMAP ioctl iov_iter_fault_in_readable() should do nothing in xarray case ntfs: fix validity check for file name attribute USB: cdc-acm: blacklist Heimann USB Appset device usb: gadget: eem: fix echo command packet response issue net: can: ems_usb: fix use-after-free in ems_usb_disconnect() Input: usbtouchscreen - fix control-request directions media: dvb-usb: fix wrong definition ALSA: usb-audio: fix rate on Ozone Z90 USB headset Conflicts: fs/fs-writeback.c Change-Id: I0289ec1f34d8d56baf317d7360b17b3fbd1ad164
270 lines
7.1 KiB
C
270 lines
7.1 KiB
C
/*
|
|
* Hash algorithms.
|
|
*
|
|
* Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
|
|
*
|
|
* 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 _CRYPTO_INTERNAL_HASH_H
|
|
#define _CRYPTO_INTERNAL_HASH_H
|
|
|
|
#include <crypto/algapi.h>
|
|
#include <crypto/hash.h>
|
|
|
|
struct ahash_request;
|
|
struct scatterlist;
|
|
|
|
struct crypto_hash_walk {
|
|
char *data;
|
|
|
|
unsigned int offset;
|
|
unsigned int alignmask;
|
|
|
|
struct page *pg;
|
|
unsigned int entrylen;
|
|
|
|
unsigned int total;
|
|
struct scatterlist *sg;
|
|
|
|
unsigned int flags;
|
|
};
|
|
|
|
struct ahash_instance {
|
|
struct ahash_alg alg;
|
|
};
|
|
|
|
struct shash_instance {
|
|
struct shash_alg alg;
|
|
};
|
|
|
|
struct crypto_ahash_spawn {
|
|
struct crypto_spawn base;
|
|
};
|
|
|
|
struct crypto_shash_spawn {
|
|
struct crypto_spawn base;
|
|
};
|
|
|
|
extern const struct crypto_type crypto_ahash_type;
|
|
|
|
int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err);
|
|
int crypto_hash_walk_first(struct ahash_request *req,
|
|
struct crypto_hash_walk *walk);
|
|
int crypto_ahash_walk_first(struct ahash_request *req,
|
|
struct crypto_hash_walk *walk);
|
|
int crypto_hash_walk_first_compat(struct hash_desc *hdesc,
|
|
struct crypto_hash_walk *walk,
|
|
struct scatterlist *sg, unsigned int len);
|
|
|
|
static inline int crypto_ahash_walk_done(struct crypto_hash_walk *walk,
|
|
int err)
|
|
{
|
|
return crypto_hash_walk_done(walk, err);
|
|
}
|
|
|
|
static inline int crypto_hash_walk_last(struct crypto_hash_walk *walk)
|
|
{
|
|
return !(walk->entrylen | walk->total);
|
|
}
|
|
|
|
static inline int crypto_ahash_walk_last(struct crypto_hash_walk *walk)
|
|
{
|
|
return crypto_hash_walk_last(walk);
|
|
}
|
|
|
|
int crypto_register_ahash(struct ahash_alg *alg);
|
|
int crypto_unregister_ahash(struct ahash_alg *alg);
|
|
int ahash_register_instance(struct crypto_template *tmpl,
|
|
struct ahash_instance *inst);
|
|
void ahash_free_instance(struct crypto_instance *inst);
|
|
|
|
bool crypto_shash_alg_has_setkey(struct shash_alg *alg);
|
|
|
|
bool crypto_hash_alg_has_setkey(struct hash_alg_common *halg);
|
|
|
|
int crypto_init_ahash_spawn(struct crypto_ahash_spawn *spawn,
|
|
struct hash_alg_common *alg,
|
|
struct crypto_instance *inst);
|
|
|
|
static inline void crypto_drop_ahash(struct crypto_ahash_spawn *spawn)
|
|
{
|
|
crypto_drop_spawn(&spawn->base);
|
|
}
|
|
|
|
struct hash_alg_common *ahash_attr_alg(struct rtattr *rta, u32 type, u32 mask);
|
|
|
|
int crypto_register_shash(struct shash_alg *alg);
|
|
int crypto_unregister_shash(struct shash_alg *alg);
|
|
int crypto_register_shashes(struct shash_alg *algs, int count);
|
|
int crypto_unregister_shashes(struct shash_alg *algs, int count);
|
|
int shash_register_instance(struct crypto_template *tmpl,
|
|
struct shash_instance *inst);
|
|
void shash_free_instance(struct crypto_instance *inst);
|
|
|
|
int crypto_grab_shash(struct crypto_shash_spawn *spawn,
|
|
const char *name, u32 type, u32 mask);
|
|
int crypto_init_shash_spawn(struct crypto_shash_spawn *spawn,
|
|
struct shash_alg *alg,
|
|
struct crypto_instance *inst);
|
|
|
|
static inline void crypto_drop_shash(struct crypto_shash_spawn *spawn)
|
|
{
|
|
crypto_drop_spawn(&spawn->base);
|
|
}
|
|
|
|
static inline struct shash_alg *crypto_spawn_shash_alg(
|
|
struct crypto_shash_spawn *spawn)
|
|
{
|
|
return container_of(spawn->base.alg, struct shash_alg, base);
|
|
}
|
|
|
|
struct shash_alg *shash_attr_alg(struct rtattr *rta, u32 type, u32 mask);
|
|
|
|
int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc);
|
|
int shash_ahash_finup(struct ahash_request *req, struct shash_desc *desc);
|
|
int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc);
|
|
|
|
int shash_ahash_mcryptd_update(struct ahash_request *req,
|
|
struct shash_desc *desc);
|
|
int shash_ahash_mcryptd_final(struct ahash_request *req,
|
|
struct shash_desc *desc);
|
|
int shash_ahash_mcryptd_finup(struct ahash_request *req,
|
|
struct shash_desc *desc);
|
|
int shash_ahash_mcryptd_digest(struct ahash_request *req,
|
|
struct shash_desc *desc);
|
|
|
|
int crypto_init_shash_ops_async(struct crypto_tfm *tfm);
|
|
|
|
static inline void *crypto_ahash_ctx(struct crypto_ahash *tfm)
|
|
{
|
|
return crypto_tfm_ctx(crypto_ahash_tfm(tfm));
|
|
}
|
|
|
|
static inline struct ahash_alg *__crypto_ahash_alg(struct crypto_alg *alg)
|
|
{
|
|
return container_of(__crypto_hash_alg_common(alg), struct ahash_alg,
|
|
halg);
|
|
}
|
|
|
|
static inline void crypto_ahash_set_reqsize(struct crypto_ahash *tfm,
|
|
unsigned int reqsize)
|
|
{
|
|
tfm->reqsize = reqsize;
|
|
}
|
|
|
|
static inline struct crypto_instance *ahash_crypto_instance(
|
|
struct ahash_instance *inst)
|
|
{
|
|
return container_of(&inst->alg.halg.base, struct crypto_instance, alg);
|
|
}
|
|
|
|
static inline struct ahash_instance *ahash_instance(
|
|
struct crypto_instance *inst)
|
|
{
|
|
return container_of(&inst->alg, struct ahash_instance, alg.halg.base);
|
|
}
|
|
|
|
static inline void *ahash_instance_ctx(struct ahash_instance *inst)
|
|
{
|
|
return crypto_instance_ctx(ahash_crypto_instance(inst));
|
|
}
|
|
|
|
static inline unsigned int ahash_instance_headroom(void)
|
|
{
|
|
return sizeof(struct ahash_alg) - sizeof(struct crypto_alg);
|
|
}
|
|
|
|
static inline struct ahash_instance *ahash_alloc_instance(
|
|
const char *name, struct crypto_alg *alg)
|
|
{
|
|
return crypto_alloc_instance2(name, alg, ahash_instance_headroom());
|
|
}
|
|
|
|
static inline void ahash_request_complete(struct ahash_request *req, int err)
|
|
{
|
|
req->base.complete(&req->base, err);
|
|
}
|
|
|
|
static inline u32 ahash_request_flags(struct ahash_request *req)
|
|
{
|
|
return req->base.flags;
|
|
}
|
|
|
|
static inline struct crypto_ahash *crypto_spawn_ahash(
|
|
struct crypto_ahash_spawn *spawn)
|
|
{
|
|
return crypto_spawn_tfm2(&spawn->base);
|
|
}
|
|
|
|
static inline int ahash_enqueue_request(struct crypto_queue *queue,
|
|
struct ahash_request *request)
|
|
{
|
|
return crypto_enqueue_request(queue, &request->base);
|
|
}
|
|
|
|
static inline struct ahash_request *ahash_dequeue_request(
|
|
struct crypto_queue *queue)
|
|
{
|
|
return ahash_request_cast(crypto_dequeue_request(queue));
|
|
}
|
|
|
|
static inline int ahash_tfm_in_queue(struct crypto_queue *queue,
|
|
struct crypto_ahash *tfm)
|
|
{
|
|
return crypto_tfm_in_queue(queue, crypto_ahash_tfm(tfm));
|
|
}
|
|
|
|
static inline void *crypto_shash_ctx(struct crypto_shash *tfm)
|
|
{
|
|
return crypto_tfm_ctx(&tfm->base);
|
|
}
|
|
|
|
static inline struct crypto_instance *shash_crypto_instance(
|
|
struct shash_instance *inst)
|
|
{
|
|
return container_of(&inst->alg.base, struct crypto_instance, alg);
|
|
}
|
|
|
|
static inline struct shash_instance *shash_instance(
|
|
struct crypto_instance *inst)
|
|
{
|
|
return container_of(__crypto_shash_alg(&inst->alg),
|
|
struct shash_instance, alg);
|
|
}
|
|
|
|
static inline void *shash_instance_ctx(struct shash_instance *inst)
|
|
{
|
|
return crypto_instance_ctx(shash_crypto_instance(inst));
|
|
}
|
|
|
|
static inline struct shash_instance *shash_alloc_instance(
|
|
const char *name, struct crypto_alg *alg)
|
|
{
|
|
return crypto_alloc_instance2(name, alg,
|
|
sizeof(struct shash_alg) - sizeof(*alg));
|
|
}
|
|
|
|
static inline struct crypto_shash *crypto_spawn_shash(
|
|
struct crypto_shash_spawn *spawn)
|
|
{
|
|
return crypto_spawn_tfm2(&spawn->base);
|
|
}
|
|
|
|
static inline void *crypto_shash_ctx_aligned(struct crypto_shash *tfm)
|
|
{
|
|
return crypto_tfm_ctx_aligned(&tfm->base);
|
|
}
|
|
|
|
static inline struct crypto_shash *__crypto_shash_cast(struct crypto_tfm *tfm)
|
|
{
|
|
return container_of(tfm, struct crypto_shash, base);
|
|
}
|
|
|
|
#endif /* _CRYPTO_INTERNAL_HASH_H */
|
|
|