s390/bpf: fix lcgr instruction encoding
Subsystems (11)
Sasha Levin
maintainerPATCH 2/20 ARM: OMAP2+: Fix omap4 errata warning on other SoCs
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 45da5e09dd32fa98c32eaafe2513db6bd75e2f4f ]
We have errata i688 workaround produce warnings on SoCs other than omap4 and omap5:
omap4_sram_init:Unable to allocate sram needed to handle errata I688 omap4_sram_init:Unable to get sram pool needed to handle errata I688
This is happening because there is no ti,omap4-mpu node, or no SRAM to configure for the other SoCs, so let's remove the warning based on the SoC revision checks.
As nobody has complained it seems that the other SoC variants do not need this workaround.
--- arch/arm/mach-omap2/omap4-common.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-omap2/omap4-common.c +3 -0
@@ -131,6 +131,9 @@ static int __init omap4_sram_init(void)struct device_node *np;struct gen_pool *sram_pool; +if (!soc_is_omap44xx () && !soc_is_omap54xx ()) +return 0 ; + np =of_find_compatible_node (NULL ,NULL ,"ti,omap4-mpu" );if (!np) pr_warn("%s:Unable to allocate sram needed to handle errata I688\n",
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 3/20 s390/bpf: use 32-bit index for tail calls
In reply to Sasha LevinFrom: Ilya Leoshkevich <[email protected]>
[ Upstream commit 91b4db5313a2c793aabc2143efb8ed0cf0fdd097 ]
"p runtime/jit: pass > 32bit index to tail_call" fails when bpf_jit_enable=1, because the tail call is not executed.
This in turn is because the generated code assumes index is 64-bit, while it must be 32-bit, and as a result prog array bounds check fails, while it should pass. Even if bounds check would have passed, the code that follows uses 64-bit index to compute prog array offset.
Fix by using clrj instead of clgrj for comparing index with array size, and also by using llgfr for truncating index to 32 bits before using it to compute prog array offset.
--- arch/s390/net/bpf_jit_comp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/s390/net/bpf_jit_comp.c +6 -4
@@ -1067,8 +1067,8 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i/* llgf %w1,map.max_entries(%b2) */ EMIT6_DISP_LH (0xe3000000 ,0x0016 ,REG_W1 ,REG_0 ,BPF_REG_2 , offsetof(struct bpf_array, map.max_entries)); -/* clgrj %b3,%w1,0xa,label0: if %b3 >= %w1 goto out */ -EMIT6_PCREL_LABEL (0xec000000 ,0x0065 ,BPF_REG_3 , +/* clrj %b3,%w1,0xa,label0: if (u32)%b3 >= (u32)%w1 goto out */ +EMIT6_PCREL_LABEL (0xec000000 ,0x0077 ,BPF_REG_3 ,REG_W1 ,0 ,0xa );/*
@@ -1094,8 +1094,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i* goto out; */ -/* sllg %r1,%b3,3: %r1 = index * 8 */ -EMIT6_DISP_LH (0xeb000000 ,0x000d ,REG_1 ,BPF_REG_3 ,REG_0 ,3 ); +/* llgfr %r1,%b3: %r1 = (u32) index */ +EMIT4 (0xb9160000 ,REG_1 ,BPF_REG_3 ); +/* sllg %r1,%r1,3: %r1 *= 8 */ +EMIT6_DISP_LH (0xeb000000 ,0x000d ,REG_1 ,REG_1 ,REG_0 ,3 );/* lg %r1,prog(%b2,%r1) */ EMIT6_DISP_LH (0xe3000000 ,0x0004 ,REG_1 ,BPF_REG_2 ,REG_1 , offsetof(struct bpf_array , ptrs));
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 1/20 s390/bpf: fix lcgr instruction encoding
From: Ilya Leoshkevich <[email protected]>
[ Upstream commit bb2d267c448f4bc3a3389d97c56391cb779178ae ]
"masking, test in bounds 3" fails on s390, because BPF_ALU64_IMM(BPF_NEG, BPF_REG_2, 0) ignores the top 32 bits of BPF_REG_2. The reason is that JIT emits lcgfr instead of lcgr. The associated comment indicates that the code was intended to emit lcgr in the first place, it's just that the wrong opcode was used.
Fix by using the correct opcode.
--- arch/s390/net/bpf_jit_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/net/bpf_jit_comp.c +1 -1
@@ -886,7 +886,7 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int ibreak ;case BPF_ALU64 |BPF_NEG :/* dst = -dst */ /* lcgr %dst,%dst */ -EMIT4 (0xb9130000 , dst_reg, dst_reg); +EMIT4 (0xb9030000 , dst_reg, dst_reg);break ;/* * BPF_FROM_BE/LE
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 6/20 Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105
From: Christophe JAILLET <[email protected]>
[ Upstream commit cd9d4ff9b78fcd0fc4708900ba3e52e71e1a7690 ]
This should be IDT77105, not IDT77015.
--- drivers/atm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/atm/Kconfig +1 -1
@@ -199,7 +199,7 @@ config ATM_NICSTAR_USE_SUNI make the card work). config ATM_NICSTAR_USE_IDT77105 - bool "Use IDT77015 PHY driver (25Mbps)" + bool "Use IDT77105 PHY driver (25Mbps)" depends on ATM_NICSTAR help Support for the PHYsical layer chip in ForeRunner LE25 cards. In
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 7/20 ARM: 8874/1: mm: only adjust sections of valid mm structures
In reply to Sasha LevinFrom: Doug Berger <[email protected]>
[ Upstream commit c51bc12d06b3a5494fbfcbd788a8e307932a06e9 ]
A timing hazard exists when an early fork/exec thread begins exiting and sets its mm pointer to NULL while a separate core tries to update the section information.
This commit ensures that the mm pointer is not NULL before setting its section parameters. The arguments provided by commit 11ce4b33aedc ("ARM: 8672/1: mm: remove tasklist locking from update_sections_early()") are equally valid for not requiring grabbing the task_lock around this check.
--- arch/arm/mm/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mm/init.c +2 -1
@@ -691,7 +691,8 @@ static void update_sections_early(struct section_perm perms[], int n)if (t->flags &PF_KTHREAD )continue ;for_each_thread (t, s) -set_section_perms (perms, n, true, s->mm); +if (s->mm) +set_section_perms (perms, n, true, s->mm); }read_unlock (&tasklist_lock);set_section_perms (perms, n, true, current->active_mm);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 9/20 x86/apic: Fix arch_dynirq_lower_bound() bug for DT enabled machines
In reply to Sasha LevinFrom: Thomas Gleixner <[email protected]>
[ Upstream commit 3e5bedc2c258341702ddffbd7688c5e6eb01eafa ]
Rahul Tanwar reported the following bug on DT systems:
Quoted 11 lines
'
ioapic_dynirq_base' contains the virtual IRQ base number. Presently, it is updated to the end of hardware IRQ numbers but this is done only when IOAPIC configuration type isIOAPIC_DOMAIN_LEGACYorIOAPIC_DOMAIN_STRICT. There is a third typeIOAPIC_DOMAIN_DYNAMICwhich applies when IOAPIC configuration comes from devicetree.See
dtb_add_ioapic()inarch/x86/kernel/devicetree.cIn case of
IOAPIC_DOMAIN_DYNAMIC(DT/OF based system), 'ioapic_dynirq_base' remains to zero initialized value. This means that for OF based systems, virtual IRQ base will get set to zero.
Such systems will very likely not even boot.
For DT enabled machines ioapic_dynirq_base is irrelevant and not updated, so simply map the IRQ base 1:1 instead.
--- arch/x86/kernel/apic/io_apic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/x86/kernel/apic/io_apic.c +7 -1
@@ -2344,7 +2344,13 @@ unsigned int arch_dynirq_lower_bound(unsigned int from)* dmar_alloc_hwirq() may be called before setup_IO_APIC(), so use * gsi_top if ioapic_dynirq_base hasn't been initialized yet. */ -return ioapic_initialized ? ioapic_dynirq_base : gsi_top; +if (!ioapic_initialized) +return gsi_top; +/* +* For DT enabled machines ioapic_dynirq_base is irrelevant and not +* updated. So simply return @from if ioapic_dynirq_base == 0. +*/ +return ioapic_dynirq_base ? : from; }#ifdef CONFIG_X86_32
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 12/20 NFSv2: Fix write regression
In reply to Sasha LevinFrom: Trond Myklebust <[email protected]>
[ Upstream commit d33d4beb522987d1c305c12500796f9be3687dee ]
Ensure we update the write result count on success, since the RPC call itself does not do so.
--- fs/nfs/proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/nfs/proc.c +3 -1
@@ -610,8 +610,10 @@ static int nfs_proc_pgio_rpc_prepare(struct rpc_task *task,static int nfs_write_done (struct rpc_task *task,struct nfs_pgio_header *hdr) { -if (task->tk_status >=0 ) +if (task->tk_status >=0 ) { + hdr->res.count = hdr->args.count;nfs_writeback_update_inode (hdr); + }return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 13/20 cifs: set domainName when a domain-key is used in multiuser
In reply to Sasha LevinFrom: Ronnie Sahlberg <[email protected]>
[ Upstream commit f2aee329a68f5a907bcff11a109dfe17c0b41aeb ]
RHBZ: 1710429
When we use a domain-key to authenticate using multiuser we must also set the domainnmame for the new volume as it will be used and passed to the server in the NTLMSSP Domain-name.
--- fs/cifs/connect.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
fs/cifs/connect.c +22 -0
@@ -2466,6 +2466,7 @@ static int cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses) { int rc = 0; +int is_domain =0 ;const char *delim, *payload;char *desc;ssize_t len;
@@ -2513,6 +2514,7 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses) rc =PTR_ERR (key); goto out_err; } + is_domain =1 ; }down_read (&key->sem);
@@ -2570,6 +2572,26 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses) goto out_key_put; } +/* +* If we have a domain key then we must set the domainName in the +* for the request. +*/ +if (is_domain && ses->domainName) { + vol->domainname =kstrndup (ses->domainName, +strlen (ses->domainName), +GFP_KERNEL ); +if (!vol->domainname) { +cifs_dbg (FYI ,"Unable to allocate %zd bytes for " +"domain\n" , len); + rc = -ENOMEM ; +kfree (vol->username); + vol->username =NULL ; +kfree (vol->password); + vol->password =NULL ; + goto out_key_put; + } + } + out_key_put:up_read (&key->sem);key_put (key);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 14/20 cifs: Use kzfree() to zero out the password
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 478228e57f81f6cb60798d54fc02a74ea7dd267e ]
It's safer to zero out the password so that it can never be disclosed.
--- fs/cifs/connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/connect.c +1 -1
@@ -2586,7 +2586,7 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses) rc = -ENOMEM ;kfree (vol->username); vol->username =NULL ; -kfree (vol->password); +kzfree (vol->password); vol->password =NULL ; goto out_key_put; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 18/20 net: stmmac: dwmac-rk: Don't fail if phy regulator is absent
In reply to Sasha LevinFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit 3b25528e1e355c803e73aa326ce657b5606cda73 ]
The devicetree binding lists the phy phy as optional. As such, the driver should not bail out if it can't find a regulator. Instead it should just skip the remaining regulator related code and continue on normally.
Skip the remainder of phy_power_on() if a regulator supply isn't available. This also gets rid of the bogus return code.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +2 -4
@@ -429,10 +429,8 @@ static int phy_power_on(struct rk_priv_data *bsp_priv, bool enable)int ret;struct device *dev = &bsp_priv->pdev->dev; -if (!ldo) { -dev_err (dev,"no regulator found\n" ); -return -1 ; - } +if (!ldo) +return 0 ;if (enable) { ret =regulator_enable (ldo);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 19/20 tools/power turbostat: fix buffer overrun
In reply to Sasha LevinFrom: Naoya Horiguchi <[email protected]>
[ Upstream commit eeb71c950bc6eee460f2070643ce137e067b234c ]
turbostat could be terminated by general protection fault on some latest hardwares which (for example) support 9 levels of C-states and show 18 "tADDED" lines. That bloats the total output and finally causes buffer overrun. So let's extend the buffer to avoid this.
--- tools/power/x86/turbostat/turbostat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/x86/turbostat/turbostat.c +1 -1
@@ -3014,7 +3014,7 @@ int initialize_counters(int cpu_id)void allocate_output_buffer () { - output_buffer =calloc (1 , (1 + topo.num_cpus) *1024 ); + output_buffer =calloc (1 , (1 + topo.num_cpus) *2048 ); outp = output_buffer;if (outp ==NULL )err (-1 ,"calloc output buffer" );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 20/20 net: seeq: Fix the function used to release some memory in an error handling path
In reply to Sasha LevinFrom: Christophe JAILLET <[email protected]>
[ Upstream commit e1e54ec7fb55501c33b117c111cb0a045b8eded2 ]
In commit 99cd149efe82 ("sgiseeq: replace use of dma_cache_wback_inv"), a call to 'get_zeroed_page()' has been turned into a call to 'dma_alloc_coherent()'. Only the remove function has been updated to turn the corresponding 'free_page()' into 'dma_free_attrs()'.
The error hndling path of the probe function has not been updated.
Fix it now.
Rename the corresponding label to something more in line.
--- drivers/net/ethernet/seeq/sgiseeq.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/seeq/sgiseeq.c +4 -3
@@ -792,15 +792,16 @@ static int sgiseeq_probe(struct platform_device *pdev)printk (KERN_ERR "Sgiseeq: Cannot register net device, " "aborting.\n" ); err = -ENODEV ; - goto err_out_free_page; + goto err_out_free_attrs; }printk (KERN_INFO "%s: %s %pM\n" , dev->name, sgiseeqstr, dev->dev_addr);return 0 ; -err_out_free_page: -free_page ((unsigned long ) sp->srings); +err_out_free_attrs: +dma_free_attrs (&pdev->dev,sizeof (*sp->srings), sp->srings, + sp->srings_dma,DMA_ATTR_NON_CONSISTENT ); err_out_free_dev:free_netdev (dev);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 17/20 perf/x86/intel: Restrict period on Nehalem
In reply to Sasha LevinFrom: Josh Hunt <[email protected]>
[ Upstream commit 44d3bbb6f5e501b873218142fe08cdf62a4ac1f3 ]
We see our Nehalem machines reporting 'perfevents: irq loop stuck!' in some cases when using perf:
perfevents: irq loop stuck!
WARNING: CPU: 0 PID: 3485 at arch/x86/events/intel/core.c:2282 intel_pmu_handle_irq+0x37b/0x530 ... RIP: 0010:intel_pmu_handle_irq+0x37b/0x530 ... Call Trace: <NMI> ? perf_event_nmi_handler+0x2e/0x50 ? intel_pmu_save_and_restart+0x50/0x50 perf_event_nmi_handler+0x2e/0x50 nmi_handle+0x6e/0x120 default_do_nmi+0x3e/0x100 do_nmi+0x102/0x160 end_repeat_nmi+0x16/0x50 ... ? native_write_msr+0x6/0x20 ? native_write_msr+0x6/0x20 </NMI> intel_pmu_enable_event+0x1ce/0x1f0 x86_pmu_start+0x78/0xa0 x86_pmu_enable+0x252/0x310 __perf_event_task_sched_in+0x181/0x190 ? __switch_to_asm+0x41/0x70 ? __switch_to_asm+0x35/0x70 ? __switch_to_asm+0x41/0x70 ? __switch_to_asm+0x35/0x70 finish_task_switch+0x158/0x260 __schedule+0x2f6/0x840 ? hrtimer_start_range_ns+0x153/0x210 schedule+0x32/0x80 schedule_hrtimeout_range_clock+0x8a/0x100 ? hrtimer_init+0x120/0x120 ep_poll+0x2f7/0x3a0 ? wake_up_q+0x60/0x60 do_epoll_wait+0xa9/0xc0 __x64_sys_epoll_wait+0x1a/0x20 do_syscall_64+0x4e/0x110 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fdeb1e96c03
...
--- arch/x86/kernel/cpu/perf_event_intel.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/kernel/cpu/perf_event_intel.c +6 -0
@@ -2721,6 +2721,11 @@ static unsigned bdw_limit_period(struct perf_event *event, unsigned left)return left; } +static u64 nhm_limit_period (struct perf_event *event,u64 left) +{ +return max (left,32ULL ); +} +PMU_FORMAT_ATTR (event,"config:0-7" );PMU_FORMAT_ATTR (umask,"config:8-15" );PMU_FORMAT_ATTR (edge,"config:18" );
@@ -3326,6 +3331,7 @@ __init int intel_pmu_init(void) x86_pmu.pebs_constraints = intel_nehalem_pebs_event_constraints; x86_pmu.enable_all = intel_pmu_nhm_enable_all; x86_pmu.extra_regs = intel_nehalem_extra_regs; + x86_pmu.limit_period = nhm_limit_period; x86_pmu.cpu_events = nhm_events_attrs;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 11/20 NFSv2: Fix eof handling
In reply to Sasha LevinFrom: Trond Myklebust <[email protected]>
[ Upstream commit 71affe9be45a5c60b9772e1b2701710712637274 ]
If we received a reply from the server with a zero length read and no error, then that implies we are at eof.
--- fs/nfs/proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfs/proc.c +2 -1
@@ -588,7 +588,8 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr)/* Emulate the eof flag, which isn't normally needed in NFSv2 * as it is guaranteed to always return the file attributes */ -if (hdr->args.offset + hdr->res.count >= hdr->res.fattr->size) +if ((hdr->res.count ==0 && hdr->args.count >0 ) || + hdr->args.offset + hdr->res.count >= hdr->res.fattr->size) hdr->res.eof =1 ; }return 0 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 16/20 sky2: Disable MSI on yet another ASUS boards (P6Xxxx)
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit 189308d5823a089b56e2299cd96589507dac7319 ]
A similar workaround for the suspend/resume problem is needed for yet another ASUS machines, P6X models. Like the previous fix, the BIOS doesn't provide the standard DMI_SYS_* entry, so again DMI_BOARD_* entries are used instead.
--- drivers/net/ethernet/marvell/sky2.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/marvell/sky2.c +7 -0
@@ -4946,6 +4946,13 @@ static const struct dmi_system_id msi_blacklist[] = { DMI_MATCH(DMI_BOARD_NAME, "P6T"), }, }, + { + .ident = "ASUS P6X", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "P6X"), + }, + }, {} };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 15/20 x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence GCC9 build warning
In reply to Sasha LevinFrom: Linus Torvalds <[email protected]>
[ Upstream commit 42e0e95474fc6076b5cd68cab8fa0340a1797a72 ]
One of the very few warnings I have in the current build comes from arch/x86/boot/edd.c, where I get the following with a gcc9 build:
arch/x86/boot/edd.c: In function ‘query_edd’:
arch/x86/boot/edd.c:148:11: warning: taking address of packed member of ‘struct boot_params’ may result in an unaligned pointer value [-Waddress-of-packed-member]
148 | mbrptr = boot_params.edd_mbr_sig_buffer;
| ^~~~~~~~~~~This warning triggers because we throw away all the CFLAGS and then make a new set for REALMODE_CFLAGS, so the -Wno-address-of-packed-member we added in the following commit is not present:
6f303d60534c ("gcc-9: silence 'address-of-packed-member' warning")
The simplest solution for now is to adjust the warning for this version of CFLAGS as well, but it would definitely make sense to examine whether REALMODE_CFLAGS could be derived from CFLAGS, so that it picks up changes in the compiler flags environment automatically.
--- arch/x86/Makefile | 1 + 1 file changed, 1 insertion(+)
arch/x86/Makefile +1 -0
@@ -38,6 +38,7 @@ REALMODE_CFLAGS := $(M16_CFLAGS) -g -Os -D__KERNEL__ \ REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding) REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector) +REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -Wno-address-of-packed-member) REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4)) export REALMODE_CFLAGS
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/20 netfilter: nf_conntrack_ftp: Fix debug output
In reply to Sasha LevinFrom: Thomas Jarosch <[email protected]>
[ Upstream commit 3a069024d371125227de3ac8fa74223fcf473520 ]
The find_pattern() debug output was printing the 'skip' character. This can be a NULL-byte and messes up further pr_debug() output.
Output without the fix:
kernel: nf_conntrack_ftp: Pattern matches!
kernel: nf_conntrack_ftp: Skipped up to <7>nf_conntrack_ftp: find_pattern PORT': dlen = 8
kernel: nf_conntrack_ftp: find_pattern `EPRT': dlen = 8
Output with the fix:
kernel: nf_conntrack_ftp: Pattern matches!
kernel: nf_conntrack_ftp: Skipped up to 0x0 delimiter!
kernel: nf_conntrack_ftp: Match succeeded!
kernel: nf_conntrack_ftp: conntrack_ftp: match `172,17,0,100,200,207' (20 bytes at 4150681645)
kernel: nf_conntrack_ftp: find_pattern `PORT': dlen = 8
--- net/netfilter/nf_conntrack_ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conntrack_ftp.c +1 -1
@@ -334,7 +334,7 @@ static int find_pattern(const char *data, size_t dlen, i++; } -pr_debug ("Skipped up to `%c'!\n" , skip); +pr_debug ("Skipped up to 0x%hhx delimiter!\n" , skip); *numoff = i; *numlen =getnum (data + i, dlen - i, cmd, term, numoff);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 8/20 r8152: Set memory to all 0xFFs on failed reg reads
In reply to Sasha LevinFrom: Prashant Malani <[email protected]>
[ Upstream commit f53a7ad189594a112167efaf17ea8d0242b5ac00 ]
get_registers() blindly copies the memory written to by the usb_control_msg() call even if the underlying urb failed.
This could lead to junk register values being read by the driver, since some indirect callers of get_registers() ignore the return values. One example is:
ocp_read_dword() ignores the return value of generic_ocp_read(), which calls get_registers().
So, emulate PCI "Master Abort" behavior by setting the buffer to all 0xFFs when usb_control_msg() fails.
This patch is copied from the r8152 driver (v2.12.0) published by Realtek (www.realtek.com).
--- drivers/net/usb/r8152.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/usb/r8152.c +4 -1
@@ -671,8 +671,11 @@ int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) ret =usb_control_msg (tp->udev,usb_rcvctrlpipe (tp->udev,0 ),RTL8152_REQ_GET_REGS ,RTL8152_REQT_READ , value, index, tmp, size,500 ); +if (ret <0 ) +memset (data,0xff , size); +else +memcpy (data, tmp, size); -memcpy (data, tmp, size);kfree (tmp);return ret;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 5/20 NFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup
In reply to Sasha LevinFrom: Trond Myklebust <[email protected]>
[ Upstream commit 17d8c5d145000070c581f2a8aa01edc7998582ab ]
Initialise the result count to 0 rather than initialising it to the argument count. The reason is that we want to ensure we record the I/O stats correctly in the case where an error is returned (for instance in the layoutstats).
--- fs/nfs/pagelist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/pagelist.c +1 -1
@@ -593,7 +593,7 @@ static void nfs_pgio_rpcsetup(struct nfs_pgio_header *hdr, } hdr->res.fattr = &hdr->fattr; - hdr->res.count = count; + hdr->res.count =0 ; hdr->res.eof =0 ; hdr->res.verf = &hdr->verf;nfs_fattr_init (&hdr->fattr);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 4/20 NFSv4: Fix return values for nfs4_file_open()
In reply to Sasha LevinFrom: Trond Myklebust <[email protected]>
[ Upstream commit 90cf500e338ab3f3c0f126ba37e36fb6a9058441 ]
Currently, we are translating RPC level errors such as timeouts, as well as interrupts etc into EOPENSTALE, which forces a single replay of the open attempt. What we actually want to do is force the replay only in the cases where the returned error indicates that the file may have changed on the server.
So the fix is to spell out the exact set of errors where we want to return EOPENSTALE.
--- fs/nfs/nfs4file.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
fs/nfs/nfs4file.c +6 -6
@@ -73,13 +73,13 @@ nfs4_file_open(struct inode *inode, struct file *filp)if (IS_ERR (inode)) { err =PTR_ERR (inode);switch (err) { -case -EPERM : -case -EACCES : -case -EDQUOT : -case -ENOSPC : -case -EROFS : - goto out_put_ctx;default : + goto out_put_ctx; +case -ENOENT : +case -ESTALE : +case -EISDIR : +case -ENOTDIR : +case -ELOOP : goto out_drop; } }
Signature · 1 line
2.20.1