Linux 5.10.120
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.10.120 kernel.
All users of the 5.10 kernel series must upgrade.
The updated 5.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/process/submitting-patches.rst | 2 Makefile | 2 arch/arm/boot/dts/s5pv210-aries.dtsi | 2 arch/powerpc/kvm/book3s_hv_uvmem.c | 8 + arch/x86/kernel/kvm.c | 41 ++++++--- arch/x86/kvm/x86.c | 31 ++++--- crypto/Kconfig | 2 crypto/drbg.c | 110 ++++++++++---------------- crypto/ecrdsa.c | 8 - drivers/bluetooth/hci_qca.c | 4 drivers/char/random.c | 2 drivers/char/tpm/tpm2-cmd.c | 11 ++ drivers/char/tpm/tpm_ibmvtpm.c | 1 drivers/crypto/caam/ctrl.c | 18 ++++ drivers/gpu/drm/i915/intel_pm.c | 2 drivers/hid/hid-ids.h | 1 drivers/hid/hid-multitouch.c | 9 ++ drivers/i2c/busses/i2c-ismt.c | 14 +++ drivers/i2c/busses/i2c-thunderx-pcidrv.c | 1 drivers/md/dm-crypt.c | 14 ++- drivers/md/dm-integrity.c | 2 drivers/md/dm-stats.c | 8 + drivers/md/dm-verity-target.c | 1 drivers/md/raid5.c | 47 +++++------ drivers/net/ethernet/faraday/ftgmac100.c | 5 + drivers/net/ipa/ipa_endpoint.c | 4 drivers/nfc/pn533/pn533.c | 5 - drivers/pinctrl/sunxi/pinctrl-suniv-f1c100s.c | 2 fs/exfat/balloc.c | 8 + fs/exfat/exfat_fs.h | 8 + fs/exfat/fatent.c | 8 - fs/io_uring.c | 47 +---------- fs/nfs/internal.h | 1 fs/nfsd/nfs4state.c | 12 -- fs/pipe.c | 33 ++++--- fs/xfs/libxfs/xfs_bmap.c | 5 + fs/xfs/libxfs/xfs_dir2.h | 2 fs/xfs/libxfs/xfs_dir2_sf.c | 2 fs/xfs/xfs_buf_item.c | 37 ++++---- fs/xfs/xfs_inode.c | 42 +++++---- fs/xfs/xfs_inode_item.c | 14 +++ fs/xfs/xfs_iwalk.c | 2 fs/xfs/xfs_log_cil.c | 22 ++++- fs/xfs/xfs_super.c | 10 +- include/crypto/drbg.h | 10 +- include/linux/pipe_fs_i.h | 2 include/net/netfilter/nf_conntrack_core.h | 7 + kernel/bpf/trampoline.c | 18 ++-- lib/Kconfig | 2 lib/assoc_array.c | 8 + lib/crypto/Kconfig | 17 ++-- lib/percpu-refcount.c | 1 mm/zsmalloc.c | 37 +++++++- net/core/filter.c | 4 net/key/af_key.c | 6 - net/netfilter/nf_tables_api.c | 36 +++++--- net/wireless/core.c | 8 - net/wireless/reg.c | 1 58 files changed, 459 insertions(+), 308 deletions(-)
Akira Yokosawa (1):
docs: submitting-patches: Fix crossref to 'The canonical patch format'
Al Viro (1):
percpu_ref_init(): clean ->percpu_count_ref on failure
Alex Elder (1):
net: ipa: compute proper aggregation limit
Chuck Lever (1):
NFSD: Fix possible sleep during nfsd4_release_lockowner()
Dan Carpenter (1):
dm integrity: fix error code in dm_integrity_ctr()
Darrick J. Wong (3):
xfs: detect overflows in bmbt records
xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks
xfs: fix an ABBA deadlock in xfs_rename
Dave Chinner (1):
xfs: Fix CIL throttle hang when CIL space used going backwards
David Howells (1):
pipe: Fix missing lock in pipe_resize_ring()
Fabio Estevam (1):
crypto: caam - fix i.MX6SX entropy delay value
Florian Westphal (1):
netfilter: conntrack: re-fetch conntrack after insertion
Greg Kroah-Hartman (1):
Linux 5.10.120
Gustavo A. R. Silva (1):
drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()
IotaHydrae (1):
pinctrl: sunxi: fix f1c100s uart2 function
Joel Stanley (1):
net: ftgmac100: Disable hardware checksum on AST2600
Jonathan Bakker (1):
ARM: dts: s5pv210: Correct interrupt name for bluetooth in Aries
Justin M. Forbes (1):
lib/crypto: add prompts back to crypto libraries
Kaixu Xia (1):
xfs: show the proper user quota options
Kuniyuki Iwashima (1):
pipe: make poll_usage boolean and annotate its access
Lin Ma (1):
nfc: pn533: Fix buggy cleanup order
Liu Jian (1):
bpf: Enlarge offset check value to INT_MAX in bpf_skb_{load,store}_bytes
Marek Maślanka (1):
HID: multitouch: Add support for Google Whiskers Touchpad
Mariusz Tkaczyk (1):
raid5: introduce MD_BROKEN
Mika Westerberg (1):
i2c: ismt: Provide a DMA buffer for Interrupt Cause Logging
Mikulas Patocka (2):
dm crypt: make printing of the key constant-time dm stats: add cond_resched when looping over entries
Miri Korenblit (1):
cfg80211: set custom regdomain after wiphy registration
Nicolai Stange (4):
crypto: drbg - prepare for more fine-grained tracking of seeding state
crypto: drbg - track whether DRBG was seeded with !rng_is_initialized()
crypto: drbg - move dynamic ->reseed_threshold adjustments to __drbg_seed()
crypto: drbg - make reseeding from get_random_bytes() synchronous
Pablo Neira Ayuso (2):
netfilter: nf_tables: disallow non-stateful expression in sets earlier
netfilter: nf_tables: sanitize nft_set_desc_concat_parse()
Paolo Bonzini (1):
x86, kvm: use correct GFP flags for preemption disabled
Pavel Begunkov (2):
io_uring: don't re-import iovecs from callbacks
io_uring: fix using under-expanded iters
Piyush Malgujar (1):
drivers: i2c: thunderx: Allow driver to work with ACPI defined TWSI controllers
Sarthak Kukreti (1):
dm verity: set DM_TARGET_IMMUTABLE feature flag
Sean Christopherson (2):
x86/kvm: Alloc dummy async #PF token outside of raw spinlock
KVM: x86: avoid calling x86 emulator without a decoded instruction
Stefan Mahnke-Hartmann (1):
tpm: Fix buffer access in tpm2_get_tpm_pt()
Stephen Brennan (1):
assoc_array: Fix BUG_ON during garbage collect
Steven Rostedt (1):
Bluetooth: hci_qca: Use del_timer_sync() before freeing
Sultan Alsawaf (1):
zsmalloc: fix races between asynchronous zspage free and page migration
Tadeusz Struk (1):
exfat: check if cluster num is valid
Tao Jin (1):
HID: multitouch: add quirks to enable Lenovo X12 trackpoint
Thomas Bartschies (1):
net: af_key: check encryption module availability consistency
Trond Myklebust (1):
NFS: Memory allocation failures are not server fatal errors
Vitaly Chikunov (1):
crypto: ecrdsa - Fix incorrect use of vli_cmp
Xiaomeng Tong (1):
KVM: PPC: Book3S HV: fix incorrect NULL check on list iterator
Xiu Jianfeng (1):
tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe()
Yuntao Wang (1):
bpf: Fix potential array overflow in bpf_trampoline_get_progs()
Greg Kroah-Hartman
maintainerDocumentation/process/submitting-patches.rst +1 -1
@@ -71,7 +71,7 @@ as you intend it to. The maintainer will thank you if you write your patch description in a form which can be easily pulled into Linux's source code management -system, ``git``, as a "commit log". See :ref:`explicit_in_reply_to`. +system, ``git``, as a "commit log". See :ref:`the_canonical_patch_format`. Solve only one problem per patch. If your description starts to get long, that's a sign that you probably need to split up your patch.
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 10 -SUBLEVEL = 119 +SUBLEVEL = 120 EXTRAVERSION = NAME = Dare mighty things
arch/arm/boot/dts/s5pv210-aries.dtsi +1 -1
@@ -896,7 +896,7 @@ bluetooth { device-wakeup-gpios = <&gpg3 4 GPIO_ACTIVE_HIGH>; interrupt-parent = <&gph2>; interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "host-wake"; + interrupt-names = "host-wakeup"; }; };
arch/powerpc/kvm/book3s_hv_uvmem.c +5 -3
@@ -359,13 +359,15 @@ static bool kvmppc_gfn_is_uvmem_pfn(unsigned long gfn, struct kvm *kvm,static bool kvmppc_next_nontransitioned_gfn (const struct kvm_memory_slot *memslot,struct kvm *kvm,unsigned long *gfn) { -struct kvmppc_uvmem_slot *p; +struct kvmppc_uvmem_slot *p =NULL , *iter;bool ret = false;unsigned long i; -list_for_each_entry (p, &kvm->arch.uvmem_pfns, list) -if (*gfn >= p->base_pfn && *gfn < p->base_pfn + p->nr_pfns) +list_for_each_entry (iter, &kvm->arch.uvmem_pfns, list) +if (*gfn >= iter->base_pfn && *gfn < iter->base_pfn + iter->nr_pfns) { + p = iter;break ; + }if (!p)return ret;/*
arch/x86/kernel/kvm.c +27 -14
62 lines not on this page · raw message
arch/x86/kvm/x86.c +19 -12
@@ -7295,7 +7295,7 @@ int kvm_skip_emulated_instruction(struct kvm_vcpu *vcpu) }EXPORT_SYMBOL_GPL (kvm_skip_emulated_instruction); -static bool kvm_vcpu_check_breakpoint (struct kvm_vcpu *vcpu,int *r) +static bool kvm_vcpu_check_code_breakpoint (struct kvm_vcpu *vcpu,int *r) {if (unlikely (vcpu->guest_debug &KVM_GUESTDBG_USE_HW_BP ) && (vcpu->arch.guest_debug_dr7 &DR7_BP_EN_MASK )) {
@@ -7364,25 +7364,23 @@ static bool is_vmware_backdoor_opcode(struct x86_emulate_ctxt *ctxt) }/* -* Decode to be emulated instruction. Return EMULATION_OK if success. +* Decode an instruction for emulation. The caller is responsible for handling +* code breakpoints. Note, manually detecting code breakpoints is unnecessary +* (and wrong) when emulating on an intercepted fault-like exception[*], as +* code breakpoints have higher priority and thus have already been done by +* hardware. +* +* [*] Except #MC, which is higher priority, but KVM should never emulate in +* response to a machine check. */ int x86_decode_emulated_instruction (struct kvm_vcpu *vcpu,int emulation_type,void *insn,int insn_len) { -int r =EMULATION_OK ;struct x86_emulate_ctxt *ctxt = vcpu->arch.emulate_ctxt; +int r;init_emulate_ctxt (vcpu); -/* -* We will reenter on the same instruction since we do not set -* complete_userspace_io. This does not handle watchpoints yet, -* those would be handled in the emulate_ops. -*/ -if (!(emulation_type &EMULTYPE_SKIP ) && -kvm_vcpu_check_breakpoint (vcpu, &r)) -return r; - ctxt->ud = emulation_type &EMULTYPE_TRAP_UD ; r =x86_decode_insn (ctxt, insn, insn_len);
@@ -7417,6 +7415,15 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,if (!(emulation_type &EMULTYPE_NO_DECODE )) {kvm_clear_exception_queue (vcpu); +/* +* Return immediately if RIP hits a code breakpoint, such #DBs +* are fault-like and are higher priority than any faults on +* the code fetch itself. +*/ +if (!(emulation_type &EMULTYPE_SKIP ) && +kvm_vcpu_check_code_breakpoint (vcpu, &r)) +return r; + r =x86_decode_emulated_instruction (vcpu, emulation_type, insn, insn_len);if (r !=EMULATION_OK ) {
crypto/Kconfig +0 -2
@@ -1941,5 +1941,3 @@ source "crypto/asymmetric_keys/Kconfig" source "certs/Kconfig" endif # if CRYPTO - -source "lib/crypto/Kconfig"
crypto/drbg.c +44 -66
205 lines not on this page · raw message
crypto/ecrdsa.c +4 -4
@@ -113,15 +113,15 @@ static int ecrdsa_verify(struct akcipher_request *req)/* Step 1: verify that 0 < r < q, 0 < s < q */ if (vli_is_zero (r, ndigits) || -vli_cmp (r, ctx->curve->n, ndigits) ==1 || +vli_cmp (r, ctx->curve->n, ndigits) >=0 ||vli_is_zero (s, ndigits) || -vli_cmp (s, ctx->curve->n, ndigits) ==1 ) +vli_cmp (s, ctx->curve->n, ndigits) >=0 )return -EKEYREJECTED ;/* Step 2: calculate hash (h) of the message (passed as input) */ /* Step 3: calculate e = h \mod q */ vli_from_le64 (e, digest, ndigits); -if (vli_cmp (e, ctx->curve->n, ndigits) ==1 ) +if (vli_cmp (e, ctx->curve->n, ndigits) >=0 )vli_sub (e, e, ctx->curve->n, ndigits);if (vli_is_zero (e, ndigits)) e[0 ] =1 ;
@@ -137,7 +137,7 @@ static int ecrdsa_verify(struct akcipher_request *req)/* Step 6: calculate point C = z_1P + z_2Q, and R = x_c \mod q */ ecc_point_mult_shamir (&cc, z1, &ctx->curve->g, z2, &ctx->pub_key, ctx->curve); -if (vli_cmp (cc.x, ctx->curve->n, ndigits) ==1 ) +if (vli_cmp (cc.x, ctx->curve->n, ndigits) >=0 )vli_sub (cc.x, cc.x, ctx->curve->n, ndigits);/* Step 7: if R == r signature is valid */
drivers/bluetooth/hci_qca.c +2 -2
@@ -689,9 +689,9 @@ static int qca_close(struct hci_uart *hu)skb_queue_purge (&qca->tx_wait_q);skb_queue_purge (&qca->txq);skb_queue_purge (&qca->rx_memdump_q); -del_timer (&qca->tx_idle_timer); -del_timer (&qca->wake_retrans_timer);destroy_workqueue (qca->workqueue); +del_timer_sync (&qca->tx_idle_timer); +del_timer_sync (&qca->wake_retrans_timer); qca->hu =NULL ;kfree_skb (qca->rx_skb);
drivers/char/random.c +0 -2
@@ -163,7 +163,6 @@ int __cold register_random_ready_notifier(struct notifier_block *nb)spin_unlock_irqrestore (&random_ready_chain_lock, flags);return ret; } -EXPORT_SYMBOL (register_random_ready_notifier);/* * Delete a previously registered readiness callback function.
@@ -178,7 +177,6 @@ int __cold unregister_random_ready_notifier(struct notifier_block *nb)spin_unlock_irqrestore (&random_ready_chain_lock, flags);return ret; } -EXPORT_SYMBOL (unregister_random_ready_notifier);static void __cold process_random_ready_list (void ) {
drivers/char/tpm/tpm2-cmd.c +10 -1
@@ -400,7 +400,16 @@ ssize_t tpm2_get_tpm_pt(struct tpm_chip *chip, u32 property_id, u32 *value,if (!rc) { out = (struct tpm2_get_cap_out *) &buf.data[TPM_HEADER_SIZE ]; - *value =be32_to_cpu (out->value); +/* +* To prevent failing boot up of some systems, Infineon TPM2.0 +* returns SUCCESS on TPM2_Startup in field upgrade mode. Also +* the TPM2_Getcapability command returns a zero length list +* in field upgrade mode. +*/ +if (be32_to_cpu (out->property_cnt) >0 ) + *value =be32_to_cpu (out->value); +else + rc = -ENODATA ; }tpm_buf_destroy (&buf);return rc;
drivers/char/tpm/tpm_ibmvtpm.c +1 -0
@@ -683,6 +683,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,if (!wait_event_timeout (ibmvtpm->crq_queue.wq, ibmvtpm->rtce_buf !=NULL ,HZ )) { + rc = -ENODEV ;dev_err (dev,"CRQ response timed out\n" ); goto init_irq_cleanup; }
drivers/crypto/caam/ctrl.c +18 -0
@@ -609,6 +609,13 @@ static bool check_version(struct fsl_mc_version *mc_version, u32 major, }#endif +static bool needs_entropy_delay_adjustment (void ) +{ +if (of_machine_is_compatible ("fsl,imx6sx" )) +return true; +return false; +} +/* Probe routine for CAAM top (controller) level */ static int caam_probe (struct platform_device *pdev) {
@@ -855,6 +862,8 @@ static int caam_probe(struct platform_device *pdev)* Also, if a handle was instantiated, do not change * the TRNG parameters. */ +if (needs_entropy_delay_adjustment ()) + ent_delay =12000 ;if (!(ctrlpriv->rng4_sh_init || inst_handles)) { dev_info(dev, "Entropy delay = %u\n",
@@ -871,6 +880,15 @@ static int caam_probe(struct platform_device *pdev)*/ ret =instantiate_rng (dev, inst_handles, gen_sk); +/* +* Entropy delay is determined via TRNG characterization. +* TRNG characterization is run across different voltages +* and temperatures. +* If worst case value for ent_dly is identified, +* the loop can be skipped for that platform. +*/ +if (needs_entropy_delay_adjustment ()) +break ;if (ret == -EAGAIN )/* * if here, the loop will rerun,
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -2846,7 +2846,7 @@ static void ilk_compute_wm_level(const struct drm_i915_private *dev_priv, }static void intel_read_wm_latency (struct drm_i915_private *dev_priv, -u16 wm[8 ]) +u16 wm[]) {struct intel_uncore *uncore = &dev_priv->uncore;
drivers/hid/hid-ids.h +1 -0
@@ -743,6 +743,7 @@#define USB_DEVICE_ID_LENOVO_X1_COVER 0x6085#define USB_DEVICE_ID_LENOVO_X1_TAB 0x60a3#define USB_DEVICE_ID_LENOVO_X1_TAB3 0x60b5 +#define USB_DEVICE_ID_LENOVO_X12_TAB 0x60fe#define USB_DEVICE_ID_LENOVO_OPTICAL_USB_MOUSE_600E 0x600e#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D 0x608d#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019 0x6019
drivers/hid/hid-multitouch.c +9 -0
@@ -1990,6 +1990,12 @@ static const struct hid_device_id mt_devices[] = { USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_TAB3) }, +/* Lenovo X12 TAB Gen 1 */ + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, +HID_DEVICE (BUS_USB ,HID_GROUP_MULTITOUCH_WIN_8 , +USB_VENDOR_ID_LENOVO , + USB_DEVICE_ID_LENOVO_X12_TAB) }, + /* MosArt panels */ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, MT_USB_DEVICE(USB_VENDOR_ID_ASUS,
@@ -2129,6 +2135,9 @@ static const struct hid_device_id mt_devices[] = { { .driver_data = MT_CLS_GOOGLE,HID_DEVICE (HID_BUS_ANY ,HID_GROUP_ANY ,USB_VENDOR_ID_GOOGLE , USB_DEVICE_ID_GOOGLE_TOUCH_ROSE) }, + { .driver_data = MT_CLS_GOOGLE, +HID_DEVICE (BUS_USB ,HID_GROUP_MULTITOUCH_WIN_8 ,USB_VENDOR_ID_GOOGLE , + USB_DEVICE_ID_GOOGLE_WHISKERS) },/* Generic MT device */ { HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID, HID_ANY_ID) },
drivers/i2c/busses/i2c-ismt.c +14 -0
@@ -82,6 +82,7 @@#define ISMT_DESC_ENTRIES 2/* number of descriptor entries */ #define ISMT_MAX_RETRIES 3/* number of SMBus retries to attempt */ +#define ISMT_LOG_ENTRIES 3/* number of interrupt cause log entries */ /* Hardware Descriptor Constants - Control Field */ #define ISMT_DESC_CWRL 0x01/* Command/Write Length */
@@ -175,6 +176,8 @@ struct ismt_priv {u8 head;/* ring buffer head pointer */ struct completion cmp;/* interrupt completion */ u8 buffer[I2C_SMBUS_BLOCK_MAX +16 ];/* temp R/W data buffer */ +dma_addr_t log_dma; +u32 *log; };static const struct pci_device_id ismt_ids[] = {
@@ -409,6 +412,9 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr,memset (desc,0 ,sizeof (struct ismt_desc )); desc->tgtaddr_rw =ISMT_DESC_ADDR_RW (addr, read_write); +/* Always clear the log entries */ +memset (priv->log,0 ,ISMT_LOG_ENTRIES *sizeof (u32)); +/* Initialize common control bits */ if (likely (pci_dev_msi_enabled (priv->pci_dev))) desc->control =ISMT_DESC_INT |ISMT_DESC_FAIR ;
@@ -693,6 +699,8 @@ static void ismt_hw_init(struct ismt_priv *priv)/* initialize the Master Descriptor Base Address (MDBA) */ writeq (priv->io_rng_dma, priv->smba +ISMT_MSTR_MDBA ); +writeq (priv->log_dma, priv->smba +ISMT_GR_SMTICL ); +/* initialize the Master Control Register (MCTRL) */ writel (ISMT_MCTRL_MEIE , priv->smba +ISMT_MSTR_MCTRL );
@@ -780,6 +788,12 @@ static int ismt_dev_init(struct ismt_priv *priv) priv->head =0 ;init_completion (&priv->cmp); + priv->log =dmam_alloc_coherent (&priv->pci_dev->dev, +ISMT_LOG_ENTRIES *sizeof (u32), + &priv->log_dma,GFP_KERNEL ); +if (!priv->log) +return -ENOMEM ; +return 0 ; }
drivers/i2c/busses/i2c-thunderx-pcidrv.c +1 -0
@@ -213,6 +213,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev, i2c->adap.bus_recovery_info = &octeon_i2c_recovery_info; i2c->adap.dev.parent = dev; i2c->adap.dev.of_node = pdev->dev.of_node; + i2c->adap.dev.fwnode = dev->fwnode;snprintf (i2c->adap.name,sizeof (i2c->adap.name),"Cavium ThunderX i2c adapter at %s" ,dev_name (dev));i2c_set_adapdata (&i2c->adap, i2c);
drivers/md/dm-crypt.c +11 -3
@@ -3404,6 +3404,11 @@ static int crypt_map(struct dm_target *ti, struct bio *bio)return DM_MAPIO_SUBMITTED ; } +static char hex2asc (unsigned char c) +{ +return c +'0' + ((unsigned )(9 - c) >>4 &0x27 ); +} +static void crypt_status (struct dm_target *ti,status_type_t type,unsigned status_flags,char *result,unsigned maxlen) {
@@ -3422,9 +3427,12 @@ static void crypt_status(struct dm_target *ti, status_type_t type,if (cc->key_size >0 ) {if (cc->key_string)DMEMIT (":%u:%s" , cc->key_size, cc->key_string); -else -for (i =0 ; i < cc->key_size; i++) -DMEMIT ("%02x" , cc->key[i]); +else { +for (i =0 ; i < cc->key_size; i++) { +DMEMIT ("%c%c" ,hex2asc (cc->key[i] >>4 ), +hex2asc (cc->key[i] &0xf )); + } + } }else DMEMIT ("-" );
drivers/md/dm-integrity.c +0 -2
@@ -4327,8 +4327,6 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv) }if (should_write_sb) { -int r; -init_journal (ic,0 , ic->journal_sections,0 ); r =dm_integrity_failed (ic);if (unlikely (r)) {
drivers/md/dm-stats.c +8 -0
@@ -224,6 +224,7 @@ void dm_stats_cleanup(struct dm_stats *stats)atomic_read (&shared->in_flight[READ ]), atomic_read(&shared->in_flight[WRITE])); } +cond_resched (); }dm_stat_free (&s->rcu_head); }
@@ -313,6 +314,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,for (ni =0 ; ni < n_entries; ni++) {atomic_set (&s->stat_shared[ni].in_flight[READ ],0 );atomic_set (&s->stat_shared[ni].in_flight[WRITE ],0 ); +cond_resched (); }if (s->n_histogram_entries) {
@@ -325,6 +327,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,for (ni =0 ; ni < n_entries; ni++) { s->stat_shared[ni].tmp.histogram = hi; hi += s->n_histogram_entries +1 ; +cond_resched (); } }
@@ -345,6 +348,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,for (ni =0 ; ni < n_entries; ni++) { p[ni].histogram = hi; hi += s->n_histogram_entries +1 ; +cond_resched (); } } }
@@ -474,6 +478,7 @@ static int dm_stats_list(struct dm_stats *stats, const char *program, }DMEMIT ("\n" ); } +cond_resched (); }mutex_unlock (&stats->mutex);
@@ -750,6 +755,7 @@ static void __dm_stat_clear(struct dm_stat *s, size_t idx_start, size_t idx_end,local_irq_enable (); } } +cond_resched (); } }
@@ -865,6 +871,8 @@ static int dm_stats_print(struct dm_stats *stats, int id,if (unlikely (sz +1 >= maxlen)) goto buffer_overflow; + +cond_resched (); }if (clear)
drivers/md/dm-verity-target.c +1 -0
@@ -1242,6 +1242,7 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv)static struct target_type verity_target = { .name ="verity" , + .features =DM_TARGET_IMMUTABLE , .version = {1 ,7 ,0 }, .module =THIS_MODULE , .ctr = verity_ctr,
drivers/md/raid5.c +22 -25
73 lines not on this page · raw message
drivers/net/ethernet/faraday/ftgmac100.c +5 -0
@@ -1893,6 +1893,11 @@ static int ftgmac100_probe(struct platform_device *pdev)/* AST2400 doesn't have working HW checksum generation */ if (np && (of_device_is_compatible (np,"aspeed,ast2400-mac" ))) netdev->hw_features &= ~NETIF_F_HW_CSUM ; + +/* AST2600 tx checksum with NCSI is broken */ +if (priv->use_ncsi &&of_device_is_compatible (np,"aspeed,ast2600-mac" )) + netdev->hw_features &= ~NETIF_F_HW_CSUM ; +if (np &&of_get_property (np,"no-hw-checksum" ,NULL )) netdev->hw_features &= ~(NETIF_F_HW_CSUM |NETIF_F_RXCSUM ); netdev->features |= netdev->hw_features;
drivers/net/ipa/ipa_endpoint.c +3 -1
@@ -610,12 +610,14 @@ static void ipa_endpoint_init_aggr(struct ipa_endpoint *endpoint)if (endpoint->data->aggregation) {if (!endpoint->toward_ipa) { +u32 buffer_size;u32 limit; val |=u32_encode_bits (IPA_ENABLE_AGGR ,AGGR_EN_FMASK ); val |=u32_encode_bits (IPA_GENERIC ,AGGR_TYPE_FMASK ); - limit =ipa_aggr_size_kb (IPA_RX_BUFFER_SIZE ); + buffer_size =IPA_RX_BUFFER_SIZE -NET_SKB_PAD ; + limit =ipa_aggr_size_kb (buffer_size); val |=u32_encode_bits (limit,AGGR_BYTE_LIMIT_FMASK ); limit =IPA_AGGR_TIME_LIMIT_DEFAULT ;
drivers/nfc/pn533/pn533.c +3 -2
@@ -2844,13 +2844,14 @@ void pn53x_common_clean(struct pn533 *priv) {struct pn533_cmd *cmd, *n; +/* delete the timer before cleanup the worker */ +del_timer_sync (&priv->listen_timer); +flush_delayed_work (&priv->poll_work);destroy_workqueue (priv->wq);skb_queue_purge (&priv->resp_q); -del_timer (&priv->listen_timer); -list_for_each_entry_safe (cmd, n, &priv->cmd_queue, queue) {list_del (&cmd->queue);kfree (cmd);
drivers/pinctrl/sunxi/pinctrl-suniv-f1c100s.c +1 -1
@@ -204,7 +204,7 @@ static const struct sunxi_desc_pin suniv_f1c100s_pins[] = { SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "lcd"), /* D20 */ - SUNXI_FUNCTION(0x3, "lvds1"), /* RX */ + SUNXI_FUNCTION(0x3, "uart2"), /* RX */ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15), SUNXI_FUNCTION(0x0, "gpio_in"),
fs/exfat/balloc.c +6 -2
@@ -148,7 +148,9 @@ int exfat_set_bitmap(struct inode *inode, unsigned int clu)struct super_block *sb = inode->i_sb;struct exfat_sb_info *sbi =EXFAT_SB (sb); -WARN_ON (clu <EXFAT_FIRST_CLUSTER ); +if (!is_valid_cluster (sbi, clu)) +return -EINVAL ; + ent_idx =CLUSTER_TO_BITMAP_ENT (clu); i =BITMAP_OFFSET_SECTOR_INDEX (sb, ent_idx); b =BITMAP_OFFSET_BIT_IN_SECTOR (sb, ent_idx);
@@ -166,7 +168,9 @@ void exfat_clear_bitmap(struct inode *inode, unsigned int clu)struct exfat_sb_info *sbi =EXFAT_SB (sb);struct exfat_mount_options *opts = &sbi->options; -WARN_ON (clu <EXFAT_FIRST_CLUSTER ); +if (!is_valid_cluster (sbi, clu)) +return ; + ent_idx =CLUSTER_TO_BITMAP_ENT (clu); i =BITMAP_OFFSET_SECTOR_INDEX (sb, ent_idx); b =BITMAP_OFFSET_BIT_IN_SECTOR (sb, ent_idx);
fs/exfat/exfat_fs.h +8 -0
@@ -380,6 +380,14 @@ static inline int exfat_sector_to_cluster(struct exfat_sb_info *sbi,EXFAT_RESERVED_CLUSTERS ; } +static inline bool is_valid_cluster (struct exfat_sb_info *sbi, +unsigned int clus) +{ +if (clus <EXFAT_FIRST_CLUSTER || sbi->num_clusters <= clus) +return false; +return true; +} +/* super.c */ int exfat_set_volume_dirty (struct super_block *sb);int exfat_clear_volume_dirty (struct super_block *sb);
fs/exfat/fatent.c +0 -8
@@ -81,14 +81,6 @@ int exfat_ent_set(struct super_block *sb, unsigned int loc,return 0 ; } -static inline bool is_valid_cluster (struct exfat_sb_info *sbi, -unsigned int clus) -{ -if (clus <EXFAT_FIRST_CLUSTER || sbi->num_clusters <= clus) -return false; -return true; -} -int exfat_ent_get (struct super_block *sb,unsigned int loc,unsigned int *content) {
fs/io_uring.c +6 -41
89 lines not on this page · raw message
fs/nfs/internal.h +1 -0
@@ -832,6 +832,7 @@ static inline bool nfs_error_is_fatal_on_server(int err)case 0 :case -ERESTARTSYS :case -EINTR : +case -ENOMEM :return false; }return nfs_error_is_fatal (err);
fs/nfsd/nfs4state.c +4 -8
@@ -7122,16 +7122,12 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,if (sop->so_is_open_owner || !same_owner_str (sop, owner))continue ; -/* see if there are still any locks associated with it */ - lo =lockowner (sop); -list_for_each_entry (stp, &sop->so_stateids, st_perstateowner) { -if (check_for_locks (stp->st_stid.sc_file, lo)) { - status = nfserr_locks_held; -spin_unlock (&clp->cl_lock); -return status; - } +if (atomic_read (&sop->so_count) !=1 ) { +spin_unlock (&clp->cl_lock); +return nfserr_locks_held; } + lo =lockowner (sop);nfs4_get_stateowner (sop);break ; }
fs/pipe.c +19 -14
@@ -652,7 +652,7 @@ pipe_poll(struct file *filp, poll_table *wait)unsigned int head, tail;/* Epoll has some historical nasty semantics, this enables them */ - pipe->poll_usage =1 ; +WRITE_ONCE (pipe->poll_usage, true);/* * Reading pipe state only -- no need for acquiring the semaphore.
@@ -1244,30 +1244,33 @@ unsigned int round_pipe_size(unsigned long size)/* * Resize the pipe ring to a number of slots. +* +* Note the pipe can be reduced in capacity, but only if the current +* occupancy doesn't exceed nr_slots; if it does, EBUSY will be +* returned instead. */ int pipe_resize_ring (struct pipe_inode_info *pipe,unsigned int nr_slots) {struct pipe_buffer *bufs;unsigned int head, tail, mask, n; -/* -* We can shrink the pipe, if arg is greater than the ring occupancy. -* Since we don't expect a lot of shrink+grow operations, just free and -* allocate again like we would do for growing. If the pipe currently -* contains more buffers than arg, then return busy. -*/ - mask = pipe->ring_size -1 ; - head = pipe->head; - tail = pipe->tail; - n =pipe_occupancy (pipe->head, pipe->tail); -if (nr_slots < n) -return -EBUSY ; - bufs =kcalloc (nr_slots,sizeof (*bufs),GFP_KERNEL_ACCOUNT | __GFP_NOWARN);if (unlikely (!bufs))return -ENOMEM ; +spin_lock_irq (&pipe->rd_wait.lock); + mask = pipe->ring_size -1 ; + head = pipe->head; + tail = pipe->tail; + + n =pipe_occupancy (head, tail); +if (nr_slots < n) { +spin_unlock_irq (&pipe->rd_wait.lock); +kfree (bufs); +return -EBUSY ; + } +/* * The pipe array wraps around, so just start the new one at zero * and adjust the indices.
@@ -1299,6 +1302,8 @@ int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) pipe->tail = tail; pipe->head = head; +spin_unlock_irq (&pipe->rd_wait.lock); +/* This might have made more room for writers */ wake_up_interruptible (&pipe->wr_wait);return 0 ;
fs/xfs/libxfs/xfs_bmap.c +5 -0
@@ -6229,6 +6229,11 @@ xfs_bmap_validate_extent(xfs_fsblock_t endfsb;bool isrt; +if (irec->br_startblock + irec->br_blockcount <= irec->br_startblock) +return __this_address; +if (irec->br_startoff + irec->br_blockcount <= irec->br_startoff) +return __this_address; + isrt =XFS_IS_REALTIME_INODE (ip); endfsb = irec->br_startblock + irec->br_blockcount -1 ;if (isrt && whichfork ==XFS_DATA_FORK ) {
fs/xfs/libxfs/xfs_dir2.h +0 -2
@@ -47,8 +47,6 @@ extern int xfs_dir_lookup(struct xfs_trans *tp, struct xfs_inode *dp,extern int xfs_dir_removename (struct xfs_trans *tp,struct xfs_inode *dp,struct xfs_name *name,xfs_ino_t ino,xfs_extlen_t tot); -extern bool xfs_dir2_sf_replace_needblock (struct xfs_inode *dp, -xfs_ino_t inum);extern int xfs_dir_replace (struct xfs_trans *tp,struct xfs_inode *dp,struct xfs_name *name,xfs_ino_t inum,xfs_extlen_t tot);
fs/xfs/libxfs/xfs_dir2_sf.c +1 -1
@@ -1018,7 +1018,7 @@ xfs_dir2_sf_removename(/* * Check whether the sf dir replace operation need more blocks. */ -bool +static bool xfs_dir2_sf_replace_needblock (struct xfs_inode *dp,xfs_ino_t inum)
fs/xfs/xfs_buf_item.c +18 -19
@@ -56,14 +56,12 @@ xfs_buf_log_format_size( }/* -* This returns the number of log iovecs needed to log the -* given buf log item. +* Return the number of log iovecs and space needed to log the given buf log +* item segment. * -* It calculates this as 1 iovec for the buf log format structure -* and 1 for each stretch of non-contiguous chunks to be logged. -* Contiguous chunks are logged in a single iovec. -* -* If the XFS_BLI_STALE flag has been set, then log nothing. +* It calculates this as 1 iovec for the buf log format structure and 1 for each +* stretch of non-contiguous chunks to be logged. Contiguous chunks are logged +* in a single iovec. */ STATIC void xfs_buf_item_size_segment(
@@ -119,11 +117,8 @@ xfs_buf_item_size_segment( }/* -* This returns the number of log iovecs needed to log the given buf log item. -* -* It calculates this as 1 iovec for the buf log format structure and 1 for each -* stretch of non-contiguous chunks to be logged. Contiguous chunks are logged -* in a single iovec. +* Return the number of log iovecs and space needed to log the given buf log +* item. * * Discontiguous buffers need a format structure per region that is being * logged. This makes the changes in the buffer appear to log recovery as though
@@ -133,7 +128,11 @@ xfs_buf_item_size_segment(* what ends up on disk. * * If the XFS_BLI_STALE flag has been set, then log nothing but the buf log -* format structures. +* format structures. If the item has previously been logged and has dirty +* regions, we do not relog them in stale buffers. This has the effect of +* reducing the size of the relogged item by the amount of dirty data tracked +* by the log item. This can result in the committing transaction reducing the +* amount of space being consumed by the CIL. */ STATIC void xfs_buf_item_size(
@@ -147,9 +146,9 @@ xfs_buf_item_size(ASSERT (atomic_read (&bip->bli_refcount) >0 );if (bip->bli_flags &XFS_BLI_STALE ) {/* -* The buffer is stale, so all we need to log -* is the buf log format structure with the -* cancel flag in it. +* The buffer is stale, so all we need to log is the buf log +* format structure with the cancel flag in it as we are never +* going to replay the changes tracked in the log item. */ trace_xfs_buf_item_size_stale (bip);ASSERT (bip->__bli_format.blf_flags &XFS_BLF_CANCEL );
@@ -164,9 +163,9 @@ xfs_buf_item_size(if (bip->bli_flags &XFS_BLI_ORDERED ) {/* -* The buffer has been logged just to order it. -* It is not being included in the transaction -* commit, so no vectors are used at all. +* The buffer has been logged just to order it. It is not being +* included in the transaction commit, so no vectors are used at +* all. */ trace_xfs_buf_item_size_ordered (bip); *nvecs =XFS_LOG_VEC_ORDERED ;
fs/xfs/xfs_inode.c +25 -17
60 lines not on this page · raw message
fs/xfs/xfs_inode_item.c +14 -0
@@ -28,6 +28,20 @@ static inline struct xfs_inode_log_item *INODE_ITEM(struct xfs_log_item *lip) return container_of(lip, struct xfs_inode_log_item, ili_item); } +/* +* The logged size of an inode fork is always the current size of the inode +* fork. This means that when an inode fork is relogged, the size of the logged +* region is determined by the current state, not the combination of the +* previously logged state + the current state. This is different relogging +* behaviour to most other log items which will retain the size of the +* previously logged changes when smaller regions are relogged. +* +* Hence operations that remove data from the inode fork (e.g. shortform +* dir/attr remove, extent form extent removal, etc), the size of the relogged +* inode gets -smaller- rather than stays the same size as the previously logged +* size and this can result in the committing transaction reducing the amount of +* space being consumed by the CIL. +*/ STATIC void xfs_inode_item_data_fork_size( struct xfs_inode_log_item *iip,
fs/xfs/xfs_iwalk.c +1 -1
@@ -363,7 +363,7 @@ xfs_iwalk_run_callbacks(/* Delete cursor but remember the last record we cached... */ xfs_iwalk_del_inobt (tp, curpp, agi_bpp,0 ); irec = &iwag->recs[iwag->nr_recs -1 ]; -ASSERT (next_agino == irec->ir_startino +XFS_INODES_PER_CHUNK ); +ASSERT (next_agino >= irec->ir_startino +XFS_INODES_PER_CHUNK ); error =xfs_iwalk_ag_recs (iwag);if (error)
fs/xfs/xfs_log_cil.c +17 -5
@@ -668,9 +668,14 @@ xlog_cil_push_work(ASSERT (push_seq <= ctx->sequence);/* -* Wake up any background push waiters now this context is being pushed. +* As we are about to switch to a new, empty CIL context, we no longer +* need to throttle tasks on CIL space overruns. Wake any waiters that +* the hard push throttle may have caught so they can start committing +* to the new context. The ctx->xc_push_lock provides the serialisation +* necessary for safely using the lockless waitqueue_active() check in +* this context. */ -if (ctx->space_used >=XLOG_CIL_BLOCKING_SPACE_LIMIT (log)) +if (waitqueue_active (&cil->xc_push_wait))wake_up_all (&cil->xc_push_wait);/*
@@ -907,7 +912,7 @@ xlog_cil_push_background(ASSERT (!list_empty (&cil->xc_cil));/* -* don't do a background push if we haven't used up all the +* Don't do a background push if we haven't used up all the * space available yet. */ if (cil->xc_ctx->space_used <XLOG_CIL_SPACE_LIMIT (log)) {
@@ -931,9 +936,16 @@ xlog_cil_push_background(/* * If we are well over the space limit, throttle the work that is being -* done until the push work on this context has begun. +* done until the push work on this context has begun. Enforce the hard +* throttle on all transaction commits once it has been activated, even +* if the committing transactions have resulted in the space usage +* dipping back down under the hard limit. +* +* The ctx->xc_push_lock provides the serialisation necessary for safely +* using the lockless waitqueue_active() check in this context. */ -if (cil->xc_ctx->space_used >=XLOG_CIL_BLOCKING_SPACE_LIMIT (log)) { +if (cil->xc_ctx->space_used >=XLOG_CIL_BLOCKING_SPACE_LIMIT (log) || +waitqueue_active (&cil->xc_push_wait)) {trace_xfs_log_cil_wait (log, cil->xc_ctx->ticket);ASSERT (cil->xc_ctx->space_used < log->l_logsize);xlog_wait (&cil->xc_push_wait, &cil->xc_push_lock);
fs/xfs/xfs_super.c +6 -4
@@ -199,10 +199,12 @@ xfs_fs_show_options(seq_printf (m,",swidth=%d" , (int )XFS_FSB_TO_BB (mp, mp->m_swidth)); -if (mp->m_qflags & (XFS_UQUOTA_ACCT |XFS_UQUOTA_ENFD )) -seq_puts (m,",usrquota" ); -else if (mp->m_qflags &XFS_UQUOTA_ACCT ) -seq_puts (m,",uqnoenforce" ); +if (mp->m_qflags &XFS_UQUOTA_ACCT ) { +if (mp->m_qflags &XFS_UQUOTA_ENFD ) +seq_puts (m,",usrquota" ); +else +seq_puts (m,",uqnoenforce" ); + }if (mp->m_qflags &XFS_PQUOTA_ACCT ) {if (mp->m_qflags &XFS_PQUOTA_ENFD )
include/crypto/drbg.h +7 -3
@@ -105,6 +105,12 @@ struct drbg_test_data {struct drbg_string *testentropy;/* TEST PARAMETER: test entropy */ }; +enum drbg_seed_state { +DRBG_SEED_STATE_UNSEEDED , +DRBG_SEED_STATE_PARTIAL ,/* Seeded with !rng_is_initialized() */ +DRBG_SEED_STATE_FULL , +}; +struct drbg_state {struct mutex drbg_mutex;/* lock around DRBG */ unsigned char *V;/* internal state 10.1.1.1 1a) */
@@ -127,16 +133,14 @@ struct drbg_state {struct crypto_wait ctr_wait;/* CTR mode async wait obj */ struct scatterlist sg_in, sg_out;/* CTR mode SGLs */ -bool seeded;/* DRBG fully seeded? */ +enum drbg_seed_state seeded;/* DRBG fully seeded? */ bool pr;/* Prediction resistance enabled? */ bool fips_primed;/* Continuous test primed? */ unsigned char *prev;/* FIPS 140-2 continuous test value */ -struct work_struct seed_work;/* asynchronous seeding support */ struct crypto_rng *jent;const struct drbg_state_ops *d_ops;const struct drbg_core *core;struct drbg_string test_data; -struct notifier_block random_ready; };static inline __u8 drbg_statelen (struct drbg_state *drbg)
include/linux/pipe_fs_i.h +1 -1
@@ -71,7 +71,7 @@ struct pipe_inode_info {unsigned int files;unsigned int r_counter;unsigned int w_counter; -unsigned int poll_usage; +bool poll_usage;struct page *tmp_page;struct fasync_struct *fasync_readers;struct fasync_struct *fasync_writers;
include/net/netfilter/nf_conntrack_core.h +6 -1
@@ -59,8 +59,13 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)int ret =NF_ACCEPT ;if (ct) { -if (!nf_ct_is_confirmed (ct)) +if (!nf_ct_is_confirmed (ct)) { ret =__nf_conntrack_confirm (skb); + +if (ret ==NF_ACCEPT ) + ct = (struct nf_conn *)skb_nfct (skb); + } +if (likely (ret ==NF_ACCEPT ))nf_ct_deliver_cached_events (ct); }
kernel/bpf/trampoline.c +12 -6
@@ -378,7 +378,7 @@ int bpf_trampoline_link_prog(struct bpf_prog *prog, struct bpf_trampoline *tr) {enum bpf_tramp_prog_type kind;int err =0 ; -int cnt; +int cnt =0 , i; kind =bpf_attach_type_to_tramp (prog);mutex_lock (&tr->mutex);
@@ -389,7 +389,10 @@ int bpf_trampoline_link_prog(struct bpf_prog *prog, struct bpf_trampoline *tr) err = -EBUSY ; goto out; } - cnt = tr->progs_cnt[BPF_TRAMP_FENTRY ] + tr->progs_cnt[BPF_TRAMP_FEXIT ]; + +for (i =0 ; i <BPF_TRAMP_MAX ; i++) + cnt += tr->progs_cnt[i]; +if (kind ==BPF_TRAMP_REPLACE ) {/* Cannot attach extension if fentry/fexit are in use. */ if (cnt) {
@@ -467,16 +470,19 @@ struct bpf_trampoline *bpf_trampoline_get(u64 key,void bpf_trampoline_put (struct bpf_trampoline *tr) { +int i; +if (!tr)return ;mutex_lock (&trampoline_mutex);if (!refcount_dec_and_test (&tr->refcnt)) goto out;WARN_ON_ONCE (mutex_is_locked (&tr->mutex)); -if (WARN_ON_ONCE (!hlist_empty (&tr->progs_hlist[BPF_TRAMP_FENTRY ]))) - goto out; -if (WARN_ON_ONCE (!hlist_empty (&tr->progs_hlist[BPF_TRAMP_FEXIT ]))) - goto out; + +for (i =0 ; i <BPF_TRAMP_MAX ; i++) +if (WARN_ON_ONCE (!hlist_empty (&tr->progs_hlist[i]))) + goto out; +/* This code will be executed even when the last bpf_tramp_image * is alive. All progs are detached from the trampoline and the * trampoline image is patched with jmp into epilogue to skip
lib/Kconfig +2 -0
@@ -101,6 +101,8 @@ config INDIRECT_PIO When in doubt, say N. +source "lib/crypto/Kconfig" + config CRC_CCITT tristate "CRC-CCITT functions" help
lib/assoc_array.c +8 -0
@@ -1462,6 +1462,7 @@ int assoc_array_gc(struct assoc_array *array,struct assoc_array_ptr *cursor, *ptr;struct assoc_array_ptr *new_root, *new_parent, **new_ptr_pp;unsigned long nr_leaves_on_tree; +bool retained;int keylen, slot, nr_free, next_slot, i;pr_devel ("-->%s()\n" , __func__);
@@ -1538,6 +1539,7 @@ int assoc_array_gc(struct assoc_array *array, goto descend; } +retry_compress:pr_devel ("-- compress node %p --\n" , new_n);/* Count up the number of empty slots in this node and work out the
@@ -1555,6 +1557,7 @@ int assoc_array_gc(struct assoc_array *array,pr_devel ("free=%d, leaves=%lu\n" , nr_free, new_n->nr_leaves_on_branch);/* See what we can fold in */ + retained = false; next_slot =0 ;for (slot =0 ; slot <ASSOC_ARRAY_FAN_OUT ; slot++) {struct assoc_array_shortcut *s;
@@ -1604,9 +1607,14 @@ int assoc_array_gc(struct assoc_array *array,pr_devel ("[%d] retain node %lu/%d [nx %d]\n" , slot, child->nr_leaves_on_branch, nr_free +1 , next_slot); + retained = true; } } +if (retained && new_n->nr_leaves_on_branch <=ASSOC_ARRAY_FAN_OUT ) { +pr_devel ("internal nodes remain despite enough space, retrying\n" ); + goto retry_compress; + }pr_devel ("after: %lu\n" , new_n->nr_leaves_on_branch); nr_leaves_on_tree = new_n->nr_leaves_on_branch;
lib/crypto/Kconfig +12 -5
@@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 +menu "Crypto library routines" + config CRYPTO_LIB_AES tristate
@@ -31,7 +33,7 @@ config CRYPTO_ARCH_HAVE_LIB_CHACHA config CRYPTO_LIB_CHACHA_GENERIC tristate - select CRYPTO_ALGAPI + select XOR_BLOCKS help This symbol can be depended upon by arch implementations of the ChaCha library interface that require the generic code as a
@@ -40,7 +42,8 @@ config CRYPTO_LIB_CHACHA_GENERIC of CRYPTO_LIB_CHACHA. config CRYPTO_LIB_CHACHA - tristate + tristate "ChaCha library interface" + depends on CRYPTO depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA select CRYPTO_LIB_CHACHA_GENERIC if CRYPTO_ARCH_HAVE_LIB_CHACHA=n help
@@ -65,7 +68,7 @@ config CRYPTO_LIB_CURVE25519_GENERIC of CRYPTO_LIB_CURVE25519. config CRYPTO_LIB_CURVE25519 - tristate + tristate "Curve25519 scalar multiplication library" depends on CRYPTO_ARCH_HAVE_LIB_CURVE25519 || !CRYPTO_ARCH_HAVE_LIB_CURVE25519 select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n help
@@ -100,7 +103,7 @@ config CRYPTO_LIB_POLY1305_GENERIC of CRYPTO_LIB_POLY1305. config CRYPTO_LIB_POLY1305 - tristate + tristate "Poly1305 library interface" depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305 select CRYPTO_LIB_POLY1305_GENERIC if CRYPTO_ARCH_HAVE_LIB_POLY1305=n help
@@ -109,11 +112,15 @@ config CRYPTO_LIB_POLY1305 is available and enabled. config CRYPTO_LIB_CHACHA20POLY1305 - tristate + tristate "ChaCha20-Poly1305 AEAD support (8-byte nonce library version)" depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305 + depends on CRYPTO select CRYPTO_LIB_CHACHA select CRYPTO_LIB_POLY1305 + select CRYPTO_ALGAPI config CRYPTO_LIB_SHA256 tristate + +endmenu
lib/percpu-refcount.c +1 -0
@@ -75,6 +75,7 @@ int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release, data =kzalloc (sizeof (*ref->data), gfp);if (!data) {free_percpu ((void __percpu *)ref->percpu_count_ptr); + ref->percpu_count_ptr =0 ;return -ENOMEM ; }
mm/zsmalloc.c +33 -4
@@ -1748,11 +1748,40 @@ static enum fullness_group putback_zspage(struct size_class *class,*/ static void lock_zspage (struct zspage *zspage) { -struct page *page =get_first_page (zspage); +struct page *curr_page, *page; -do { -lock_page (page); - }while ((page =get_next_page (page)) !=NULL ); +/* +* Pages we haven't locked yet can be migrated off the list while we're +* trying to lock them, so we need to be careful and only attempt to +* lock each page under migrate_read_lock(). Otherwise, the page we lock +* may no longer belong to the zspage. This means that we may wait for +* the wrong page to unlock, so we must take a reference to the page +* prior to waiting for it to unlock outside migrate_read_lock(). +*/ +while (1 ) { +migrate_read_lock (zspage); + page =get_first_page (zspage); +if (trylock_page (page)) +break ; +get_page (page); +migrate_read_unlock (zspage); +wait_on_page_locked (page); +put_page (page); + } + + curr_page = page; +while ((page =get_next_page (curr_page))) { +if (trylock_page (page)) { + curr_page = page; + }else { +get_page (page); +migrate_read_unlock (zspage); +wait_on_page_locked (page); +put_page (page); +migrate_read_lock (zspage); + } + } +migrate_read_unlock (zspage); }static int zs_init_fs_context (struct fs_context *fc)
net/core/filter.c +2 -2
@@ -1687,7 +1687,7 @@ BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset,if (unlikely (flags & ~(BPF_F_RECOMPUTE_CSUM |BPF_F_INVALIDATE_HASH )))return -EINVAL ; -if (unlikely (offset >0xffff )) +if (unlikely (offset >INT_MAX ))return -EFAULT ;if (unlikely (bpf_try_make_writable (skb, offset + len)))return -EFAULT ;
@@ -1722,7 +1722,7 @@ BPF_CALL_4(bpf_skb_load_bytes, const struct sk_buff *, skb, u32, offset, {void *ptr; -if (unlikely (offset >0xffff )) +if (unlikely (offset >INT_MAX )) goto err_clear; ptr =skb_header_pointer (skb, offset, len, to);
net/key/af_key.c +3 -3
@@ -2904,7 +2904,7 @@ static int count_ah_combs(const struct xfrm_tmpl *t)break ;if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg)) +if (aalg_tmpl_set (t, aalg) && aalg->available) sz +=sizeof (struct sadb_comb ); }return sz +sizeof (struct sadb_prop );
@@ -2922,7 +2922,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!ealg->pfkey_supported)continue ; -if (!(ealg_tmpl_set (t, ealg))) +if (!(ealg_tmpl_set (t, ealg) && ealg->available))continue ;for (k =1 ; ; k++) {
@@ -2933,7 +2933,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg)) +if (aalg_tmpl_set (t, aalg) && aalg->available) sz +=sizeof (struct sadb_comb ); } }
net/netfilter/nf_tables_api.c +23 -13
@@ -2679,27 +2679,31 @@ static struct nft_expr *nft_expr_init(const struct nft_ctx *ctx, err =nf_tables_expr_parse (ctx, nla, &info);if (err <0 ) - goto err1; + goto err_expr_parse; + + err = -EOPNOTSUPP ; +if (!(info.ops->type->flags &NFT_EXPR_STATEFUL )) + goto err_expr_stateful; err = -ENOMEM ; expr =kzalloc (info.ops->size,GFP_KERNEL );if (expr ==NULL ) - goto err2; + goto err_expr_stateful; err =nf_tables_newexpr (ctx, &info, expr);if (err <0 ) - goto err3; + goto err_expr_new;return expr; -err3: +err_expr_new:kfree (expr); -err2: +err_expr_stateful: owner = info.ops->type->owner;if (info.ops->type->release_ops) info.ops->type->release_ops (info.ops);module_put (owner); -err1: +err_expr_parse:return ERR_PTR (err); }
@@ -4047,6 +4051,9 @@ static int nft_set_desc_concat_parse(const struct nlattr *attr,u32 len;int err; +if (desc->field_count >=ARRAY_SIZE (desc->field_len)) +return -E2BIG ; + err =nla_parse_nested_deprecated (tb,NFTA_SET_FIELD_MAX , attr, nft_concat_policy,NULL );if (err <0 )
@@ -4056,9 +4063,8 @@ static int nft_set_desc_concat_parse(const struct nlattr *attr,return -EINVAL ; len =ntohl (nla_get_be32 (tb[NFTA_SET_FIELD_LEN ])); - -if (len *BITS_PER_BYTE /32 >NFT_REG32_COUNT ) -return -E2BIG ; +if (!len || len >U8_MAX ) +return -EINVAL ; desc->field_len[desc->field_count++] = len;
@@ -4069,7 +4075,8 @@ static int nft_set_desc_concat(struct nft_set_desc *desc, const struct nlattr *nla) {struct nlattr *attr; -int rem, err; +u32 num_regs =0 ; +int rem, err, i;nla_for_each_nested (attr, nla, rem) {if (nla_type (attr) !=NFTA_LIST_ELEM )
@@ -4080,6 +4087,12 @@ static int nft_set_desc_concat(struct nft_set_desc *desc,return err; } +for (i =0 ; i < desc->field_count; i++) + num_regs +=DIV_ROUND_UP (desc->field_len[i],sizeof (u32)); + +if (num_regs >NFT_REG32_COUNT ) +return -E2BIG ; +return 0 ; }
@@ -5055,9 +5068,6 @@ struct nft_expr *nft_set_elem_expr_alloc(const struct nft_ctx *ctx,return expr; err = -EOPNOTSUPP ; -if (!(expr->ops->type->flags &NFT_EXPR_STATEFUL )) - goto err_set_elem_expr; -if (expr->ops->type->flags &NFT_EXPR_GC ) {if (set->flags &NFT_SET_TIMEOUT ) goto err_set_elem_expr;
net/wireless/core.c +4 -4
@@ -5,7 +5,7 @@* Copyright 2006-2010 Johannes Berg <[email protected]> * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2015-2017 Intel Deutschland GmbH -* Copyright (C) 2018-2020 Intel Corporation +* Copyright (C) 2018-2021 Intel Corporation */ #define pr_fmt (fmt) KBUILD_MODNAME ": " fmt
@@ -918,9 +918,6 @@ int wiphy_register(struct wiphy *wiphy)return res; } -/* set up regulatory info */ -wiphy_regulatory_register (wiphy); -list_add_rcu (&rdev->list, &cfg80211_rdev_list); cfg80211_rdev_list_generation++;
@@ -931,6 +928,9 @@ int wiphy_register(struct wiphy *wiphy)cfg80211_debugfs_rdev_add (rdev);nl80211_notify_wiphy (rdev,NL80211_CMD_NEW_WIPHY ); +/* set up regulatory info */ +wiphy_regulatory_register (wiphy); +if (wiphy->regulatory_flags ®ULATORY_CUSTOM_REG ) {struct regulatory_request request;
net/wireless/reg.c +1 -0
@@ -4001,6 +4001,7 @@ void wiphy_regulatory_register(struct wiphy *wiphy)wiphy_update_regulatory (wiphy, lr->initiator);wiphy_all_share_dfs_chan_state (wiphy); +reg_process_self_managed_hints (); }void wiphy_regulatory_deregister (struct wiphy *wiphy)