mirror of
https://github.com/LineageOS/android_kernel_fxtec_sm6115.git
synced 2026-04-03 03:33:16 +00:00
version 4.19.325-cip128 * tag 'v4.19.325-cip128' of https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip: CIP: Bump version suffix to -cip128 after merge from cip/linux-4.19.y-st tree Update localversion-st, tree is up-to-date with 5.10.248. NFSv4: ensure the open stateid seqid doesn't go backwards libceph: make calc_target() set t->paused, not just clear it crypto: af_alg - zero initialize memory allocated via sock_kmalloc jbd2: fix the inconsistency between checksum and data in memory for journal sb f2fs: fix to detect recoverable inode during dryrun of find_fsync_dnodes() NFS: add barriers when testing for NFS_FSDATA_BLOCKED NFS: unlink/rmdir shouldn't call d_delete() twice on ENOENT efi/cper: Fix cper_bits_to_str buffer handling and return value iommu/omap: fix device leaks on probe_device() crypto: seqiv - Do not use req->iv after crypto_aead_encrypt f2fs: fix return value of f2fs_recover_fsync_data() ext4: improve integrity checking in __mb_check_buddy by enhancing order-0 validation ext4: remove unused return value of __mb_check_buddy clk: renesas: r9a06g032: Fix memory leak in error path nbd: defer config put in recv_work jbd2: avoid bug_on in jbd2_journal_get_create_access() when file system corrupted scsi: sg: Fix occasional bogus elapsed time that exceeds timeout powercap: fix sscanf() error return value handling powercap: fix race condition in register_control_type() arp: do not assume dev_hard_header() does not change skb->head net: usb: pegasus: fix memory leak in update_eth_regs_async() HID: quirks: work around VID/PID conflict for appledisplay netdev: preserve NETIF_F_ALL_FOR_ALL across TSO updates net: sock: fix hardened usercopy panic in sock_recv_errqueue inet: ping: Fix icmp out counting netfilter: nf_conncount: update last_gc only when GC has been performed ARM: dts: imx6q-ba16: fix RTC interrupt level scsi: ipr: Enable/disable IRQD_NO_BALANCING during reset alpha: don't reference obsolete termio struct for TC* constants ARM: 9461/1: Disable HIGHPTE on PREEMPT_RT kernels ext4: fix out-of-bound read in ext4_xattr_inode_dec_ref_all() ext4: introduce ITAIL helper libceph: make free_choose_arg_map() resilient to partial allocation libceph: replace overzealous BUG_ON in osdmap_apply_incremental() wifi: avoid kernel-infoleak from struct iw_point drm/pl111: Fix error handling in pl111_amba_probe net: 3com: 3c59x: fix possible null dereference in vortex_probe1() atm: Fix dma_free_coherent() size Revert "iommu/amd: Skip enabling command/event buffers for kdump" pwm: stm32: Always program polarity bus: fsl-mc-bus: fix KASAN use-after-free in fsl_mc_bus_remove() scsi: iscsi_tcp: Fix UAF during logout when accessing the shost ipaddress scsi: iscsi: Move pool freeing wifi: mac80211: Discard Beacon frames to non-broadcast address media: samsung: exynos4-is: fix potential ABBA deadlock on init media: vpif_capture: fix section mismatch media: renesas: rcar_drif: fix device node reference leak in rcar_drif_bond_enabled SUNRPC: svcauth_gss: avoid NULL deref on zero length gss_token in gss_read_proxy_verf NFSD: Clear SECLABEL in the suppattr_exclcreat bitmap usb: ohci-nxp: fix device leak on probe failure usb: ohci-nxp: Use helper function devm_clk_get_enabled() f2fs: fix to avoid updating zero-sized extent in extent cache ext4: fix string copying in parse_apply_sb_mount_options() ALSA: wavefront: Fix integer overflow in sample size validation ALSA: wavefront: Clear substream pointers on close usb: gadget: udc: fix use-after-free in usb_gadget_state_work HID: core: Harden s32ton() against conversion to 0 bits ipv4: Fix uninit-value access in __ip_make_skb() ipv6: Fix potential uninit-value access in __ip6_make_skb() virtio_console: fix order of fields cols and rows drm/nouveau/dispnv50: Don't call drm_atomic_get_crtc_state() in prepare_fb net: nfc: fix deadlock between nfc_unregister_device and rfkill_fop_write net: usb: sr9700: fix incorrect command used to write single register fjes: Add missing iounmap in fjes_hw_init() e1000: fix OOB in e1000_tbi_should_accept() RDMA/core: Check for the presence of LS_NLA_TYPE_DGID correctly media: i2c: adv7842: Remove redundant cancel_delayed_work in probe media: i2c: ADV7604: Remove redundant cancel_delayed_work in probe media: TDA1997x: Remove redundant cancel_delayed_work in probe media: msp3400: Avoid possible out-of-bounds array accesses in msp3400c_thread() media: cec: Fix debugfs leak on bus_register() failure fbdev: tcx.c fix mem_map to correct smem_start offset fbdev: pxafb: Fix multiple clamped values in pxafb_adjust_timing fbdev: gbefb: fix to use physical address instead of dma address media: adv7842: Avoid possible out-of-bounds array accesses in adv7842_cp_log_status() parisc: entry: set W bit for !compat tasks in syscall_restore_rfi() parisc: entry.S: fix space adjustment on interruption for 64-bit userspace media: rc: st_rc: Fix reset control resource leak PCI/PM: Reinstate clearing state_saved in legacy and !PM codepaths iommu/exynos: fix device leak on of_xlate() ASoC: qcom: qdsp6: q6asm-dai: set 10 ms period and buffer alignment. ASoC: qcom: q6adm: the the copp device only during last instance ASoC: qcom: q6asm-dai: perform correct state check before closing selftests/ftrace: traceonoff_triggers: strip off names RDMA/bnxt_re: fix dma_free_coherent() pointer net: rose: fix invalid array index in rose_kill_by_device() ipv4: Fix reference count leak when using error routes with nexthop objects ipv6: BUG() in pskb_expand_head() as part of calipso_skbuff_setattr() net: bridge: Describe @tunnel_hash member in net_bridge_vlan_group struct net: dsa: b53: skip multicast entries for fdb_dump() firewire: nosy: Fix dma_free_coherent() size firewire: nosy: switch from 'pci_' to 'dma_' API genalloc.h: fix htmldocs warning net: usb: rtl8150: fix memory leak on usb_submit_urb() failure team: fix check for port enabled in team_queue_override_port_prio_changed() platform/x86: ibm_rtl: fix EBDA signature search pointer arithmetic platform/x86: msi-laptop: add missing sysfs_remove_group() ip6_gre: make ip6gre_header() robust i40e: fix scheduling in set_rx_mode hwmon: (w83l786ng) Convert macros to functions to avoid TOCTOU hwmon: (w83791d) Convert macros to functions to avoid TOCTOU rpmsg: glink: fix rpmsg device leak amba: tegra-ahb: Fix device leak on SMMU enable nfsd: Mark variable __maybe_unused to avoid W=1 build break PM: runtime: Do not clear needs_force_resume with enabled runtime PM tracing: Do not register unsupported perf events KVM: x86: Fix VM hard lockup after prolonged inactivity with periodic HV timer KVM: x86: Explicitly set new periodic hrtimer expiration in apic_timer_fn() KVM: x86: WARN if hrtimer callback for periodic APIC timer fires with period=0 libceph: make decode_pool() more resilient against corrupted osdmaps parisc: Do not reprogram affinitiy on ASP chip ocfs2: fix kernel BUG in ocfs2_find_victim_chain tools/testing/nvdimm: Use per-DIMM device handle f2fs: invalidate dentry cache on failed whiteout creation scsi: target: Reset t_task_cdb pointer in error case NFSD: use correct reservation type in nfsd4_scsi_fence_client scsi: aic94xx: fix use-after-free in device removal path cpufreq: nforce2: fix reference count leak in nforce2 char: applicom: fix NULL pointer dereference in ac_ioctl usb: renesas_usbhs: Fix a resource leak in usbhs_pipe_malloc() media: pvrusb2: Fix incorrect variable used in trace message media: dvb-usb: dtv5100: fix out-of-bounds in dtv5100_i2c_msg() usb: usb-storage: Maintain minimal modifications to the bcdDevice range. media: v4l2-mem2mem: Fix outdated documentation jbd2: use a weaker annotation in journal handling ext4: fix incorrect group number assertion in mb_check_buddy ext4: xattr: fix null pointer deref in ext4_raw_inode() ktest.pl: Fix uninitialized var in config-bisect.pl floppy: fix for PAGE_SIZE != 4KB usb: usb-storage: No additional quirks need to be added to the EL-R12 optical drive. usb: xhci: limit run_graceperiod for only usb 3.0 devices usb: typec: ucsi: Handle incorrect num_connectors capability via_wdt: fix critical boot hang due to unnamed resource allocation scsi: qla2xxx: Use reinit_completion on mbx_intr_comp powerpc/addnote: Fix overflow on 32-bit builds clk: mvebu: cp110 add CLK_IGNORE_UNUSED to pcie_x10, pcie_x11 & pcie_x4 ipmi: Fix __scan_channels() failing to rescan channels ipmi: Fix the race between __scan_channels() and deliver_response() ALSA: usb-mixer: us16x08: validate meter packet indices ALSA: pcmcia: Fix resource leak in snd_pdacf_probe error path ALSA: vxpocket: Fix resource leak in vxpocket_probe error path spi: fsl-cpm: Check length parity before switching to 16 bit mode Input: ti_am335x_tsc - fix off-by-one error in wire_order validation MIPS: Fix a reference leak bug in ip22_check_gio() hwmon: (ibmpex) fix use-after-free in high/low store net/mlx5: fw_tracer, Handle escaped percent properly net/mlx5: fw_tracer, Validate format string parameters net/mlx5: fw_tracer, Add support for unrecognized string nfc: pn533: Fix error code in pn533_acr122_poweron_rdr() caif: fix integer underflow in cffrml_receive() ipvs: fix ipv4 null-ptr-deref in route error path netfilter: nf_conncount: fix leaked ct in error paths broadcom: b44: prevent uninitialized value usage net: openvswitch: fix middle attribute validation in push_nsh() action mlxsw: spectrum_router: Fix neighbour use-after-free ipvlan: Ignore PACKET_LOOPBACK in handle_mode_l2() netrom: Fix memory leak in nr_sendmsg() btrfs: scrub: always update btrfs_scrub_progress::last_physical hfsplus: fix volume corruption issue for generic/073 hfsplus: Verify inode mode when loading from disk hfsplus: fix missing hfs_bnode_get() in __hfs_bnode_create hfsplus: fix volume corruption issue for generic/070 cpufreq: s5pv210: fix refcount leak ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only ACPICA: Avoid walking the Namespace if start_node is NULL netfilter: nft_connlimit: memleak if nf_ct_netns_get() fails netfilter: nf_conncount: garbage collection is not skipped when jiffies wrap around NFS: Fix missing unlock in nfs_unlink() ALSA: dice: fix buffer overflow in detect_stream_formats() usb: phy: Initialize struct usb_phy list_head ocfs2: fix memory leak in ocfs2_merge_rec_left() efi/cper: Adjust infopfx size to accept an extra space efi/cper: Add a new helper function to print bitmasks dm log-writes: Add missing set_freezable() for freezable kthread dm-raid: fix possible NULL dereference with undefined raid type ARM: 9464/1: fix input-only operand modification in load_unaligned_zeropad() ALSA: uapi: Fix typo in asound.h comment fs/nls: Fix inconsistency between utf8_to_utf32() and utf32_to_utf8() NFSv4/pNFS: Clear NFS_INO_LAYOUTCOMMIT in pnfs_mark_layout_stateid_invalid fs/nls: Fix utf16 to utf8 conversion NFS: don't unhash dentry during unlink/rename NFS: Label the dentry with a verifier in nfs_rmdir() and nfs_unlink() fbdev: ssd1307fb: fix potential page leak in ssd1307fb_probe() pinctrl: single: Fix incorrect type for error return variable pinctrl: single: Fix PIN_CONFIG_BIAS_DISABLE handling perf tools: Fix split kallsyms DSO counting net/sched: sch_cake: Fix incorrect qlen reduction in cake_drop mtd: lpddr_cmds: fix signed shifts in lpddr_cmds netfilter: nft_connlimit: update the count if add was skipped netfilter: nf_conncount: rework API to use sk_buff directly netfilter: nf_conncount: reduce unnecessary GC netfilter: nft_connlimit: move stateful fields out of expression data regulator: core: Protect regulator_supply_alias_list with regulator_list_mutex virtio: fix virtqueue_set_affinity() docs ACPI: processor_core: fix map_x2apic_id for amd-pstate on am4 backlight: lp855x: Fix lp855x.h kernel-doc warnings staging: fbtft: core: fix potential memory leak in fbtft_probe_common() usb: dwc2: fix hang during shutdown if set as peripheral usb: dwc2: disable platform lowlevel hw resources during shutdown usb: chaoskey: fix locking for O_NONBLOCK wifi: rtl818x: rtl8187: Fix potential buffer underflow in rtl8187_rx_cb() powerpc/64s/ptdump: Fix kernel_hash_pagetable dump for ISA v3.00 HPTE format NFSD/blocklayout: Fix minlength check in proc_layoutget scsi: sim710: Fix resource leak by adding missing ioport_unmap() calls ACPI: property: Fix fwnode refcount leak in acpi_fwnode_graph_parse_endpoint() ocfs2: relax BUG() to ocfs2_error() in __ocfs2_move_extent() nbd: defer config unlock in nbd_genl_connect wifi: cw1200: Fix potential memory leak in cw1200_bh_rx_helper() macintosh/mac_hid: fix race condition in mac_hid_toggle_emumouse scsi: stex: Fix reboot_notifier leak in probe error path perf/x86/intel: Correct large PEBS flag check ext4: correct the checking of quota files before moving extents ext4: minor defrag code improvements mfd: da9055: Fix missing regmap_del_irq_chip() in error path scsi: target: Do not write NUL characters into ASCII configfs output power: supply: apm_power: only unset own apm_get_power_status power: supply: wm831x: Check wm831x_set_bits() return value kmsan: introduce __no_sanitize_memory and __no_kmsan_checks compiler-gcc.h: Define __SANITIZE_ADDRESS__ under hwaddress sanitizer s390/smp: Fix fallback CPU detection crypto: asymmetric_keys - prevent overflow in asymmetric_key_generate_id inet: Avoid ehash lookup race in inet_ehash_insert() rculist: Add hlist_nulls_replace_rcu() and hlist_nulls_replace_init_rcu() irqchip/qcom-irq-combiner: Fix section mismatch USB: Fix descriptor count when handling invalid MBIM extended descriptor drm/vgem-fence: Fix potential deadlock on release smack: fix bug: unprivileged task can create labels staging: rtl8723bs: fix stack buffer overflow in OnAssocReq IE parsing comedi: multiq3: sanitize config options in multiq3_attach() comedi: c6xdigio: Fix invalid PNP driver unregistration platform/x86: acer-wmi: Ignore backlight event bfs: Reconstruct file type when loading from disk spi: imx: keep dma request disabled before dma transfer setup spi: xilinx: increase number of retries before declaring stall USB: serial: kobil_sct: fix TIOCMBIS and TIOCMBIC USB: serial: belkin_sa: fix TIOCMBIS and TIOCMBIC serial: add support of CPCI cards USB: serial: ftdi_sio: match on interface number for jtag USB: serial: option: move Telit 0x10c7 composition in the right place USB: serial: option: add Telit Cinterion FE910C04 new compositions USB: serial: option: add Foxconn T99W760 ext4: add i_data_sem protection in ext4_destroy_inline_data_nolock() locking/spinlock/debug: Fix data-race in do_raw_write_lock ext4: refresh inline data size before write operations xfrm: flush all states in xfrm_state_fini xfrm: also call xfrm_state_delete_tunnel at destroy time for states that were never added Revert "xfrm: destroy xfrm_state synchronously on net exit path" xfrm: delete x->tunnel as we delete x Conflicts: drivers/rpmsg/qcom_glink_native.c drivers/usb/host/xhci-hub.c fs/f2fs/file.c fs/f2fs/super.c Change-Id: I9e00c074af0214588acc89a73fcfc928d1724b7a
189 lines
5.6 KiB
C
189 lines
5.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __LINUX_COMPILER_TYPES_H
|
|
#error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
|
|
#endif
|
|
|
|
/*
|
|
* Common definitions for all gcc versions go here.
|
|
*/
|
|
#define GCC_VERSION (__GNUC__ * 10000 \
|
|
+ __GNUC_MINOR__ * 100 \
|
|
+ __GNUC_PATCHLEVEL__)
|
|
|
|
#if GCC_VERSION < 40600
|
|
# error Sorry, your compiler is too old - please upgrade it.
|
|
#elif defined(CONFIG_ARM64) && GCC_VERSION < 50100
|
|
/*
|
|
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293
|
|
* https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk
|
|
*/
|
|
# error Sorry, your version of GCC is too old - please use 5.1 or newer.
|
|
#endif
|
|
|
|
/*
|
|
* This macro obfuscates arithmetic on a variable address so that gcc
|
|
* shouldn't recognize the original var, and make assumptions about it.
|
|
*
|
|
* This is needed because the C standard makes it undefined to do
|
|
* pointer arithmetic on "objects" outside their boundaries and the
|
|
* gcc optimizers assume this is the case. In particular they
|
|
* assume such arithmetic does not wrap.
|
|
*
|
|
* A miscompilation has been observed because of this on PPC.
|
|
* To work around it we hide the relationship of the pointer and the object
|
|
* using this macro.
|
|
*
|
|
* Versions of the ppc64 compiler before 4.1 had a bug where use of
|
|
* RELOC_HIDE could trash r30. The bug can be worked around by changing
|
|
* the inline assembly constraint from =g to =r, in this particular
|
|
* case either is valid.
|
|
*/
|
|
#define RELOC_HIDE(ptr, off) \
|
|
({ \
|
|
unsigned long __ptr; \
|
|
__asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
|
|
(typeof(ptr)) (__ptr + (off)); \
|
|
})
|
|
|
|
/*
|
|
* A trick to suppress uninitialized variable warning without generating any
|
|
* code
|
|
*/
|
|
#define uninitialized_var(x) x = x
|
|
|
|
#ifdef __CHECKER__
|
|
#define __must_be_array(a) 0
|
|
#else
|
|
/* &a[0] degrades to a pointer: a different type from an array */
|
|
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
|
|
#endif
|
|
|
|
#ifdef CONFIG_RETPOLINE
|
|
#define __noretpoline __attribute__((indirect_branch("keep")))
|
|
#endif
|
|
|
|
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
|
|
|
|
#define __optimize(level) __attribute__((__optimize__(level)))
|
|
|
|
#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
|
|
|
|
#ifndef __CHECKER__
|
|
#define __compiletime_warning(message) __attribute__((warning(message)))
|
|
#define __compiletime_error(message) __attribute__((error(message)))
|
|
|
|
#ifdef LATENT_ENTROPY_PLUGIN
|
|
#define __latent_entropy __attribute__((latent_entropy))
|
|
#endif
|
|
#endif /* __CHECKER__ */
|
|
|
|
/*
|
|
* calling noreturn functions, __builtin_unreachable() and __builtin_trap()
|
|
* confuse the stack allocation in gcc, leading to overly large stack
|
|
* frames, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
|
|
*
|
|
* Adding an empty inline assembly before it works around the problem
|
|
*/
|
|
#define barrier_before_unreachable() asm volatile("")
|
|
|
|
/*
|
|
* Mark a position in code as unreachable. This can be used to
|
|
* suppress control flow warnings after asm blocks that transfer
|
|
* control elsewhere.
|
|
*
|
|
* Early snapshots of gcc 4.5 don't support this and we can't detect
|
|
* this in the preprocessor, but we can live with this because they're
|
|
* unreleased. Really, we need to have autoconf for the kernel.
|
|
*/
|
|
#define unreachable() \
|
|
do { \
|
|
annotate_unreachable(); \
|
|
barrier_before_unreachable(); \
|
|
__builtin_unreachable(); \
|
|
} while (0)
|
|
|
|
#if defined(RANDSTRUCT_PLUGIN) && !defined(__CHECKER__)
|
|
#define __randomize_layout __attribute__((randomize_layout))
|
|
#define __no_randomize_layout __attribute__((no_randomize_layout))
|
|
/* This anon struct can add padding, so only enable it under randstruct. */
|
|
#define randomized_struct_fields_start struct {
|
|
#define randomized_struct_fields_end } __randomize_layout;
|
|
#endif
|
|
|
|
/*
|
|
* GCC 'asm goto' miscompiles certain code sequences:
|
|
*
|
|
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
|
|
*
|
|
* Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
|
|
*
|
|
* (asm goto is automatically volatile - the naming reflects this.)
|
|
*/
|
|
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
|
|
|
|
/*
|
|
* sparse (__CHECKER__) pretends to be gcc, but can't do constant
|
|
* folding in __builtin_bswap*() (yet), so don't set these for it.
|
|
*/
|
|
#if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__)
|
|
#define __HAVE_BUILTIN_BSWAP32__
|
|
#define __HAVE_BUILTIN_BSWAP64__
|
|
#if GCC_VERSION >= 40800
|
|
#define __HAVE_BUILTIN_BSWAP16__
|
|
#endif
|
|
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */
|
|
|
|
#if GCC_VERSION >= 70000
|
|
#define KASAN_ABI_VERSION 5
|
|
#elif GCC_VERSION >= 50000
|
|
#define KASAN_ABI_VERSION 4
|
|
#elif GCC_VERSION >= 40902
|
|
#define KASAN_ABI_VERSION 3
|
|
#endif
|
|
|
|
#if __has_attribute(__no_sanitize_address__)
|
|
#define __no_sanitize_address __attribute__((no_sanitize_address))
|
|
#else
|
|
#define __no_sanitize_address
|
|
#endif
|
|
|
|
#if GCC_VERSION >= 50100
|
|
#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
|
|
#endif
|
|
|
|
/*
|
|
* Treat __SANITIZE_HWADDRESS__ the same as __SANITIZE_ADDRESS__ in the kernel,
|
|
* matching the defines used by Clang.
|
|
*/
|
|
#ifdef __SANITIZE_HWADDRESS__
|
|
#define __SANITIZE_ADDRESS__
|
|
#endif
|
|
|
|
/*
|
|
* GCC does not support KMSAN.
|
|
*/
|
|
#define __no_sanitize_memory
|
|
#define __no_kmsan_checks
|
|
|
|
/*
|
|
* Turn individual warnings and errors on and off locally, depending
|
|
* on version.
|
|
*/
|
|
#define __diag_GCC(version, severity, s) \
|
|
__diag_GCC_ ## version(__diag_GCC_ ## severity s)
|
|
|
|
/* Severity used in pragma directives */
|
|
#define __diag_GCC_ignore ignored
|
|
#define __diag_GCC_warn warning
|
|
#define __diag_GCC_error error
|
|
|
|
#define __diag_str1(s) #s
|
|
#define __diag_str(s) __diag_str1(s)
|
|
#define __diag(s) _Pragma(__diag_str(GCC diagnostic s))
|
|
|
|
#if GCC_VERSION >= 80000
|
|
#define __diag_GCC_8(s) __diag(s)
|
|
#else
|
|
#define __diag_GCC_8(s)
|
|
#endif
|