Linux 5.4.107
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.4.107 kernel.
All users of the 5.4 kernel series must upgrade.
The updated 5.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.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
------------
Makefile | 2 arch/arm64/include/asm/kvm_hyp.h | 3 arch/arm64/kvm/hyp/debug-sr.c | 24 + arch/arm64/kvm/hyp/switch.c | 13 arch/x86/crypto/aesni-intel_asm.S | 137 ++++++---- arch/x86/crypto/aesni-intel_avx-x86_64.S | 20 - arch/x86/crypto/aesni-intel_glue.c | 54 +--- arch/x86/crypto/camellia_aesni_avx2_glue.c | 74 ++--- arch/x86/crypto/camellia_aesni_avx_glue.c | 72 ++--- arch/x86/crypto/camellia_glue.c | 45 +-- arch/x86/crypto/cast6_avx_glue.c | 68 ++--- arch/x86/crypto/glue_helper.c | 23 + arch/x86/crypto/serpent_avx2_glue.c | 65 ++-- arch/x86/crypto/serpent_avx_glue.c | 63 ++-- arch/x86/crypto/serpent_sse2_glue.c | 30 +- arch/x86/crypto/twofish_avx_glue.c | 75 ++--- arch/x86/crypto/twofish_glue_3way.c | 37 +- arch/x86/include/asm/crypto/camellia.h | 63 ++-- arch/x86/include/asm/crypto/glue_helper.h | 18 - arch/x86/include/asm/crypto/serpent-avx.h | 20 - arch/x86/include/asm/crypto/serpent-sse2.h | 28 -- arch/x86/include/asm/crypto/twofish.h | 19 - crypto/cast6_generic.c | 18 - crypto/serpent_generic.c | 6 drivers/gpu/drm/i915/gvt/display.c | 212 ++++++++++++++++ drivers/gpu/drm/i915/gvt/handlers.c | 40 ++- drivers/gpu/drm/i915/gvt/mmio.c | 5 drivers/gpu/drm/i915/gvt/vgpu.c | 5 drivers/net/dsa/b53/b53_common.c | 18 + drivers/net/dsa/b53/b53_regs.h | 1 drivers/net/dsa/bcm_sf2.c | 5 fs/btrfs/block-group.c | 48 ++- fs/btrfs/block-group.h | 3 fs/btrfs/relocation.c | 2 fs/btrfs/scrub.c | 21 + fs/fuse/fuse_i.h | 1 include/crypto/cast6.h | 4 include/crypto/serpent.h | 4 include/crypto/xts.h | 2 kernel/bpf/verifier.c | 33 +- net/dsa/tag_mtk.c | 19 - tools/testing/selftests/bpf/verifier/bounds_deduction.c | 27 +- tools/testing/selftests/bpf/verifier/unpriv.c | 15 + tools/testing/selftests/bpf/verifier/value_ptr_arith.c | 23 + 44 files changed, 919 insertions(+), 546 deletions(-)
Amir Goldstein (1):
fuse: fix live lock in fuse_iget()
Ard Biesheuvel (1):
crypto: x86/aes-ni-xts - use direct calls to and 4-way stride
Colin Xu (5):
drm/i915/gvt: Set SNOOP for PAT3 on BXT/APL to workaround GPU BB hang drm/i915/gvt: Fix mmio handler break on BXT/APL. drm/i915/gvt: Fix virtual display setup for BXT/APL drm/i915/gvt: Fix port number for BDW on EDID region setup drm/i915/gvt: Fix vfio_edid issue for BXT/APL
DENG Qingfang (1):
net: dsa: tag_mtk: fix 802.1ad VLAN egress
Florian Fainelli (1):
net: dsa: b53: Support setting learning on port
Greg Kroah-Hartman (1):
Linux 5.4.107
Kees Cook (1):
crypto: x86 - Regularize glue function prototypes
Piotr Krysiuk (5):
bpf: Prohibit alu ops for pointer types not defining ptr_limit
bpf: Fix off-by-one for area size in creating mask to left
bpf: Simplify alu_limit masking for pointer arithmetic
bpf: Add sanity check for upper ptr_limit
bpf, selftests: Fix up some test_verifier cases for unprivileged
Qu Wenruo (1):
btrfs: scrub: Don't check free space before marking a block group RO
Suzuki K Poulose (1):
KVM: arm64: nvhe: Save the SPE context early
Uros Bizjak (1):
crypto: aesni - Use TEST %reg,%reg instead of CMP $0,%reg
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 4 -SUBLEVEL = 106 +SUBLEVEL = 107 EXTRAVERSION = NAME = Kleptomaniac Octopus
arch/arm64/include/asm/kvm_hyp.h +3 -0
@@ -71,6 +71,9 @@ void __sysreg32_restore_state(struct kvm_vcpu *vcpu);void __debug_switch_to_guest (struct kvm_vcpu *vcpu);void __debug_switch_to_host (struct kvm_vcpu *vcpu); +void __debug_save_host_buffers_nvhe (struct kvm_vcpu *vcpu); +void __debug_restore_host_buffers_nvhe (struct kvm_vcpu *vcpu); +void __fpsimd_save_state (struct user_fpsimd_state *fp_regs);void __fpsimd_restore_state (struct user_fpsimd_state *fp_regs);
arch/arm64/kvm/hyp/debug-sr.c +15 -9
@@ -168,6 +168,21 @@ static void __hyp_text __debug_restore_state(struct kvm_vcpu *vcpu,write_sysreg (ctxt->sys_regs[MDCCINT_EL1 ], mdccint_el1); } +void __hyp_text __debug_save_host_buffers_nvhe(struct kvm_vcpu *vcpu) +{ +/* +* Non-VHE: Disable and flush SPE data generation +* VHE: The vcpu can run, but it can't hide. +*/ +__debug_save_spe_nvhe (&vcpu->arch.host_debug_state.pmscr_el1); + +} + +void __hyp_text __debug_restore_host_buffers_nvhe(struct kvm_vcpu *vcpu) +{ +__debug_restore_spe_nvhe (vcpu->arch.host_debug_state.pmscr_el1); +} + void __hyp_text __debug_switch_to_guest(struct kvm_vcpu *vcpu) {struct kvm_cpu_context *host_ctxt;
@@ -175,13 +190,6 @@ void __hyp_text __debug_switch_to_guest(struct kvm_vcpu *vcpu)struct kvm_guest_debug_arch *host_dbg;struct kvm_guest_debug_arch *guest_dbg; -/* -* Non-VHE: Disable and flush SPE data generation -* VHE: The vcpu can run, but it can't hide. -*/ -if (!has_vhe ()) -__debug_save_spe_nvhe (&vcpu->arch.host_debug_state.pmscr_el1); -if (!(vcpu->arch.flags &KVM_ARM64_DEBUG_DIRTY ))return ;
@@ -201,8 +209,6 @@ void __hyp_text __debug_switch_to_host(struct kvm_vcpu *vcpu)struct kvm_guest_debug_arch *host_dbg;struct kvm_guest_debug_arch *guest_dbg; -if (!has_vhe ()) -__debug_restore_spe_nvhe (vcpu->arch.host_debug_state.pmscr_el1);if (!(vcpu->arch.flags &KVM_ARM64_DEBUG_DIRTY ))return ;
arch/arm64/kvm/hyp/switch.c +12 -1
@@ -682,6 +682,15 @@ int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu)__sysreg_save_state_nvhe (host_ctxt); +/* +* We must flush and disable the SPE buffer for nVHE, as +* the translation regime(EL1&0) is going to be loaded with +* that of the guest. And we must do this before we change the +* translation regime to EL2 (via MDCR_EL2_EPB == 0) and +* before we load guest Stage1. +*/ +__debug_save_host_buffers_nvhe (vcpu); +__activate_vm (kern_hyp_va (vcpu->kvm));__activate_traps (vcpu);
@@ -720,11 +729,13 @@ int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu)if (vcpu->arch.flags &KVM_ARM64_FP_ENABLED )__fpsimd_save_fpexc32 (vcpu); +__debug_switch_to_host (vcpu); +/* * This must come after restoring the host sysregs, since a non-VHE * system may enable SPE here and make use of the TTBRs. */ -__debug_switch_to_host (vcpu); +__debug_restore_host_buffers_nvhe (vcpu);if (pmu_switch_needed)__pmu_switch_to_host (host_ctxt);
arch/x86/crypto/aesni-intel_asm.S +81 -56
254 lines not on this page · raw message
arch/x86/crypto/aesni-intel_avx-x86_64.S +10 -10
@@ -370,7 +370,7 @@ _initial_num_blocks_is_0\@: _initial_blocks_encrypted\@: - cmp $0, %r13 + test %r13, %r13 je _zero_cipher_left\@ sub $128, %r13
@@ -529,7 +529,7 @@ _multiple_of_16_bytes\@: vmovdqu HashKey(arg2), %xmm13 mov PBlockLen(arg2), %r12 - cmp $0, %r12 + test %r12, %r12 je _partial_done\@ #GHASH computation for the last <16 Byte block
@@ -574,7 +574,7 @@ _T_8\@: add $8, %r10 sub $8, %r11 vpsrldq $8, %xmm9, %xmm9 - cmp $0, %r11 + test %r11, %r11 je _return_T_done\@ _T_4\@: vmovd %xmm9, %eax
@@ -582,7 +582,7 @@ _T_4\@: add $4, %r10 sub $4, %r11 vpsrldq $4, %xmm9, %xmm9 - cmp $0, %r11 + test %r11, %r11 je _return_T_done\@ _T_123\@: vmovd %xmm9, %eax
@@ -626,7 +626,7 @@ _get_AAD_blocks\@: cmp $16, %r11 jge _get_AAD_blocks\@ vmovdqu \T8, \T7 - cmp $0, %r11 + test %r11, %r11 je _get_AAD_done\@ vpxor \T7, \T7, \T7
@@ -645,7 +645,7 @@ _get_AAD_rest8\@: vpxor \T1, \T7, \T7 jmp _get_AAD_rest8\@ _get_AAD_rest4\@: - cmp $0, %r11 + test %r11, %r11 jle _get_AAD_rest0\@ mov (%r10), %eax movq %rax, \T1
@@ -750,7 +750,7 @@ _done_read_partial_block_\@: .macro PARTIAL_BLOCK GHASH_MUL CYPH_PLAIN_OUT PLAIN_CYPH_IN PLAIN_CYPH_LEN DATA_OFFSET \ AAD_HASH ENC_DEC mov PBlockLen(arg2), %r13 - cmp $0, %r13 + test %r13, %r13 je _partial_block_done_\@ # Leave Macro if no partial blocks # Read in input data without over reading cmp $16, \PLAIN_CYPH_LEN
@@ -802,7 +802,7 @@ _no_extra_mask_1_\@: vpshufb %xmm2, %xmm3, %xmm3 vpxor %xmm3, \AAD_HASH, \AAD_HASH - cmp $0, %r10 + test %r10, %r10 jl _partial_incomplete_1_\@ # GHASH computation for the last <16 Byte block
@@ -837,7 +837,7 @@ _no_extra_mask_2_\@: vpshufb %xmm2, %xmm9, %xmm9 vpxor %xmm9, \AAD_HASH, \AAD_HASH - cmp $0, %r10 + test %r10, %r10 jl _partial_incomplete_2_\@ # GHASH computation for the last <16 Byte block
@@ -857,7 +857,7 @@ _encode_done_\@: vpshufb %xmm2, %xmm9, %xmm9 .endif # output encrypted Bytes - cmp $0, %r10 + test %r10, %r10 jl _partial_fill_\@ mov %r13, %r12 mov $16, %r13
arch/x86/crypto/aesni-intel_glue.c +24 -30
116 lines not on this page · raw message
arch/x86/crypto/camellia_aesni_avx2_glue.c +34 -40
168 lines not on this page · raw message
arch/x86/crypto/camellia_aesni_avx_glue.c +32 -40
169 lines not on this page · raw message
arch/x86/crypto/camellia_glue.c +24 -21
117 lines not on this page · raw message
arch/x86/crypto/cast6_avx_glue.c +31 -37
156 lines not on this page · raw message
arch/x86/crypto/glue_helper.c +14 -9
@@ -134,7 +134,8 @@ int glue_cbc_decrypt_req_128bit(const struct common_glue_ctx *gctx, src -= num_blocks -1 ; dst -= num_blocks -1 ; - gctx->funcs[i].fn_u.cbc (ctx, dst, src); + gctx->funcs[i].fn_u.cbc (ctx, (u8 *)dst, + (const u8 *)src); nbytes -= func_bytes;if (nbytes < bsize)
@@ -188,7 +189,9 @@ int glue_ctr_req_128bit(const struct common_glue_ctx *gctx,/* Process multi-block batch */ do { - gctx->funcs[i].fn_u.ctr(ctx, dst, src, &ctrblk); + gctx->funcs[i].fn_u.ctr(ctx, (u8 *)dst, + (const u8 *)src, + &ctrblk); src += num_blocks; dst += num_blocks; nbytes -= func_bytes;
@@ -210,7 +213,8 @@ int glue_ctr_req_128bit(const struct common_glue_ctx *gctx,be128_to_le128 (&ctrblk, (be128 *)walk.iv);memcpy (&tmp, walk.src.virt.addr, nbytes); - gctx->funcs[gctx->num_funcs -1 ].fn_u.ctr (ctx, &tmp, &tmp, + gctx->funcs[gctx->num_funcs -1 ].fn_u.ctr (ctx, (u8 *)&tmp, + (const u8 *)&tmp, &ctrblk);memcpy (walk.dst.virt.addr, &tmp, nbytes);le128_to_be128 ((be128 *)walk.iv, &ctrblk);
@@ -240,7 +244,8 @@ static unsigned int __glue_xts_req_128bit(const struct common_glue_ctx *gctx,if (nbytes >= func_bytes) { do { - gctx->funcs[i].fn_u.xts(ctx, dst, src, + gctx->funcs[i].fn_u.xts(ctx, (u8 *)dst, + (const u8 *)src, walk->iv); src += num_blocks;
@@ -354,8 +359,8 @@ int glue_xts_req_128bit(const struct common_glue_ctx *gctx, }EXPORT_SYMBOL_GPL (glue_xts_req_128bit); -void glue_xts_crypt_128bit_one (void *ctx,u128 *dst,const u128 *src,le128 *iv, -common_glue_func_t fn) +void glue_xts_crypt_128bit_one (const void *ctx,u8 *dst,const u8 *src, +le128 *iv,common_glue_func_t fn) {le128 ivblk = *iv;
@@ -363,13 +368,13 @@ void glue_xts_crypt_128bit_one(void *ctx, u128 *dst, const u128 *src, le128 *iv,gf128mul_x_ble (iv, &ivblk);/* CC <- T xor C */ -u128_xor (dst, src, (u128 *)&ivblk); +u128_xor ((u128 *)dst, (const u128 *)src, (u128 *)&ivblk);/* PP <- D(Key2,CC) */ -fn (ctx, (u8 *)dst, (u8 *)dst); +fn (ctx, dst, dst);/* P <- T xor PP */ -u128_xor (dst, dst, (u128 *)&ivblk); +u128_xor ((u128 *)dst, (u128 *)dst, (u128 *)&ivblk); }EXPORT_SYMBOL_GPL (glue_xts_crypt_128bit_one);
arch/x86/crypto/serpent_avx2_glue.c +31 -34
151 lines not on this page · raw message
arch/x86/crypto/serpent_avx_glue.c +31 -32
165 lines not on this page · raw message
arch/x86/crypto/serpent_sse2_glue.c +18 -12
@@ -31,9 +31,11 @@ static int serpent_setkey_skcipher(struct crypto_skcipher *tfm,return __serpent_setkey (crypto_skcipher_ctx (tfm), key, keylen); } -static void serpent_decrypt_cbc_xway (void *ctx,u128 *dst,const u128 *src) +static void serpent_decrypt_cbc_xway (const void *ctx,u8 *d,const u8 *s) {u128 ivs[SERPENT_PARALLEL_BLOCKS -1 ]; +u128 *dst = (u128 *)d; +const u128 *src = (const u128 *)s;unsigned int j;for (j =0 ; j <SERPENT_PARALLEL_BLOCKS -1 ; j++)
@@ -45,9 +47,11 @@ static void serpent_decrypt_cbc_xway(void *ctx, u128 *dst, const u128 *src)u128_xor (dst + (j +1 ), dst + (j +1 ), ivs + j); } -static void serpent_crypt_ctr (void *ctx,u128 *dst,const u128 *src,le128 *iv) +static void serpent_crypt_ctr (const void *ctx,u8 *d,const u8 *s,le128 *iv) {be128 ctrblk; +u128 *dst = (u128 *)d; +const u128 *src = (const u128 *)s;le128_to_be128 (&ctrblk, iv);le128_inc (iv);
@@ -56,10 +60,12 @@ static void serpent_crypt_ctr(void *ctx, u128 *dst, const u128 *src, le128 *iv)u128_xor (dst, src, (u128 *)&ctrblk); } -static void serpent_crypt_ctr_xway (void *ctx,u128 *dst,const u128 *src, +static void serpent_crypt_ctr_xway (const void *ctx,u8 *d,const u8 *s,le128 *iv) {be128 ctrblks[SERPENT_PARALLEL_BLOCKS ]; +u128 *dst = (u128 *)d; +const u128 *src = (const u128 *)s;unsigned int i;for (i =0 ; i <SERPENT_PARALLEL_BLOCKS ; i++) {
@@ -79,10 +85,10 @@ static const struct common_glue_ctx serpent_enc = { .funcs = { { .num_blocks = SERPENT_PARALLEL_BLOCKS, - .fn_u = { .ecb = GLUE_FUNC_CAST(serpent_enc_blk_xway) } + .fn_u = { .ecb = serpent_enc_blk_xway } }, { .num_blocks = 1, - .fn_u = { .ecb = GLUE_FUNC_CAST(__serpent_encrypt) } + .fn_u = { .ecb = __serpent_encrypt } } } };
@@ -92,10 +98,10 @@ static const struct common_glue_ctx serpent_ctr = { .funcs = { { .num_blocks = SERPENT_PARALLEL_BLOCKS, - .fn_u = { .ctr = GLUE_CTR_FUNC_CAST(serpent_crypt_ctr_xway) } + .fn_u = { .ctr = serpent_crypt_ctr_xway } }, { .num_blocks = 1, - .fn_u = { .ctr = GLUE_CTR_FUNC_CAST(serpent_crypt_ctr) } + .fn_u = { .ctr = serpent_crypt_ctr } } } };
@@ -105,10 +111,10 @@ static const struct common_glue_ctx serpent_dec = { .funcs = { { .num_blocks = SERPENT_PARALLEL_BLOCKS, - .fn_u = { .ecb = GLUE_FUNC_CAST(serpent_dec_blk_xway) } + .fn_u = { .ecb = serpent_dec_blk_xway } }, { .num_blocks = 1, - .fn_u = { .ecb = GLUE_FUNC_CAST(__serpent_decrypt) } + .fn_u = { .ecb = __serpent_decrypt } } } };
@@ -118,10 +124,10 @@ static const struct common_glue_ctx serpent_dec_cbc = { .funcs = { { .num_blocks = SERPENT_PARALLEL_BLOCKS, - .fn_u = { .cbc = GLUE_CBC_FUNC_CAST(serpent_decrypt_cbc_xway) } + .fn_u = { .cbc = serpent_decrypt_cbc_xway } }, { .num_blocks = 1, - .fn_u = { .cbc = GLUE_CBC_FUNC_CAST(__serpent_decrypt) } + .fn_u = { .cbc = __serpent_decrypt } } } };
@@ -137,7 +143,7 @@ static int ecb_decrypt(struct skcipher_request *req)static int cbc_encrypt (struct skcipher_request *req) { -return glue_cbc_encrypt_req_128bit (GLUE_FUNC_CAST (__serpent_encrypt), +return glue_cbc_encrypt_req_128bit (__serpent_encrypt, req); }
arch/x86/crypto/twofish_avx_glue.c +33 -42
171 lines not on this page · raw message
arch/x86/crypto/twofish_glue_3way.c +20 -17
@@ -25,21 +25,22 @@ static int twofish_setkey_skcipher(struct crypto_skcipher *tfm,return twofish_setkey (&tfm->base, key, keylen); } -static inline void twofish_enc_blk_3way (struct twofish_ctx *ctx,u8 *dst, -const u8 *src) +static inline void twofish_enc_blk_3way (const void *ctx,u8 *dst,const u8 *src) {__twofish_enc_blk_3way (ctx, dst, src, false); } -static inline void twofish_enc_blk_xor_3way (struct twofish_ctx *ctx,u8 *dst, +static inline void twofish_enc_blk_xor_3way (const void *ctx,u8 *dst,const u8 *src) {__twofish_enc_blk_3way (ctx, dst, src, true); } -void twofish_dec_blk_cbc_3way (void *ctx,u128 *dst,const u128 *src) +void twofish_dec_blk_cbc_3way (const void *ctx,u8 *d,const u8 *s) {u128 ivs[2 ]; +u128 *dst = (u128 *)d; +const u128 *src = (const u128 *)s; ivs[0 ] = src[0 ]; ivs[1 ] = src[1 ];
@@ -51,9 +52,11 @@ void twofish_dec_blk_cbc_3way(void *ctx, u128 *dst, const u128 *src) }EXPORT_SYMBOL_GPL (twofish_dec_blk_cbc_3way); -void twofish_enc_blk_ctr (void *ctx,u128 *dst,const u128 *src,le128 *iv) +void twofish_enc_blk_ctr (const void *ctx,u8 *d,const u8 *s,le128 *iv) {be128 ctrblk; +u128 *dst = (u128 *)d; +const u128 *src = (const u128 *)s;if (dst != src) *dst = *src;
@@ -66,10 +69,11 @@ void twofish_enc_blk_ctr(void *ctx, u128 *dst, const u128 *src, le128 *iv) }EXPORT_SYMBOL_GPL (twofish_enc_blk_ctr); -void twofish_enc_blk_ctr_3way (void *ctx,u128 *dst,const u128 *src, -le128 *iv) +void twofish_enc_blk_ctr_3way (const void *ctx,u8 *d,const u8 *s,le128 *iv) {be128 ctrblks[3 ]; +u128 *dst = (u128 *)d; +const u128 *src = (const u128 *)s;if (dst != src) { dst[0 ] = src[0 ];
@@ -94,10 +98,10 @@ static const struct common_glue_ctx twofish_enc = { .funcs = { { .num_blocks = 3, - .fn_u = { .ecb = GLUE_FUNC_CAST(twofish_enc_blk_3way) } + .fn_u = { .ecb = twofish_enc_blk_3way } }, { .num_blocks = 1, - .fn_u = { .ecb = GLUE_FUNC_CAST(twofish_enc_blk) } + .fn_u = { .ecb = twofish_enc_blk } } } };
@@ -107,10 +111,10 @@ static const struct common_glue_ctx twofish_ctr = { .funcs = { { .num_blocks = 3, - .fn_u = { .ecb = GLUE_FUNC_CAST(twofish_enc_blk_ctr_3way) } + .fn_u = { .ctr = twofish_enc_blk_ctr_3way } }, { .num_blocks = 1, - .fn_u = { .ecb = GLUE_FUNC_CAST(twofish_enc_blk_ctr) } + .fn_u = { .ctr = twofish_enc_blk_ctr } } } };
@@ -120,10 +124,10 @@ static const struct common_glue_ctx twofish_dec = { .funcs = { { .num_blocks = 3, - .fn_u = { .ecb = GLUE_FUNC_CAST(twofish_dec_blk_3way) } + .fn_u = { .ecb = twofish_dec_blk_3way } }, { .num_blocks = 1, - .fn_u = { .ecb = GLUE_FUNC_CAST(twofish_dec_blk) } + .fn_u = { .ecb = twofish_dec_blk } } } };
@@ -133,10 +137,10 @@ static const struct common_glue_ctx twofish_dec_cbc = { .funcs = { { .num_blocks = 3, - .fn_u = { .cbc = GLUE_CBC_FUNC_CAST(twofish_dec_blk_cbc_3way) } + .fn_u = { .cbc = twofish_dec_blk_cbc_3way } }, { .num_blocks = 1, - .fn_u = { .cbc = GLUE_CBC_FUNC_CAST(twofish_dec_blk) } + .fn_u = { .cbc = twofish_dec_blk } } } };
@@ -152,8 +156,7 @@ static int ecb_decrypt(struct skcipher_request *req)static int cbc_encrypt (struct skcipher_request *req) { -return glue_cbc_encrypt_req_128bit (GLUE_FUNC_CAST (twofish_enc_blk), - req); +return glue_cbc_encrypt_req_128bit (twofish_enc_blk, req); }static int cbc_decrypt (struct skcipher_request *req)
arch/x86/include/asm/crypto/camellia.h +29 -34
94 lines not on this page · raw message
arch/x86/include/asm/crypto/glue_helper.h +7 -11
@@ -11,18 +11,13 @@#include <asm/fpu/api.h> #include <crypto/b128ops.h> -typedef void (*common_glue_func_t )(void *ctx,u8 *dst,const u8 *src); -typedef void (*common_glue_cbc_func_t )(void *ctx,u128 *dst,const u128 *src); -typedef void (*common_glue_ctr_func_t )(void *ctx,u128 *dst,const u128 *src, +typedef void (*common_glue_func_t )(const void *ctx,u8 *dst,const u8 *src); +typedef void (*common_glue_cbc_func_t )(const void *ctx,u8 *dst,const u8 *src); +typedef void (*common_glue_ctr_func_t )(const void *ctx,u8 *dst,const u8 *src,le128 *iv); -typedef void (*common_glue_xts_func_t )(void *ctx,u128 *dst,const u128 *src, +typedef void (*common_glue_xts_func_t )(const void *ctx,u8 *dst,const u8 *src,le128 *iv); -#define GLUE_FUNC_CAST (fn) ((common_glue_func_t)(fn)) -#define GLUE_CBC_FUNC_CAST (fn) ((common_glue_cbc_func_t)(fn)) -#define GLUE_CTR_FUNC_CAST (fn) ((common_glue_ctr_func_t)(fn)) -#define GLUE_XTS_FUNC_CAST (fn) ((common_glue_xts_func_t)(fn)) -struct common_glue_func_entry {unsigned int num_blocks;/* number of blocks that @fn will process */ union {
@@ -116,7 +111,8 @@ extern int glue_xts_req_128bit(const struct common_glue_ctx *gctx, common_glue_func_t tweak_fn, void *tweak_ctx, void *crypt_ctx, bool decrypt); -extern void glue_xts_crypt_128bit_one (void *ctx,u128 *dst,const u128 *src, -le128 *iv,common_glue_func_t fn); +extern void glue_xts_crypt_128bit_one (const void *ctx,u8 *dst, +const u8 *src,le128 *iv, +common_glue_func_t fn);#endif /* _CRYPTO_GLUE_HELPER_H */
arch/x86/include/asm/crypto/serpent-avx.h +10 -10
@@ -15,26 +15,26 @@ struct serpent_xts_ctx {struct serpent_ctx crypt_ctx; }; -asmlinkage void serpent_ecb_enc_8way_avx(struct serpent_ctx *ctx, u8 *dst, +asmlinkage void serpent_ecb_enc_8way_avx(const void *ctx, u8 *dst,const u8 *src); -asmlinkage void serpent_ecb_dec_8way_avx(struct serpent_ctx *ctx, u8 *dst, +asmlinkage void serpent_ecb_dec_8way_avx(const void *ctx, u8 *dst,const u8 *src); -asmlinkage void serpent_cbc_dec_8way_avx(struct serpent_ctx *ctx, u8 *dst, +asmlinkage void serpent_cbc_dec_8way_avx(const void *ctx, u8 *dst,const u8 *src); -asmlinkage void serpent_ctr_8way_avx(struct serpent_ctx *ctx, u8 *dst, -const u8 *src,le128 *iv); +asmlinkage void serpent_ctr_8way_avx(const void *ctx, u8 *dst, const u8 *src, +le128 *iv); -asmlinkage void serpent_xts_enc_8way_avx(struct serpent_ctx *ctx, u8 *dst, +asmlinkage void serpent_xts_enc_8way_avx(const void *ctx, u8 *dst,const u8 *src,le128 *iv); -asmlinkage void serpent_xts_dec_8way_avx(struct serpent_ctx *ctx, u8 *dst, +asmlinkage void serpent_xts_dec_8way_avx(const void *ctx, u8 *dst,const u8 *src,le128 *iv); -extern void __serpent_crypt_ctr (void *ctx,u128 *dst,const u128 *src, +extern void __serpent_crypt_ctr (const void *ctx,u8 *dst,const u8 *src,le128 *iv); -extern void serpent_xts_enc (void *ctx,u128 *dst,const u128 *src,le128 *iv); -extern void serpent_xts_dec (void *ctx,u128 *dst,const u128 *src,le128 *iv); +extern void serpent_xts_enc (const void *ctx,u8 *dst,const u8 *src,le128 *iv); +extern void serpent_xts_dec (const void *ctx,u8 *dst,const u8 *src,le128 *iv);extern int xts_serpent_setkey (struct crypto_skcipher *tfm,const u8 *key,unsigned int keylen);
arch/x86/include/asm/crypto/serpent-sse2.h +12 -16
@@ -9,25 +9,23 @@#define SERPENT_PARALLEL_BLOCKS 4 -asmlinkage void __serpent_enc_blk_4way(struct serpent_ctx *ctx, u8 *dst, +asmlinkage void __serpent_enc_blk_4way(const struct serpent_ctx *ctx, u8 *dst,const u8 *src,bool xor); -asmlinkage void serpent_dec_blk_4way(struct serpent_ctx *ctx, u8 *dst, +asmlinkage void serpent_dec_blk_4way(const struct serpent_ctx *ctx, u8 *dst,const u8 *src); -static inline void serpent_enc_blk_xway (struct serpent_ctx *ctx,u8 *dst, -const u8 *src) +static inline void serpent_enc_blk_xway (const void *ctx,u8 *dst,const u8 *src) {__serpent_enc_blk_4way (ctx, dst, src, false); } -static inline void serpent_enc_blk_xway_xor (struct serpent_ctx *ctx,u8 *dst, -const u8 *src) +static inline void serpent_enc_blk_xway_xor (const struct serpent_ctx *ctx, +u8 *dst,const u8 *src) {__serpent_enc_blk_4way (ctx, dst, src, true); } -static inline void serpent_dec_blk_xway (struct serpent_ctx *ctx,u8 *dst, -const u8 *src) +static inline void serpent_dec_blk_xway (const void *ctx,u8 *dst,const u8 *src) {serpent_dec_blk_4way (ctx, dst, src); }
@@ -36,25 +34,23 @@ static inline void serpent_dec_blk_xway(struct serpent_ctx *ctx, u8 *dst,#define SERPENT_PARALLEL_BLOCKS 8 -asmlinkage void __serpent_enc_blk_8way(struct serpent_ctx *ctx, u8 *dst, +asmlinkage void __serpent_enc_blk_8way(const struct serpent_ctx *ctx, u8 *dst,const u8 *src,bool xor); -asmlinkage void serpent_dec_blk_8way(struct serpent_ctx *ctx, u8 *dst, +asmlinkage void serpent_dec_blk_8way(const struct serpent_ctx *ctx, u8 *dst,const u8 *src); -static inline void serpent_enc_blk_xway (struct serpent_ctx *ctx,u8 *dst, -const u8 *src) +static inline void serpent_enc_blk_xway (const void *ctx,u8 *dst,const u8 *src) {__serpent_enc_blk_8way (ctx, dst, src, false); } -static inline void serpent_enc_blk_xway_xor (struct serpent_ctx *ctx,u8 *dst, -const u8 *src) +static inline void serpent_enc_blk_xway_xor (const struct serpent_ctx *ctx, +u8 *dst,const u8 *src) {__serpent_enc_blk_8way (ctx, dst, src, true); } -static inline void serpent_dec_blk_xway (struct serpent_ctx *ctx,u8 *dst, -const u8 *src) +static inline void serpent_dec_blk_xway (const void *ctx,u8 *dst,const u8 *src) {serpent_dec_blk_8way (ctx, dst, src); }
arch/x86/include/asm/crypto/twofish.h +8 -11
@@ -7,22 +7,19 @@#include <crypto/b128ops.h> /* regular block cipher functions from twofish_x86_64 module */ -asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst, -const u8 *src); -asmlinkage void twofish_dec_blk(struct twofish_ctx *ctx, u8 *dst, -const u8 *src); +asmlinkage void twofish_enc_blk(const void *ctx, u8 *dst, const u8 *src); +asmlinkage void twofish_dec_blk(const void *ctx, u8 *dst, const u8 *src);/* 3-way parallel cipher functions */ -asmlinkage void __twofish_enc_blk_3way(struct twofish_ctx *ctx, u8 *dst, -const u8 *src,bool xor); -asmlinkage void twofish_dec_blk_3way(struct twofish_ctx *ctx, u8 *dst, -const u8 *src); +asmlinkage void __twofish_enc_blk_3way(const void *ctx, u8 *dst, const u8 *src, +bool xor); +asmlinkage void twofish_dec_blk_3way(const void *ctx, u8 *dst, const u8 *src);/* helpers from twofish_x86_64-3way module */ -extern void twofish_dec_blk_cbc_3way (void *ctx,u128 *dst,const u128 *src); -extern void twofish_enc_blk_ctr (void *ctx,u128 *dst,const u128 *src, +extern void twofish_dec_blk_cbc_3way (const void *ctx,u8 *dst,const u8 *src); +extern void twofish_enc_blk_ctr (const void *ctx,u8 *dst,const u8 *src,le128 *iv); -extern void twofish_enc_blk_ctr_3way (void *ctx,u128 *dst,const u128 *src, +extern void twofish_enc_blk_ctr_3way (const void *ctx,u8 *dst,const u8 *src,le128 *iv);#endif /* ASM_X86_TWOFISH_H */
crypto/cast6_generic.c +10 -8
@@ -154,7 +154,7 @@ int cast6_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)EXPORT_SYMBOL_GPL (cast6_setkey);/*forward quad round*/ -static inline void Q (u32 *block,u8 *Kr,u32 *Km) +static inline void Q (u32 *block,const u8 *Kr,const u32 *Km) {u32 I ; block[2 ] ^=F1 (block[3 ], Kr[0 ], Km[0 ]);
@@ -164,7 +164,7 @@ static inline void Q(u32 *block, u8 *Kr, u32 *Km) }/*reverse quad round*/ -static inline void QBAR (u32 *block,u8 *Kr,u32 *Km) +static inline void QBAR (u32 *block,const u8 *Kr,const u32 *Km) {u32 I ; block[3 ] ^=F1 (block[0 ], Kr[3 ], Km[3 ]);
@@ -173,13 +173,14 @@ static inline void QBAR(u32 *block, u8 *Kr, u32 *Km) block[2 ] ^=F1 (block[3 ], Kr[0 ], Km[0 ]); } -void __cast6_encrypt (struct cast6_ctx *c,u8 *outbuf,const u8 *inbuf) +void __cast6_encrypt (const void *ctx,u8 *outbuf,const u8 *inbuf) { +const struct cast6_ctx *c = ctx;const __be32 *src = (const __be32 *)inbuf;__be32 *dst = (__be32 *)outbuf;u32 block[4 ]; -u32 *Km; -u8 *Kr; +const u32 *Km; +const u8 *Kr; block[0 ] =be32_to_cpu (src[0 ]); block[1 ] =be32_to_cpu (src[1 ]);
@@ -211,13 +212,14 @@ static void cast6_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)__cast6_encrypt (crypto_tfm_ctx (tfm), outbuf, inbuf); } -void __cast6_decrypt (struct cast6_ctx *c,u8 *outbuf,const u8 *inbuf) +void __cast6_decrypt (const void *ctx,u8 *outbuf,const u8 *inbuf) { +const struct cast6_ctx *c = ctx;const __be32 *src = (const __be32 *)inbuf;__be32 *dst = (__be32 *)outbuf;u32 block[4 ]; -u32 *Km; -u8 *Kr; +const u32 *Km; +const u8 *Kr; block[0 ] =be32_to_cpu (src[0 ]); block[1 ] =be32_to_cpu (src[1 ]);
crypto/serpent_generic.c +4 -2
@@ -449,8 +449,9 @@ int serpent_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) }EXPORT_SYMBOL_GPL (serpent_setkey); -void __serpent_encrypt (struct serpent_ctx *ctx,u8 *dst,const u8 *src) +void __serpent_encrypt (const void *c,u8 *dst,const u8 *src) { +const struct serpent_ctx *ctx = c;const u32 *k = ctx->expkey;const __le32 *s = (const __le32 *)src;__le32 *d = (__le32 *)dst;
@@ -514,8 +515,9 @@ static void serpent_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)__serpent_encrypt (ctx, dst, src); } -void __serpent_decrypt (struct serpent_ctx *ctx,u8 *dst,const u8 *src) +void __serpent_decrypt (const void *c,u8 *dst,const u8 *src) { +const struct serpent_ctx *ctx = c;const u32 *k = ctx->expkey;const __le32 *s = (const __le32 *)src;__le32 *d = (__le32 *)dst;
drivers/gpu/drm/i915/gvt/display.c +212 -0
239 lines not on this page · raw message
drivers/gpu/drm/i915/gvt/handlers.c +38 -2
@@ -1632,6 +1632,34 @@ static int edp_psr_imr_iir_write(struct intel_vgpu *vgpu,return 0 ; } +/** +* FixMe: +* If guest fills non-priv batch buffer on ApolloLake/Broxton as Mesa i965 did: +* 717e7539124d (i965: Use a WC map and memcpy for the batch instead of pwrite.) +* Due to the missing flush of bb filled by VM vCPU, host GPU hangs on executing +* these MI_BATCH_BUFFER. +* Temporarily workaround this by setting SNOOP bit for PAT3 used by PPGTT +* PML4 PTE: PAT(0) PCD(1) PWT(1). +* The performance is still expected to be low, will need further improvement. +*/ +static int bxt_ppat_low_write (struct intel_vgpu *vgpu,unsigned int offset, +void *p_data,unsigned int bytes) +{ +u64 pat = +GEN8_PPAT (0 ,CHV_PPAT_SNOOP ) | +GEN8_PPAT (1 ,0 ) | +GEN8_PPAT (2 ,0 ) | +GEN8_PPAT (3 ,CHV_PPAT_SNOOP ) | +GEN8_PPAT (4 ,CHV_PPAT_SNOOP ) | +GEN8_PPAT (5 ,CHV_PPAT_SNOOP ) | +GEN8_PPAT (6 ,CHV_PPAT_SNOOP ) | +GEN8_PPAT (7 ,CHV_PPAT_SNOOP ); + +vgpu_vreg (vgpu, offset) =lower_32_bits (pat); + +return 0 ; +} +static int mmio_read_from_hw (struct intel_vgpu *vgpu,unsigned int offset,void *p_data,unsigned int bytes) {
@@ -2778,7 +2806,7 @@ static int init_broadwell_mmio_info(struct intel_gvt *gvt)MMIO_DH (GEN6_PCODE_MAILBOX ,D_BDW_PLUS ,NULL , mailbox_write); -MMIO_D (GEN8_PRIVATE_PAT_LO ,D_BDW_PLUS ); +MMIO_D (GEN8_PRIVATE_PAT_LO ,D_BDW_PLUS & ~D_BXT );MMIO_D (GEN8_PRIVATE_PAT_HI ,D_BDW_PLUS );MMIO_D (GAMTARBMODE ,D_BDW_PLUS );
@@ -3104,7 +3132,7 @@ static int init_skl_mmio_info(struct intel_gvt *gvt) NULL, NULL);MMIO_D (GAMT_CHKN_BIT_REG ,D_KBL |D_CFL ); -MMIO_D (GEN9_CTX_PREEMPT_REG ,D_SKL_PLUS ); +MMIO_D (GEN9_CTX_PREEMPT_REG ,D_SKL_PLUS & ~D_BXT );return 0 ; }
@@ -3278,9 +3306,17 @@ static int init_bxt_mmio_info(struct intel_gvt *gvt)MMIO_D (GEN8_PUSHBUS_SHIFT ,D_BXT );MMIO_D (GEN6_GFXPAUSE ,D_BXT );MMIO_DFH (GEN8_L3SQCREG1 ,D_BXT ,F_CMD_ACCESS ,NULL ,NULL ); +MMIO_DFH (GEN8_L3CNTLREG ,D_BXT ,F_CMD_ACCESS ,NULL ,NULL ); +MMIO_DFH (_MMIO (0x20D8 ),D_BXT ,F_CMD_ACCESS ,NULL ,NULL ); +MMIO_F (HSW_CS_GPR (0 ),0x40 ,F_CMD_ACCESS ,0 ,0 ,D_BXT ,NULL ,NULL ); +MMIO_F (_MMIO (0x12600 ),0x40 ,F_CMD_ACCESS ,0 ,0 ,D_BXT ,NULL ,NULL ); +MMIO_F (BCS_GPR (0 ),0x40 ,F_CMD_ACCESS ,0 ,0 ,D_BXT ,NULL ,NULL ); +MMIO_F (_MMIO (0x1a600 ),0x40 ,F_CMD_ACCESS ,0 ,0 ,D_BXT ,NULL ,NULL );MMIO_DFH (GEN9_CTX_PREEMPT_REG ,D_BXT ,F_CMD_ACCESS ,NULL ,NULL ); +MMIO_DH (GEN8_PRIVATE_PAT_LO ,D_BXT ,NULL , bxt_ppat_low_write); +return 0 ; }
drivers/gpu/drm/i915/gvt/mmio.c +5 -0
@@ -271,6 +271,11 @@ void intel_vgpu_reset_mmio(struct intel_vgpu *vgpu, bool dmlr)vgpu_vreg_t (vgpu,BXT_PHY_CTL (PORT_C )) |=BXT_PHY_CMNLANE_POWERDOWN_ACK |BXT_PHY_LANE_POWERDOWN_ACK ; +vgpu_vreg_t (vgpu,SKL_FUSE_STATUS ) |= +SKL_FUSE_DOWNLOAD_STATUS | +SKL_FUSE_PG_DIST_STATUS (SKL_PG0 ) | +SKL_FUSE_PG_DIST_STATUS (SKL_PG1 ) | +SKL_FUSE_PG_DIST_STATUS (SKL_PG2 ); } }else {#define GVT_GEN8_MMIO_RESET_OFFSET (0x44200)
drivers/gpu/drm/i915/gvt/vgpu.c +3 -2
@@ -432,8 +432,9 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt,if (ret) goto out_clean_sched_policy; -/*TODO: add more platforms support */ -if (IS_SKYLAKE (gvt->dev_priv) ||IS_KABYLAKE (gvt->dev_priv)) +if (IS_BROADWELL (gvt->dev_priv) ||IS_BROXTON (gvt->dev_priv)) + ret =intel_gvt_hypervisor_set_edid (vgpu,PORT_B ); +else ret =intel_gvt_hypervisor_set_edid (vgpu,PORT_D );if (ret) goto out_clean_sched_policy;
drivers/net/dsa/b53/b53_common.c +18 -0
@@ -514,6 +514,19 @@ void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port) }EXPORT_SYMBOL (b53_imp_vlan_setup); +static void b53_port_set_learning (struct b53_device *dev,int port, +bool learning) +{ +u16 reg; + +b53_read16 (dev,B53_CTRL_PAGE ,B53_DIS_LEARNING , ®); +if (learning) + reg &= ~BIT (port); +else + reg |=BIT (port); +b53_write16 (dev,B53_CTRL_PAGE ,B53_DIS_LEARNING , reg); +} +int b53_enable_port (struct dsa_switch *ds,int port,struct phy_device *phy) {struct b53_device *dev = ds->priv;
@@ -527,6 +540,7 @@ int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy) cpu_port = ds->ports[port].cpu_dp->index;b53_br_egress_floods (ds, port, true, true); +b53_port_set_learning (dev, port, false);if (dev->ops->irq_enable) ret = dev->ops->irq_enable (dev, port);
@@ -645,6 +659,7 @@ static void b53_enable_cpu_port(struct b53_device *dev, int port)b53_brcm_hdr_setup (dev->ds, port);b53_br_egress_floods (dev->ds, port, true, true); +b53_port_set_learning (dev, port, false); }static void b53_enable_mib (struct b53_device *dev)
@@ -1704,6 +1719,8 @@ int b53_br_join(struct dsa_switch *ds, int port, struct net_device *br)b53_write16 (dev,B53_PVLAN_PAGE ,B53_PVLAN_PORT_MASK (port), pvlan); dev->ports[port].vlan_ctl_mask = pvlan; +b53_port_set_learning (dev, port, true); +return 0 ; }EXPORT_SYMBOL (b53_br_join);
@@ -1751,6 +1768,7 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *br) vl->untag |=BIT (port) |BIT (cpu_port);b53_set_vlan_entry (dev, pvid, vl); } +b53_port_set_learning (dev, port, false); }EXPORT_SYMBOL (b53_br_leave);
drivers/net/dsa/b53/b53_regs.h +1 -0
@@ -115,6 +115,7 @@#define B53_UC_FLOOD_MASK 0x32#define B53_MC_FLOOD_MASK 0x34#define B53_IPMC_FLOOD_MASK 0x36 +#define B53_DIS_LEARNING 0x3c/* * Override Ports 0-7 State on devices with xMII interfaces (8 bit)
drivers/net/dsa/bcm_sf2.c +0 -5
@@ -172,11 +172,6 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port, reg &= ~P_TXQ_PSM_VDD (port);core_writel (priv, reg,CORE_MEM_PSM_VDD_CTRL ); -/* Enable learning */ - reg =core_readl (priv,CORE_DIS_LEARN ); - reg &= ~BIT (port); -core_writel (priv, reg,CORE_DIS_LEARN ); -/* Enable Broadcom tags for that port if requested */ if (priv->brcm_tag_mask &BIT (port))b53_brcm_hdr_setup (ds, port);
fs/btrfs/block-group.c +31 -17
70 lines not on this page · raw message
fs/btrfs/block-group.h +2 -1
@@ -205,7 +205,8 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info);int btrfs_make_block_group (struct btrfs_trans_handle *trans,u64 bytes_used,u64 type,u64 chunk_offset,u64 size);void btrfs_create_pending_block_groups (struct btrfs_trans_handle *trans); -int btrfs_inc_block_group_ro (struct btrfs_block_group_cache *cache); +int btrfs_inc_block_group_ro (struct btrfs_block_group_cache *cache, +bool do_chunk_alloc);void btrfs_dec_block_group_ro (struct btrfs_block_group_cache *cache);int btrfs_start_dirty_block_groups (struct btrfs_trans_handle *trans);int btrfs_write_dirty_block_groups (struct btrfs_trans_handle *trans);
fs/btrfs/relocation.c +1 -1
@@ -4428,7 +4428,7 @@ int btrfs_relocate_block_group(struct btrfs_fs_info *fs_info, u64 group_start) rc->extent_root = extent_root; rc->block_group = bg; - ret =btrfs_inc_block_group_ro (rc->block_group); + ret =btrfs_inc_block_group_ro (rc->block_group, true);if (ret) { err = ret; goto out;
fs/btrfs/scrub.c +20 -1
@@ -3560,7 +3560,26 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,* -> btrfs_scrub_pause() */ scrub_pause_on (fs_info); - ret =btrfs_inc_block_group_ro (cache); + +/* +* Don't do chunk preallocation for scrub. +* +* This is especially important for SYSTEM bgs, or we can hit +* -EFBIG from btrfs_finish_chunk_alloc() like: +* 1. The only SYSTEM bg is marked RO. +* Since SYSTEM bg is small, that's pretty common. +* 2. New SYSTEM bg will be allocated +* Due to regular version will allocate new chunk. +* 3. New SYSTEM bg is empty and will get cleaned up +* Before cleanup really happens, it's marked RO again. +* 4. Empty SYSTEM bg get scrubbed +* We go back to 2. +* +* This can easily boost the amount of SYSTEM chunks if cleaner +* thread can't be triggered fast enough, and use up all space +* of btrfs_super_block::sys_chunk_array +*/ + ret =btrfs_inc_block_group_ro (cache, false);if (!ret && sctx->is_dev_replace) {/* * If we are doing a device replace wait for any tasks
fs/fuse/fuse_i.h +1 -0
@@ -791,6 +791,7 @@ static inline u64 fuse_get_attr_version(struct fuse_conn *fc)static inline void fuse_make_bad (struct inode *inode) { +remove_inode_hash (inode);set_bit (FUSE_I_BAD , &get_fuse_inode (inode)->state); }
include/crypto/cast6.h +2 -2
@@ -19,7 +19,7 @@ int __cast6_setkey(struct cast6_ctx *ctx, const u8 *key, unsigned int keylen, u32 *flags);int cast6_setkey (struct crypto_tfm *tfm,const u8 *key,unsigned int keylen); -void __cast6_encrypt (struct cast6_ctx *ctx,u8 *dst,const u8 *src); -void __cast6_decrypt (struct cast6_ctx *ctx,u8 *dst,const u8 *src); +void __cast6_encrypt (const void *ctx,u8 *dst,const u8 *src); +void __cast6_decrypt (const void *ctx,u8 *dst,const u8 *src);#endif
include/crypto/serpent.h +2 -2
@@ -22,7 +22,7 @@ int __serpent_setkey(struct serpent_ctx *ctx, const u8 *key, unsigned int keylen);int serpent_setkey (struct crypto_tfm *tfm,const u8 *key,unsigned int keylen); -void __serpent_encrypt (struct serpent_ctx *ctx,u8 *dst,const u8 *src); -void __serpent_decrypt (struct serpent_ctx *ctx,u8 *dst,const u8 *src); +void __serpent_encrypt (const void *ctx,u8 *dst,const u8 *src); +void __serpent_decrypt (const void *ctx,u8 *dst,const u8 *src);#endif
include/crypto/xts.h +0 -2
@@ -8,8 +8,6 @@#define XTS_BLOCK_SIZE 16 -#define XTS_TWEAK_CAST (x) ((void (*)(void *, u8*, const u8*))(x)) -static inline int xts_check_key (struct crypto_tfm *tfm,const u8 *key,unsigned int keylen) {
kernel/bpf/verifier.c +21 -12
@@ -4268,10 +4268,14 @@ static int retrieve_ptr_limit(const struct bpf_reg_state *ptr_reg, {bool mask_to_left = (opcode ==BPF_ADD && off_is_neg) || (opcode ==BPF_SUB && !off_is_neg); -u32 off; +u32 off, max;switch (ptr_reg->type) {case PTR_TO_STACK : +/* Offset 0 is out-of-bounds, but acceptable start for the +* left direction, see BPF_REG_FP. +*/ + max =MAX_BPF_STACK + mask_to_left;/* Indirect variable offset stack access is prohibited in * unprivileged mode so it's not handled here. */
@@ -4279,16 +4283,17 @@ static int retrieve_ptr_limit(const struct bpf_reg_state *ptr_reg,if (mask_to_left) *ptr_limit =MAX_BPF_STACK + off;else - *ptr_limit = -off; -return 0 ; + *ptr_limit = -off -1 ; +return *ptr_limit >= max ? -ERANGE :0 ;case PTR_TO_MAP_VALUE : + max = ptr_reg->map_ptr->value_size;if (mask_to_left) { *ptr_limit = ptr_reg->umax_value + ptr_reg->off; }else { off = ptr_reg->smin_value + ptr_reg->off; - *ptr_limit = ptr_reg->map_ptr->value_size - off; + *ptr_limit = ptr_reg->map_ptr->value_size - off -1 ; } -return 0 ; +return *ptr_limit >= max ? -ERANGE :0 ;default :return -EINVAL ; }
@@ -4341,6 +4346,7 @@ static int sanitize_ptr_alu(struct bpf_verifier_env *env,u32 alu_state, alu_limit;struct bpf_reg_state tmp;bool ret; +int err;if (can_skip_alu_sanitation (env, insn))return 0 ;
@@ -4356,10 +4362,13 @@ static int sanitize_ptr_alu(struct bpf_verifier_env *env, alu_state |= ptr_is_dst_reg ?BPF_ALU_SANITIZE_SRC :BPF_ALU_SANITIZE_DST ; -if (retrieve_ptr_limit (ptr_reg, &alu_limit, opcode, off_is_neg)) -return 0 ; -if (update_alu_sanitation_state (aux, alu_state, alu_limit)) -return -EACCES ; + err =retrieve_ptr_limit (ptr_reg, &alu_limit, opcode, off_is_neg); +if (err <0 ) +return err; + + err =update_alu_sanitation_state (aux, alu_state, alu_limit); +if (err <0 ) +return err; do_sim:/* Simulate and find potential out-of-bounds access under * speculative execution from truncation as a result of
@@ -4467,7 +4476,7 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env,case BPF_ADD : ret =sanitize_ptr_alu (env, insn, ptr_reg, dst_reg, smin_val <0 );if (ret <0 ) { -verbose (env,"R%d tried to add from different maps or paths\n" , dst); +verbose (env,"R%d tried to add from different maps, paths, or prohibited types\n" , dst);return ret; }/* We can take a fixed offset as long as it doesn't overflow
@@ -4522,7 +4531,7 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env,case BPF_SUB : ret =sanitize_ptr_alu (env, insn, ptr_reg, dst_reg, smin_val <0 );if (ret <0 ) { -verbose (env,"R%d tried to sub from different maps or paths\n" , dst); +verbose (env,"R%d tried to sub from different maps, paths, or prohibited types\n" , dst);return ret; }if (dst_reg == off_reg) {
@@ -9077,7 +9086,7 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env) off_reg = issrc ? insn->src_reg : insn->dst_reg;if (isneg) *patch++ =BPF_ALU64_IMM (BPF_MUL , off_reg,-1 ); - *patch++ =BPF_MOV32_IMM (BPF_REG_AX , aux->alu_limit -1 ); + *patch++ =BPF_MOV32_IMM (BPF_REG_AX , aux->alu_limit); *patch++ =BPF_ALU64_REG (BPF_SUB ,BPF_REG_AX , off_reg); *patch++ =BPF_ALU64_REG (BPF_OR ,BPF_REG_AX , off_reg); *patch++ =BPF_ALU64_IMM (BPF_NEG ,BPF_REG_AX ,0 );
net/dsa/tag_mtk.c +13 -6
@@ -13,6 +13,7 @@#define MTK_HDR_LEN 4#define MTK_HDR_XMIT_UNTAGGED 0#define MTK_HDR_XMIT_TAGGED_TPID_8100 1 +#define MTK_HDR_XMIT_TAGGED_TPID_88A8 2#define MTK_HDR_RECV_SOURCE_PORT_MASK GENMASK(2, 0)#define MTK_HDR_XMIT_DP_BIT_MASK GENMASK(5, 0)#define MTK_HDR_XMIT_SA_DIS BIT(6)
@@ -21,8 +22,8 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb, struct net_device *dev) {struct dsa_port *dp =dsa_slave_to_port (dev); +u8 xmit_tpid;u8 *mtk_tag; -bool is_vlan_skb = true;unsigned char *dest =eth_hdr (skb)->h_dest;bool is_multicast_skb =is_multicast_ether_addr (dest) && !is_broadcast_ether_addr (dest);
@@ -33,13 +34,20 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,* the both special and VLAN tag at the same time and then look up VLAN * table with VID. */ -if (!skb_vlan_tagged (skb)) { +switch (skb->protocol) { +case htons (ETH_P_8021Q ): + xmit_tpid =MTK_HDR_XMIT_TAGGED_TPID_8100 ; +break ; +case htons (ETH_P_8021AD ): + xmit_tpid =MTK_HDR_XMIT_TAGGED_TPID_88A8 ; +break ; +default :if (skb_cow_head (skb,MTK_HDR_LEN ) <0 )return NULL ; + xmit_tpid =MTK_HDR_XMIT_UNTAGGED ;skb_push (skb,MTK_HDR_LEN );memmove (skb->data, skb->data +MTK_HDR_LEN ,2 *ETH_ALEN ); - is_vlan_skb = false; } mtk_tag = skb->data +2 *ETH_ALEN ;
@@ -47,8 +55,7 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,/* Mark tag attribute on special tag insertion to notify hardware * whether that's a combined special tag with 802.1Q header. */ - mtk_tag[0 ] = is_vlan_skb ?MTK_HDR_XMIT_TAGGED_TPID_8100 : -MTK_HDR_XMIT_UNTAGGED ; + mtk_tag[0 ] = xmit_tpid; mtk_tag[1 ] = (1 << dp->index) &MTK_HDR_XMIT_DP_BIT_MASK ;/* Disable SA learning for multicast frames */
@@ -56,7 +63,7 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb, mtk_tag[1 ] |=MTK_HDR_XMIT_SA_DIS ;/* Tag control information is kept for 802.1Q */ -if (!is_vlan_skb) { +if (xmit_tpid ==MTK_HDR_XMIT_UNTAGGED ) { mtk_tag[2 ] =0 ; mtk_tag[3 ] =0 ; }
tools/testing/selftests/bpf/verifier/bounds_deduction.c +19 -8
@@ -6,8 +6,9 @@BPF_ALU64_REG (BPF_SUB ,BPF_REG_0 ,BPF_REG_1 ), BPF_EXIT_INSN(), }, - .result =REJECT , + .errstr_unpriv ="R0 tried to sub from different maps, paths, or prohibited types" , .errstr = "R0 tried to subtract pointer from scalar", + .result = REJECT, }, { "check deducing bounds from const, 2",
@@ -20,6 +21,8 @@ BPF_ALU64_REG(BPF_SUB, BPF_REG_1, BPF_REG_0), BPF_EXIT_INSN(), }, + .errstr_unpriv = "R1 tried to sub from different maps, paths, or prohibited types", + .result_unpriv = REJECT, .result = ACCEPT, .retval = 1, },
@@ -31,8 +34,9 @@BPF_ALU64_REG (BPF_SUB ,BPF_REG_0 ,BPF_REG_1 ), BPF_EXIT_INSN(), }, - .result =REJECT , + .errstr_unpriv ="R0 tried to sub from different maps, paths, or prohibited types" , .errstr = "R0 tried to subtract pointer from scalar", + .result = REJECT, }, { "check deducing bounds from const, 4",
@@ -45,6 +49,8 @@BPF_ALU64_REG (BPF_SUB ,BPF_REG_1 ,BPF_REG_0 ), BPF_EXIT_INSN(), }, + .errstr_unpriv ="R1 tried to sub from different maps, paths, or prohibited types" , + .result_unpriv = REJECT, .result = ACCEPT, }, {
@@ -55,8 +61,9 @@BPF_ALU64_REG (BPF_SUB ,BPF_REG_0 ,BPF_REG_1 ), BPF_EXIT_INSN(), }, - .result =REJECT , + .errstr_unpriv ="R0 tried to sub from different maps, paths, or prohibited types" , .errstr = "R0 tried to subtract pointer from scalar", + .result = REJECT, }, { "check deducing bounds from const, 6",
@@ -67,8 +74,9 @@BPF_ALU64_REG (BPF_SUB ,BPF_REG_0 ,BPF_REG_1 ), BPF_EXIT_INSN(), }, - .result =REJECT , + .errstr_unpriv ="R0 tried to sub from different maps, paths, or prohibited types" , .errstr = "R0 tried to subtract pointer from scalar", + .result = REJECT, }, { "check deducing bounds from const, 7",
@@ -80,8 +88,9 @@ offsetof(struct __sk_buff, mark)), BPF_EXIT_INSN(), }, - .result = REJECT, + .errstr_unpriv = "R1 tried to sub from different maps, paths, or prohibited types", .errstr = "dereference of modified ctx ptr", + .result = REJECT, .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS, }, {
@@ -94,8 +103,9 @@ offsetof(struct __sk_buff, mark)), BPF_EXIT_INSN(), }, - .result = REJECT, + .errstr_unpriv = "R1 tried to add from different maps, paths, or prohibited types", .errstr = "dereference of modified ctx ptr", + .result = REJECT, .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS, }, {
@@ -106,8 +116,9 @@BPF_ALU64_REG (BPF_SUB ,BPF_REG_0 ,BPF_REG_1 ), BPF_EXIT_INSN(), }, - .result =REJECT , + .errstr_unpriv ="R0 tried to sub from different maps, paths, or prohibited types" , .errstr = "R0 tried to subtract pointer from scalar", + .result = REJECT, }, { "check deducing bounds from const, 10",
@@ -119,6 +130,6 @@ BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1), BPF_EXIT_INSN(), }, - .result = REJECT, .errstr = "math between ctx pointer and register with unbounded min value is not allowed", + .result = REJECT, },
tools/testing/selftests/bpf/verifier/unpriv.c +14 -1
@@ -495,7 +495,7 @@ .result = ACCEPT, }, { - "unpriv: adding of fp",
Lines of this file are not shown. View the raw message.
tools/testing/selftests/bpf/verifier/value_ptr_arith.c +22 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.