[PATCH AUTOSEL 5.3 70/71] sch_netem: fix a divide by zero in tabledist()

2019-10-01 Thread Sasha Levin
From: Eric Dumazet [ Upstream commit b41d936b5ecfdb3a4abc525ce6402a6c49cffddc ] syzbot managed to crash the kernel in tabledist() loading an empty distribution table. t = dist->table[rnd % dist->size]; Simply return an error when such load is attempted. Fixes: 1da177e4c3f4 ("Linux-2.6

[PATCH AUTOSEL 5.3 62/71] net: phy: micrel: add Asym Pause workaround for KSZ9021

2019-10-01 Thread Sasha Levin
From: Hans Andersson [ Upstream commit 407d8098cb1ab338199f4753162799a488d87d23 ] The Micrel KSZ9031 PHY may fail to establish a link when the Asymmetric Pause capability is set. This issue is described in a Silicon Errata (DS8691D or DS8692D), which advises to always disable the capabil

[PATCH AUTOSEL 5.3 58/71] i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630

2019-10-01 Thread Sasha Levin
From: Lee Jones [ Upstream commit 127068abe85bf3dee50df51cb039a5a987a4a666 ] We have a production-level laptop (Lenovo Yoga C630) which is exhibiting a rather horrific bug. When I2C HID devices are being scanned for at boot-time the QCom Geni based I2C (Serial Engine) attempts to use DMA. When

[PATCH AUTOSEL 5.3 69/71] usbnet: sanity checking of packet sizes and device mtu

2019-10-01 Thread Sasha Levin
From: Oliver Neukum [ Upstream commit 280ceaed79f18db930c0cc8bb21f6493490bf29c ] After a reset packet sizes and device mtu can change and need to be reevaluated to calculate queue sizes. Malicious devices can set this to zero and we divide by it. Introduce sanity checking. Reported-and-tested-b

[PATCH AUTOSEL 5.3 48/71] perf build: Add detection of java-11-openjdk-devel package

2019-10-01 Thread Sasha Levin
From: Thomas Richter [ Upstream commit 815c1560bf8fd522b8d93a1d727868b910c1cc24 ] With Java 11 there is no seperate JRE anymore. Details: https://coderanch.com/t/701603/java/JRE-JDK Therefore the detection of the JRE needs to be adapted. This change works for s390 and x86. I have not test

[PATCH AUTOSEL 5.3 68/71] drm/radeon: Bail earlier when radeon.cik_/si_support=0 is passed

2019-10-01 Thread Sasha Levin
From: Hans de Goede [ Upstream commit 9dbc88d013b79c62bd845cb9e7c0256e660967c5 ] Bail from the pci_driver probe function instead of from the drm_driver load function. This avoid /dev/dri/card0 temporarily getting registered and then unregistered again, sending unwanted add / remove udev events

[PATCH AUTOSEL 5.3 55/71] bpf: Fix bpf_event_output re-entry issue

2019-10-01 Thread Sasha Levin
From: Allan Zhang [ Upstream commit 768fb61fcc13b2acaca758275d54c09a65e2968b ] BPF_PROG_TYPE_SOCK_OPS program can reenter bpf_event_output because it can be called from atomic and non-atomic contexts since we don't have bpf_prog_active to prevent it happen. This patch enables 3 levels of nestin

[PATCH AUTOSEL 5.2 04/63] fs: nfs: Fix possible null-pointer dereferences in encode_attrs()

2019-10-01 Thread Sasha Levin
From: Jia-Ju Bai [ Upstream commit e2751463eaa6f9fec8fea80abbdc62dbc487b3c5 ] In encode_attrs(), there is an if statement on line 1145 to check whether label is NULL: if (label && (attrmask[2] & FATTR4_WORD2_SECURITY_LABEL)) When label is NULL, it is used on lines 1178-1181: *p++ = cpu_

[PATCH AUTOSEL 5.2 01/63] drivers: thermal: qcom: tsens: Fix memory leak from qfprom read

2019-10-01 Thread Sasha Levin
From: Srinivas Kandagatla [ Upstream commit 6b8249abb093551ef173d13a25ed0044d5dd33e0 ] memory returned as part of nvmem_read via qfprom_read should be freed by the consumer once done. Existing code is not doing it so fix it. Below memory leak detected by kmemleak [] kmemleak_alloc+0x50/0x84

[PATCH AUTOSEL 5.3 71/71] Btrfs: fix selftests failure due to uninitialized i_mode in test inodes

2019-10-01 Thread Sasha Levin
From: Filipe Manana [ Upstream commit 9f7fec0ba89108b9385f1b9fb167861224912a4a ] Some of the self tests create a test inode, setup some extents and then do calls to btrfs_get_extent() to test that the corresponding extent maps exist and are correct. However btrfs_get_extent(), since the 5.2 merg

[PATCH AUTOSEL 5.2 05/63] xprtrdma: Send Queue size grows after a reconnect

2019-10-01 Thread Sasha Levin
From: Chuck Lever [ Upstream commit 98ef77d1aaa7a2f4e1b2a721faa084222021fda7 ] Eli Dorfman reports that after a series of idle disconnects, an RPC/RDMA transport becomes unusable (rdma_create_qp returns -ENOMEM). Problem was tracked down to increasing Send Queue size after each reconnect. The r

[PATCH AUTOSEL 5.2 15/63] SUNRPC: RPC level errors should always set task->tk_rpc_status

2019-10-01 Thread Sasha Levin
From: Trond Myklebust [ Upstream commit 714fbc73888f59321854e7f6c2f224213923bcad ] Ensure that we set task->tk_rpc_status for all RPC level errors so that the caller can distinguish between those and server reply status errors. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Sign

[PATCH AUTOSEL 5.2 11/63] ceph: fix directories inode i_blkbits initialization

2019-10-01 Thread Sasha Levin
From: Luis Henriques [ Upstream commit 750670341a24cb714e624e0fd7da30900ad93752 ] When filling an inode with info from the MDS, i_blkbits is being initialized using fl_stripe_unit, which contains the stripe unit in bytes. Unfortunately, this doesn't make sense for directories as they have fl_st

[PATCH AUTOSEL 5.2 17/63] netfilter: nf_tables: allow lookups in dynamic sets

2019-10-01 Thread Sasha Levin
From: Florian Westphal [ Upstream commit acab713177377d9e0889c46bac7ff0cfb9a90c4d ] This un-breaks lookups in sets that have the 'dynamic' flag set. Given this active example configuration: table filter { set set1 { type ipv4_addr size 64 flags dynamic,timeout timeout 1m }

[PATCH AUTOSEL 5.2 19/63] drm/amdgpu: Check for valid number of registers to read

2019-10-01 Thread Sasha Levin
From: Trek [ Upstream commit 73d8e6c7b841d9bf298c8928f228fb433676635c ] Do not try to allocate any amount of memory requested by the user. Instead limit it to 128 registers. Actually the longest series of consecutive allowed registers are 48, mmGB_TILE_MODE0-31 and mmGB_MACROTILE_MODE0-15 (0x264

[PATCH AUTOSEL 5.2 25/63] usbnet: ignore endpoints with invalid wMaxPacketSize

2019-10-01 Thread Sasha Levin
From: Bjørn Mork [ Upstream commit 8d3d7c2029c1b360f1a6b0a2fca470b57eb575c0 ] Endpoints with zero wMaxPacketSize are not usable for transferring data. Ignore such endpoints when looking for valid in, out and status pipes, to make the drivers more robust against invalid and meaningless descriptor

[PATCH AUTOSEL 5.2 37/63] fuse: fix memleak in cuse_channel_open

2019-10-01 Thread Sasha Levin
From: zhengbin [ Upstream commit 9ad09b1976c562061636ff1e01bfc3a57aebe56b ] If cuse_send_init fails, need to fuse_conn_put cc->fc. cuse_channel_open->fuse_conn_init->refcount_set(&fc->count, 1) ->fuse_dev_alloc->fuse_conn_get ->fuse_dev_free->fuse_conn_put Fix

[PATCH AUTOSEL 5.2 28/63] x86/purgatory: Disable the stackleak GCC plugin for the purgatory

2019-10-01 Thread Sasha Levin
From: Arvind Sankar [ Upstream commit ca14c996afe7228ff9b480cf225211cc17212688 ] Since commit: b059f801a937 ("x86/purgatory: Use CFLAGS_REMOVE rather than reset KBUILD_CFLAGS") kexec breaks if GCC_PLUGIN_STACKLEAK=y is enabled, as the purgatory contains undefined references to stackleak_tra

[PATCH AUTOSEL 5.2 40/63] ppp: Fix memory leak in ppp_write

2019-10-01 Thread Sasha Levin
From: Takeshi Misawa [ Upstream commit 4c247de564f1ff614d11b3bb5313fb70d7b9598b ] When ppp is closing, __ppp_xmit_process() failed to enqueue skb and skb allocated in ppp_write() is leaked. syzbot reported : BUG: memory leak unreferenced object 0x88812a17bc00 (size 224): comm "syz-executo

[PATCH AUTOSEL 5.2 30/63] thermal: Fix use-after-free when unregistering thermal zone device

2019-10-01 Thread Sasha Levin
From: Ido Schimmel [ Upstream commit 1851799e1d2978f68eea5d9dff322e121dcf59c1 ] thermal_zone_device_unregister() cancels the delayed work that polls the thermal zone, but it does not wait for it to finish. This is racy with respect to the freeing of the thermal zone device, which can result in a

[PATCH AUTOSEL 5.2 41/63] sched/membarrier: Call sync_core only before usermode for same mm

2019-10-01 Thread Sasha Levin
From: Mathieu Desnoyers [ Upstream commit 2840cf02fae627860156737e83326df354ee4ec6 ] When the prev and next task's mm change, switch_mm() provides the core serializing guarantees before returning to usermode. The only case where an explicit core serialization is needed is when the scheduler keep

[PATCH AUTOSEL 5.2 42/63] sched/membarrier: Fix private expedited registration check

2019-10-01 Thread Sasha Levin
From: Mathieu Desnoyers [ Upstream commit fc0d77387cb5ae883fd774fc559e056a8dde024c ] Fix a logic flaw in the way membarrier_register_private_expedited() handles ready state checks for private expedited sync core and private expedited registrations. If a private expedited membarrier registration

[PATCH AUTOSEL 5.2 49/63] bpf: Fix bpf_event_output re-entry issue

2019-10-01 Thread Sasha Levin
From: Allan Zhang [ Upstream commit 768fb61fcc13b2acaca758275d54c09a65e2968b ] BPF_PROG_TYPE_SOCK_OPS program can reenter bpf_event_output because it can be called from atomic and non-atomic contexts since we don't have bpf_prog_active to prevent it happen. This patch enables 3 levels of nestin

[PATCH AUTOSEL 5.2 44/63] perf build: Add detection of java-11-openjdk-devel package

2019-10-01 Thread Sasha Levin
From: Thomas Richter [ Upstream commit 815c1560bf8fd522b8d93a1d727868b910c1cc24 ] With Java 11 there is no seperate JRE anymore. Details: https://coderanch.com/t/701603/java/JRE-JDK Therefore the detection of the JRE needs to be adapted. This change works for s390 and x86. I have not test

[PATCH AUTOSEL 5.2 57/63] nfp: flower: prevent memory leak in nfp_flower_spawn_phy_reprs

2019-10-01 Thread Sasha Levin
From: Navid Emamdoost [ Upstream commit 8572cea1461a006bce1d06c0c4b0575869125fa4 ] In nfp_flower_spawn_phy_reprs, in the for loop over eth_tbl if any of intermediate allocations or initializations fail memory is leaked. requiered releases are added. Fixes: b94524529741 ("nfp: flower: add per re

[PATCH AUTOSEL 5.2 56/63] vrf: Do not attempt to create IPv6 mcast rule if IPv6 is disabled

2019-10-01 Thread Sasha Levin
From: David Ahern [ Upstream commit dac91170f8e9c73784af5fad6225e954b795601c ] A user reported that vrf create fails when IPv6 is disabled at boot using 'ipv6.disable=1': https://bugzilla.kernel.org/show_bug.cgi?id=204903 The failure is adding fib rules at create time. Add RTNL_FAMILY_IP6MR

[PATCH AUTOSEL 5.2 46/63] kernel/elfcore.c: include proper prototypes

2019-10-01 Thread Sasha Levin
From: Valdis Kletnieks [ Upstream commit 0f74914071ab7e7b78731ed62bf350e3a344e0a5 ] When building with W=1, gcc properly complains that there's no prototypes: CC kernel/elfcore.o kernel/elfcore.c:7:17: warning: no previous prototype for 'elf_core_extra_phdrs' [-Wmissing-prototypes]

[PATCH AUTOSEL 5.2 48/63] blk-mq: move lockdep_assert_held() into elevator_exit

2019-10-01 Thread Sasha Levin
From: Ming Lei [ Upstream commit 284b94be1925dbe035ce5218d8b5c197321262c7 ] Commit c48dac137a62 ("block: don't hold q->sysfs_lock in elevator_init_mq") removes q->sysfs_lock from elevator_init_mq(), but forgot to deal with lockdep_assert_held() called in blk_mq_sched_free_requests() which is run

[PATCH AUTOSEL 5.2 54/63] net: phy: micrel: add Asym Pause workaround for KSZ9021

2019-10-01 Thread Sasha Levin
From: Hans Andersson [ Upstream commit 407d8098cb1ab338199f4753162799a488d87d23 ] The Micrel KSZ9031 PHY may fail to establish a link when the Asymmetric Pause capability is set. This issue is described in a Silicon Errata (DS8691D or DS8692D), which advises to always disable the capabil

[PATCH AUTOSEL 5.2 59/63] fuse: fix deadlock with aio poll and fuse_iqueue::waitq.lock

2019-10-01 Thread Sasha Levin
From: Eric Biggers [ Upstream commit 76e43c8ccaa35c30d5df853013561145a0f750a5 ] When IOCB_CMD_POLL is used on the FUSE device, aio_poll() disables IRQs and takes kioctx::ctx_lock, then fuse_iqueue::waitq.lock. This may have to wait for fuse_iqueue::waitq.lock to be released by one of many place

[PATCH AUTOSEL 5.2 58/63] nfp: abm: fix memory leak in nfp_abm_u32_knode_replace

2019-10-01 Thread Sasha Levin
From: Navid Emamdoost [ Upstream commit 78beef629fd95be4ed853b2d37b832f766bd96ca ] In nfp_abm_u32_knode_replace if the allocation for match fails it should go to the error handling instead of returning. Updated other gotos to have correct errno returned, too. Signed-off-by: Navid Emamdoost Sig

[PATCH AUTOSEL 4.19 09/43] ceph: reconnect connection if session hang in opening state

2019-10-01 Thread Sasha Levin
From: Erqi Chen [ Upstream commit 71a228bc8d65900179e37ac309e678f8c523f133 ] If client mds session is evicted in CEPH_MDS_SESSION_OPENING state, mds won't send session msg to client, and delayed_work skip CEPH_MDS_SESSION_OPENING state session, the session hang forever. Allow ceph_con_keepalive

[PATCH AUTOSEL 4.19 04/43] 9p: Transport error uninitialized

2019-10-01 Thread Sasha Levin
From: Lu Shuaibing [ Upstream commit 0ce772fe79b68f83df40f07f28207b292785c677 ] The p9_tag_alloc() does not initialize the transport error t_err field. The struct p9_req_t *req is allocated and stored in a struct p9_client variable. The field t_err is never initialized before p9_conn_cancel() ch

[PATCH AUTOSEL 4.19 16/43] net/sched: act_sample: don't push mac header on ip6gre ingress

2019-10-01 Thread Sasha Levin
From: Davide Caratti [ Upstream commit 92974a1d006ad8b30d53047c70974c9e065eb7df ] current 'sample' action doesn't push the mac header of ingress packets if they are received by a layer 3 tunnel (like gre or sit); but it forgot to check for gre over ipv6, so the following script: # tc q a dev $

[PATCH AUTOSEL 4.19 14/43] drm/amdgpu: Check for valid number of registers to read

2019-10-01 Thread Sasha Levin
From: Trek [ Upstream commit 73d8e6c7b841d9bf298c8928f228fb433676635c ] Do not try to allocate any amount of memory requested by the user. Instead limit it to 128 registers. Actually the longest series of consecutive allowed registers are 48, mmGB_TILE_MODE0-31 and mmGB_MACROTILE_MODE0-15 (0x264

[PATCH AUTOSEL 4.19 12/43] netfilter: nf_tables: allow lookups in dynamic sets

2019-10-01 Thread Sasha Levin
From: Florian Westphal [ Upstream commit acab713177377d9e0889c46bac7ff0cfb9a90c4d ] This un-breaks lookups in sets that have the 'dynamic' flag set. Given this active example configuration: table filter { set set1 { type ipv4_addr size 64 flags dynamic,timeout timeout 1m }

[PATCH AUTOSEL 4.19 20/43] net/phy: fix DP83865 10 Mbps HDX loopback disable function

2019-10-01 Thread Sasha Levin
From: Peter Mamonov [ Upstream commit e47488b2df7f9cb405789c7f5d4c27909fc597ae ] According to the DP83865 datasheet "the 10 Mbps HDX loopback can be disabled in the expanded memory register 0x1C0.1". The driver erroneously used bit 0 instead of bit 1. Fixes: 4621bf129856 ("phy: Add file missed

[PATCH AUTOSEL 4.19 03/43] fs: nfs: Fix possible null-pointer dereferences in encode_attrs()

2019-10-01 Thread Sasha Levin
From: Jia-Ju Bai [ Upstream commit e2751463eaa6f9fec8fea80abbdc62dbc487b3c5 ] In encode_attrs(), there is an if statement on line 1145 to check whether label is NULL: if (label && (attrmask[2] & FATTR4_WORD2_SECURITY_LABEL)) When label is NULL, it is used on lines 1178-1181: *p++ = cpu_

[PATCH AUTOSEL 4.19 25/43] thermal_hwmon: Sanitize thermal_zone type

2019-10-01 Thread Sasha Levin
From: Stefan Mavrodiev [ Upstream commit 8c7aa184281c01fc26f319059efb94725012921d ] When calling thermal_add_hwmon_sysfs(), the device type is sanitized by replacing '-' with '_'. However tz->type remains unsanitized. Thus calling thermal_hwmon_lookup_by_type() returns no device. And if there is

[PATCH AUTOSEL 5.2 63/63] Btrfs: fix selftests failure due to uninitialized i_mode in test inodes

2019-10-01 Thread Sasha Levin
From: Filipe Manana [ Upstream commit 9f7fec0ba89108b9385f1b9fb167861224912a4a ] Some of the self tests create a test inode, setup some extents and then do calls to btrfs_get_extent() to test that the corresponding extent maps exist and are correct. However btrfs_get_extent(), since the 5.2 merg

[PATCH AUTOSEL 4.19 27/43] fuse: fix memleak in cuse_channel_open

2019-10-01 Thread Sasha Levin
From: zhengbin [ Upstream commit 9ad09b1976c562061636ff1e01bfc3a57aebe56b ] If cuse_send_init fails, need to fuse_conn_put cc->fc. cuse_channel_open->fuse_conn_init->refcount_set(&fc->count, 1) ->fuse_dev_alloc->fuse_conn_get ->fuse_dev_free->fuse_conn_put Fix

[PATCH AUTOSEL 4.19 28/43] arcnet: provide a buffer big enough to actually receive packets

2019-10-01 Thread Sasha Levin
From: Uwe Kleine-König [ Upstream commit 02a07046834e64970f3bcd87a422ac2b0adb80de ] struct archdr is only big enough to hold the header of various types of arcnet packets. So to provide enough space to hold the data read from hardware provide a buffer large enough to hold a packet with maximal s

Re: New sysfs interface for privacy screens

2019-10-01 Thread Mat King
On Tue, Oct 1, 2019 at 10:27 AM Greg KH wrote: > > On Tue, Oct 01, 2019 at 10:09:46AM -0600, Mat King wrote: > > Resending in plain text mode > > > > I have been looking into adding Linux support for electronic privacy > > screens which is a feature on some new laptops which is built into the > >

[PATCH AUTOSEL 4.19 35/43] kernel/elfcore.c: include proper prototypes

2019-10-01 Thread Sasha Levin
From: Valdis Kletnieks [ Upstream commit 0f74914071ab7e7b78731ed62bf350e3a344e0a5 ] When building with W=1, gcc properly complains that there's no prototypes: CC kernel/elfcore.o kernel/elfcore.c:7:17: warning: no previous prototype for 'elf_core_extra_phdrs' [-Wmissing-prototypes]

[PATCH AUTOSEL 4.19 39/43] nfp: flower: fix memory leak in nfp_flower_spawn_vnic_reprs

2019-10-01 Thread Sasha Levin
From: Navid Emamdoost [ Upstream commit 8ce39eb5a67aee25d9f05b40b673c95b23502e3e ] In nfp_flower_spawn_vnic_reprs in the loop if initialization or the allocations fail memory is leaked. Appropriate releases are added. Fixes: b94524529741 ("nfp: flower: add per repr private data for LAG offload"

[PATCH AUTOSEL 4.19 31/43] sched/membarrier: Call sync_core only before usermode for same mm

2019-10-01 Thread Sasha Levin
From: Mathieu Desnoyers [ Upstream commit 2840cf02fae627860156737e83326df354ee4ec6 ] When the prev and next task's mm change, switch_mm() provides the core serializing guarantees before returning to usermode. The only case where an explicit core serialization is needed is when the scheduler keep

[PATCH AUTOSEL 4.19 30/43] ppp: Fix memory leak in ppp_write

2019-10-01 Thread Sasha Levin
From: Takeshi Misawa [ Upstream commit 4c247de564f1ff614d11b3bb5313fb70d7b9598b ] When ppp is closing, __ppp_xmit_process() failed to enqueue skb and skb allocated in ppp_write() is leaked. syzbot reported : BUG: memory leak unreferenced object 0x88812a17bc00 (size 224): comm "syz-executo

[PATCH AUTOSEL 4.14 12/29] net/sched: act_sample: don't push mac header on ip6gre ingress

2019-10-01 Thread Sasha Levin
From: Davide Caratti [ Upstream commit 92974a1d006ad8b30d53047c70974c9e065eb7df ] current 'sample' action doesn't push the mac header of ingress packets if they are received by a layer 3 tunnel (like gre or sit); but it forgot to check for gre over ipv6, so the following script: # tc q a dev $

[PATCH AUTOSEL 4.14 15/29] usbnet: ignore endpoints with invalid wMaxPacketSize

2019-10-01 Thread Sasha Levin
From: Bjørn Mork [ Upstream commit 8d3d7c2029c1b360f1a6b0a2fca470b57eb575c0 ] Endpoints with zero wMaxPacketSize are not usable for transferring data. Ignore such endpoints when looking for valid in, out and status pipes, to make the drivers more robust against invalid and meaningless descriptor

[PATCH AUTOSEL 4.14 05/29] ceph: fix directories inode i_blkbits initialization

2019-10-01 Thread Sasha Levin
From: Luis Henriques [ Upstream commit 750670341a24cb714e624e0fd7da30900ad93752 ] When filling an inode with info from the MDS, i_blkbits is being initialized using fl_stripe_unit, which contains the stripe unit in bytes. Unfortunately, this doesn't make sense for directories as they have fl_st

[PATCH AUTOSEL 4.14 21/29] ppp: Fix memory leak in ppp_write

2019-10-01 Thread Sasha Levin
From: Takeshi Misawa [ Upstream commit 4c247de564f1ff614d11b3bb5313fb70d7b9598b ] When ppp is closing, __ppp_xmit_process() failed to enqueue skb and skb allocated in ppp_write() is leaked. syzbot reported : BUG: memory leak unreferenced object 0x88812a17bc00 (size 224): comm "syz-executo

[PATCH AUTOSEL 4.14 11/29] pNFS: Ensure we do clear the return-on-close layout stateid on fatal errors

2019-10-01 Thread Sasha Levin
From: Trond Myklebust [ Upstream commit 9c47b18cf722184f32148784189fca945a7d0561 ] IF the server rejected our layout return with a state error such as NFS4ERR_BAD_STATEID, or even a stale inode error, then we do want to clear out all the remaining layout segments and mark that stateid as invalid

[PATCH AUTOSEL 4.14 17/29] net_sched: add max len check for TCA_KIND

2019-10-01 Thread Sasha Levin
From: Cong Wang [ Upstream commit 62794fc4fbf52f2209dc094ea255eaef760e7d01 ] The TCA_KIND attribute is of NLA_STRING which does not check the NUL char. KMSAN reported an uninit-value of TCA_KIND which is likely caused by the lack of NUL. Change it to NLA_NUL_STRING and add a max len too. Fixes

[PATCH AUTOSEL 4.14 28/29] usbnet: sanity checking of packet sizes and device mtu

2019-10-01 Thread Sasha Levin
From: Oliver Neukum [ Upstream commit 280ceaed79f18db930c0cc8bb21f6493490bf29c ] After a reset packet sizes and device mtu can change and need to be reevaluated to calculate queue sizes. Malicious devices can set this to zero and we divide by it. Introduce sanity checking. Reported-and-tested-b

[PATCH AUTOSEL 4.14 20/29] arcnet: provide a buffer big enough to actually receive packets

2019-10-01 Thread Sasha Levin
From: Uwe Kleine-König [ Upstream commit 02a07046834e64970f3bcd87a422ac2b0adb80de ] struct archdr is only big enough to hold the header of various types of arcnet packets. So to provide enough space to hold the data read from hardware provide a buffer large enough to hold a packet with maximal s

[PATCH AUTOSEL 4.9 06/19] ceph: reconnect connection if session hang in opening state

2019-10-01 Thread Sasha Levin
From: Erqi Chen [ Upstream commit 71a228bc8d65900179e37ac309e678f8c523f133 ] If client mds session is evicted in CEPH_MDS_SESSION_OPENING state, mds won't send session msg to client, and delayed_work skip CEPH_MDS_SESSION_OPENING state session, the session hang forever. Allow ceph_con_keepalive

[PATCH AUTOSEL 4.14 26/29] macsec: drop skb sk before calling gro_cells_receive

2019-10-01 Thread Sasha Levin
From: Xin Long [ Upstream commit ba56d8ce38c8252fff5b745db3899cf092578ede ] Fei Liu reported a crash when doing netperf on a topo of macsec dev over veth: [ 448.919128] refcount_t: underflow; use-after-free. [ 449.090460] Call trace: [ 449.092895] refcount_sub_and_test+0xb4/0xc0 [

[PATCH AUTOSEL 4.9 17/19] macsec: drop skb sk before calling gro_cells_receive

2019-10-01 Thread Sasha Levin
From: Xin Long [ Upstream commit ba56d8ce38c8252fff5b745db3899cf092578ede ] Fei Liu reported a crash when doing netperf on a topo of macsec dev over veth: [ 448.919128] refcount_t: underflow; use-after-free. [ 449.090460] Call trace: [ 449.092895] refcount_sub_and_test+0xb4/0xc0 [

[PATCH AUTOSEL 4.14 23/29] perf build: Add detection of java-11-openjdk-devel package

2019-10-01 Thread Sasha Levin
From: Thomas Richter [ Upstream commit 815c1560bf8fd522b8d93a1d727868b910c1cc24 ] With Java 11 there is no seperate JRE anymore. Details: https://coderanch.com/t/701603/java/JRE-JDK Therefore the detection of the JRE needs to be adapted. This change works for s390 and x86. I have not test

[PATCH AUTOSEL 4.9 19/19] sch_netem: fix a divide by zero in tabledist()

2019-10-01 Thread Sasha Levin
From: Eric Dumazet [ Upstream commit b41d936b5ecfdb3a4abc525ce6402a6c49cffddc ] syzbot managed to crash the kernel in tabledist() loading an empty distribution table. t = dist->table[rnd % dist->size]; Simply return an error when such load is attempted. Fixes: 1da177e4c3f4 ("Linux-2.6

[PATCH AUTOSEL 4.4 04/15] xen/pci: reserve MCFG areas earlier

2019-10-01 Thread Sasha Levin
From: Igor Druzhinin [ Upstream commit a4098bc6eed5e31e0391bcc068e61804c98138df ] If MCFG area is not reserved in E820, Xen by default will defer its usage until Dom0 registers it explicitly after ACPI parser recognizes it as a reserved resource in DSDT. Having it reserved in E820 is not mandato

[PATCH AUTOSEL 4.14 24/29] kernel/elfcore.c: include proper prototypes

2019-10-01 Thread Sasha Levin
From: Valdis Kletnieks [ Upstream commit 0f74914071ab7e7b78731ed62bf350e3a344e0a5 ] When building with W=1, gcc properly complains that there's no prototypes: CC kernel/elfcore.o kernel/elfcore.c:7:17: warning: no previous prototype for 'elf_core_extra_phdrs' [-Wmissing-prototypes]

[PATCH AUTOSEL 4.4 15/15] sch_netem: fix a divide by zero in tabledist()

2019-10-01 Thread Sasha Levin
From: Eric Dumazet [ Upstream commit b41d936b5ecfdb3a4abc525ce6402a6c49cffddc ] syzbot managed to crash the kernel in tabledist() loading an empty distribution table. t = dist->table[rnd % dist->size]; Simply return an error when such load is attempted. Fixes: 1da177e4c3f4 ("Linux-2.6

[PATCH AUTOSEL 4.4 14/15] usbnet: sanity checking of packet sizes and device mtu

2019-10-01 Thread Sasha Levin
From: Oliver Neukum [ Upstream commit 280ceaed79f18db930c0cc8bb21f6493490bf29c ] After a reset packet sizes and device mtu can change and need to be reevaluated to calculate queue sizes. Malicious devices can set this to zero and we divide by it. Introduce sanity checking. Reported-and-tested-b

[PATCH AUTOSEL 4.4 08/15] usbnet: ignore endpoints with invalid wMaxPacketSize

2019-10-01 Thread Sasha Levin
From: Bjørn Mork [ Upstream commit 8d3d7c2029c1b360f1a6b0a2fca470b57eb575c0 ] Endpoints with zero wMaxPacketSize are not usable for transferring data. Ignore such endpoints when looking for valid in, out and status pipes, to make the drivers more robust against invalid and meaningless descriptor

[PATCH AUTOSEL 4.4 12/15] arcnet: provide a buffer big enough to actually receive packets

2019-10-01 Thread Sasha Levin
From: Uwe Kleine-König [ Upstream commit 02a07046834e64970f3bcd87a422ac2b0adb80de ] struct archdr is only big enough to hold the header of various types of arcnet packets. So to provide enough space to hold the data read from hardware provide a buffer large enough to hold a packet with maximal s

[PATCH AUTOSEL 4.4 11/15] fuse: fix memleak in cuse_channel_open

2019-10-01 Thread Sasha Levin
From: zhengbin [ Upstream commit 9ad09b1976c562061636ff1e01bfc3a57aebe56b ] If cuse_send_init fails, need to fuse_conn_put cc->fc. cuse_channel_open->fuse_conn_init->refcount_set(&fc->count, 1) ->fuse_dev_alloc->fuse_conn_get ->fuse_dev_free->fuse_conn_put Fix

[PATCH AUTOSEL 4.4 13/15] kernel/elfcore.c: include proper prototypes

2019-10-01 Thread Sasha Levin
From: Valdis Kletnieks [ Upstream commit 0f74914071ab7e7b78731ed62bf350e3a344e0a5 ] When building with W=1, gcc properly complains that there's no prototypes: CC kernel/elfcore.o kernel/elfcore.c:7:17: warning: no previous prototype for 'elf_core_extra_phdrs' [-Wmissing-prototypes]

[PATCH AUTOSEL 4.4 07/15] cdc_ncm: fix divide-by-zero caused by invalid wMaxPacketSize

2019-10-01 Thread Sasha Levin
From: Bjørn Mork [ Upstream commit 3fe4b3351301660653a2bc73f2226da0ebd2b95e ] Endpoints with zero wMaxPacketSize are not usable for transferring data. Ignore such endpoints when looking for valid in, out and status pipes, to make the driver more robust against invalid and meaningless descriptors

[PATCH AUTOSEL 4.4 10/15] thermal: Fix use-after-free when unregistering thermal zone device

2019-10-01 Thread Sasha Levin
From: Ido Schimmel [ Upstream commit 1851799e1d2978f68eea5d9dff322e121dcf59c1 ] thermal_zone_device_unregister() cancels the delayed work that polls the thermal zone, but it does not wait for it to finish. This is racy with respect to the freeing of the thermal zone device, which can result in a

[PATCH AUTOSEL 4.4 09/15] net/phy: fix DP83865 10 Mbps HDX loopback disable function

2019-10-01 Thread Sasha Levin
From: Peter Mamonov [ Upstream commit e47488b2df7f9cb405789c7f5d4c27909fc597ae ] According to the DP83865 datasheet "the 10 Mbps HDX loopback can be disabled in the expanded memory register 0x1C0.1". The driver erroneously used bit 0 instead of bit 1. Fixes: 4621bf129856 ("phy: Add file missed

[PATCH AUTOSEL 4.4 05/15] ceph: fix directories inode i_blkbits initialization

2019-10-01 Thread Sasha Levin
From: Luis Henriques [ Upstream commit 750670341a24cb714e624e0fd7da30900ad93752 ] When filling an inode with info from the MDS, i_blkbits is being initialized using fl_stripe_unit, which contains the stripe unit in bytes. Unfortunately, this doesn't make sense for directories as they have fl_st

[PATCH AUTOSEL 4.4 03/15] 9p: avoid attaching writeback_fid on mmap with type PRIVATE

2019-10-01 Thread Sasha Levin
From: Chengguang Xu [ Upstream commit c87a37ebd40b889178664c2c09cc187334146292 ] Currently on mmap cache policy, we always attach writeback_fid whether mmap type is SHARED or PRIVATE. However, in the use case of kata-container which combines 9p(Guest OS) with overlayfs(Host OS), this behavior wi

Re: [PATCH 0/3] Pine64+ specific hacks for RTL8211E Ethernet PHY

2019-10-01 Thread Florian Fainelli
On 10/1/19 1:29 AM, Icenowy Zheng wrote: > There're some Pine64+ boards known to have broken RTL8211E chips, and > a hack is given by Pine64+, which is said to be from Realtek. > > This patchset adds the hack. > > The hack is taken from U-Boot, and it contains magic numbers without > any document

[PATCH AUTOSEL 4.9 18/19] usbnet: sanity checking of packet sizes and device mtu

2019-10-01 Thread Sasha Levin
From: Oliver Neukum [ Upstream commit 280ceaed79f18db930c0cc8bb21f6493490bf29c ] After a reset packet sizes and device mtu can change and need to be reevaluated to calculate queue sizes. Malicious devices can set this to zero and we divide by it. Introduce sanity checking. Reported-and-tested-b

Re: [PATCH v3 1/5] arm64: vdso32: Introduce COMPAT_CC_IS_GCC

2019-10-01 Thread Will Deacon
On Tue, Oct 01, 2019 at 04:30:56PM +0100, Catalin Marinas wrote: > On Tue, Oct 01, 2019 at 03:43:54PM +0100, Will Deacon wrote: > > > On Thu, Sep 26, 2019 at 10:43:38PM +0100, Vincenzo Frascino wrote: > > > > +config COMPATCC_IS_ARM_GCC > > > > + def_bool $(success,$(COMPATCC) --vers

[PATCH AUTOSEL 4.9 09/19] usbnet: ignore endpoints with invalid wMaxPacketSize

2019-10-01 Thread Sasha Levin
From: Bjørn Mork [ Upstream commit 8d3d7c2029c1b360f1a6b0a2fca470b57eb575c0 ] Endpoints with zero wMaxPacketSize are not usable for transferring data. Ignore such endpoints when looking for valid in, out and status pipes, to make the drivers more robust against invalid and meaningless descriptor

[PATCH AUTOSEL 4.4 06/15] drm/amdgpu: Check for valid number of registers to read

2019-10-01 Thread Sasha Levin
From: Trek [ Upstream commit 73d8e6c7b841d9bf298c8928f228fb433676635c ] Do not try to allocate any amount of memory requested by the user. Instead limit it to 128 registers. Actually the longest series of consecutive allowed registers are 48, mmGB_TILE_MODE0-31 and mmGB_MACROTILE_MODE0-15 (0x264

[PATCH AUTOSEL 4.4 02/15] fs: nfs: Fix possible null-pointer dereferences in encode_attrs()

2019-10-01 Thread Sasha Levin
From: Jia-Ju Bai [ Upstream commit e2751463eaa6f9fec8fea80abbdc62dbc487b3c5 ] In encode_attrs(), there is an if statement on line 1145 to check whether label is NULL: if (label && (attrmask[2] & FATTR4_WORD2_SECURITY_LABEL)) When label is NULL, it is used on lines 1178-1181: *p++ = cpu_

[PATCH AUTOSEL 4.4 01/15] ima: always return negative code for error

2019-10-01 Thread Sasha Levin
From: Sascha Hauer [ Upstream commit f5e1040196dbfe14c77ce3dfe3b7b08d2d961e88 ] integrity_kernel_read() returns the number of bytes read. If this is a short read then this positive value is returned from ima_calc_file_hash_atfm(). Currently this is only indirectly called from ima_calc_file_hash(

[PATCH AUTOSEL 4.9 13/19] arcnet: provide a buffer big enough to actually receive packets

2019-10-01 Thread Sasha Levin
From: Uwe Kleine-König [ Upstream commit 02a07046834e64970f3bcd87a422ac2b0adb80de ] struct archdr is only big enough to hold the header of various types of arcnet packets. So to provide enough space to hold the data read from hardware provide a buffer large enough to hold a packet with maximal s

[PATCH AUTOSEL 4.9 15/19] sched/core: Fix migration to invalid CPU in __set_cpus_allowed_ptr()

2019-10-01 Thread Sasha Levin
From: KeMeng Shi [ Upstream commit 714e501e16cd473538b609b3e351b2cc9f7f09ed ] An oops can be triggered in the scheduler when running qemu on arm64: Unable to handle kernel paging request at virtual address 08effe40 Internal error: Oops: 9607 [#1] SMP Process migration/0 (pid: 12,

[PATCH AUTOSEL 4.9 14/19] ppp: Fix memory leak in ppp_write

2019-10-01 Thread Sasha Levin
From: Takeshi Misawa [ Upstream commit 4c247de564f1ff614d11b3bb5313fb70d7b9598b ] When ppp is closing, __ppp_xmit_process() failed to enqueue skb and skb allocated in ppp_write() is leaked. syzbot reported : BUG: memory leak unreferenced object 0x88812a17bc00 (size 224): comm "syz-executo

[PATCH AUTOSEL 4.9 12/19] fuse: fix memleak in cuse_channel_open

2019-10-01 Thread Sasha Levin
From: zhengbin [ Upstream commit 9ad09b1976c562061636ff1e01bfc3a57aebe56b ] If cuse_send_init fails, need to fuse_conn_put cc->fc. cuse_channel_open->fuse_conn_init->refcount_set(&fc->count, 1) ->fuse_dev_alloc->fuse_conn_get ->fuse_dev_free->fuse_conn_put Fix

[PATCH AUTOSEL 4.9 02/19] fs: nfs: Fix possible null-pointer dereferences in encode_attrs()

2019-10-01 Thread Sasha Levin
From: Jia-Ju Bai [ Upstream commit e2751463eaa6f9fec8fea80abbdc62dbc487b3c5 ] In encode_attrs(), there is an if statement on line 1145 to check whether label is NULL: if (label && (attrmask[2] & FATTR4_WORD2_SECURITY_LABEL)) When label is NULL, it is used on lines 1178-1181: *p++ = cpu_

[PATCH AUTOSEL 4.9 16/19] kernel/elfcore.c: include proper prototypes

2019-10-01 Thread Sasha Levin
From: Valdis Kletnieks [ Upstream commit 0f74914071ab7e7b78731ed62bf350e3a344e0a5 ] When building with W=1, gcc properly complains that there's no prototypes: CC kernel/elfcore.o kernel/elfcore.c:7:17: warning: no previous prototype for 'elf_core_extra_phdrs' [-Wmissing-prototypes]

[PATCH AUTOSEL 4.9 01/19] ima: always return negative code for error

2019-10-01 Thread Sasha Levin
From: Sascha Hauer [ Upstream commit f5e1040196dbfe14c77ce3dfe3b7b08d2d961e88 ] integrity_kernel_read() returns the number of bytes read. If this is a short read then this positive value is returned from ima_calc_file_hash_atfm(). Currently this is only indirectly called from ima_calc_file_hash(

[PATCH AUTOSEL 4.9 07/19] drm/amdgpu: Check for valid number of registers to read

2019-10-01 Thread Sasha Levin
From: Trek [ Upstream commit 73d8e6c7b841d9bf298c8928f228fb433676635c ] Do not try to allocate any amount of memory requested by the user. Instead limit it to 128 registers. Actually the longest series of consecutive allowed registers are 48, mmGB_TILE_MODE0-31 and mmGB_MACROTILE_MODE0-15 (0x264

[PATCH AUTOSEL 4.14 27/29] perf unwind: Fix libunwind build failure on i386 systems

2019-10-01 Thread Sasha Levin
From: Arnaldo Carvalho de Melo [ Upstream commit 26acf400d2dcc72c7e713e1f55db47ad92010cc2 ] Naresh Kamboju reported, that on the i386 build pr_err() doesn't get defined properly due to header ordering: perf-in.o: In function `libunwind__x86_reg_id': tools/perf/util/libunwind/../../arch/x86/

[PATCH AUTOSEL 4.9 11/19] thermal: Fix use-after-free when unregistering thermal zone device

2019-10-01 Thread Sasha Levin
From: Ido Schimmel [ Upstream commit 1851799e1d2978f68eea5d9dff322e121dcf59c1 ] thermal_zone_device_unregister() cancels the delayed work that polls the thermal zone, but it does not wait for it to finish. This is racy with respect to the freeing of the thermal zone device, which can result in a

[PATCH AUTOSEL 4.9 10/19] net/phy: fix DP83865 10 Mbps HDX loopback disable function

2019-10-01 Thread Sasha Levin
From: Peter Mamonov [ Upstream commit e47488b2df7f9cb405789c7f5d4c27909fc597ae ] According to the DP83865 datasheet "the 10 Mbps HDX loopback can be disabled in the expanded memory register 0x1C0.1". The driver erroneously used bit 0 instead of bit 1. Fixes: 4621bf129856 ("phy: Add file missed

[PATCH AUTOSEL 4.9 08/19] cdc_ncm: fix divide-by-zero caused by invalid wMaxPacketSize

2019-10-01 Thread Sasha Levin
From: Bjørn Mork [ Upstream commit 3fe4b3351301660653a2bc73f2226da0ebd2b95e ] Endpoints with zero wMaxPacketSize are not usable for transferring data. Ignore such endpoints when looking for valid in, out and status pipes, to make the driver more robust against invalid and meaningless descriptors

[PATCH AUTOSEL 4.9 05/19] ceph: fix directories inode i_blkbits initialization

2019-10-01 Thread Sasha Levin
From: Luis Henriques [ Upstream commit 750670341a24cb714e624e0fd7da30900ad93752 ] When filling an inode with info from the MDS, i_blkbits is being initialized using fl_stripe_unit, which contains the stripe unit in bytes. Unfortunately, this doesn't make sense for directories as they have fl_st

[PATCH AUTOSEL 4.9 04/19] xen/pci: reserve MCFG areas earlier

2019-10-01 Thread Sasha Levin
From: Igor Druzhinin [ Upstream commit a4098bc6eed5e31e0391bcc068e61804c98138df ] If MCFG area is not reserved in E820, Xen by default will defer its usage until Dom0 registers it explicitly after ACPI parser recognizes it as a reserved resource in DSDT. Having it reserved in E820 is not mandato

[PATCH AUTOSEL 4.9 03/19] 9p: avoid attaching writeback_fid on mmap with type PRIVATE

2019-10-01 Thread Sasha Levin
From: Chengguang Xu [ Upstream commit c87a37ebd40b889178664c2c09cc187334146292 ] Currently on mmap cache policy, we always attach writeback_fid whether mmap type is SHARED or PRIVATE. However, in the use case of kata-container which combines 9p(Guest OS) with overlayfs(Host OS), this behavior wi

[PATCH AUTOSEL 4.14 29/29] sch_netem: fix a divide by zero in tabledist()

2019-10-01 Thread Sasha Levin
From: Eric Dumazet [ Upstream commit b41d936b5ecfdb3a4abc525ce6402a6c49cffddc ] syzbot managed to crash the kernel in tabledist() loading an empty distribution table. t = dist->table[rnd % dist->size]; Simply return an error when such load is attempted. Fixes: 1da177e4c3f4 ("Linux-2.6

[PATCH AUTOSEL 4.14 18/29] thermal: Fix use-after-free when unregistering thermal zone device

2019-10-01 Thread Sasha Levin
From: Ido Schimmel [ Upstream commit 1851799e1d2978f68eea5d9dff322e121dcf59c1 ] thermal_zone_device_unregister() cancels the delayed work that polls the thermal zone, but it does not wait for it to finish. This is racy with respect to the freeing of the thermal zone device, which can result in a

[PATCH AUTOSEL 4.14 14/29] cdc_ncm: fix divide-by-zero caused by invalid wMaxPacketSize

2019-10-01 Thread Sasha Levin
From: Bjørn Mork [ Upstream commit 3fe4b3351301660653a2bc73f2226da0ebd2b95e ] Endpoints with zero wMaxPacketSize are not usable for transferring data. Ignore such endpoints when looking for valid in, out and status pipes, to make the driver more robust against invalid and meaningless descriptors

[PATCH AUTOSEL 4.14 10/29] drm/amdgpu: Check for valid number of registers to read

2019-10-01 Thread Sasha Levin
From: Trek [ Upstream commit 73d8e6c7b841d9bf298c8928f228fb433676635c ] Do not try to allocate any amount of memory requested by the user. Instead limit it to 128 registers. Actually the longest series of consecutive allowed registers are 48, mmGB_TILE_MODE0-31 and mmGB_MACROTILE_MODE0-15 (0x264

[PATCH AUTOSEL 4.14 19/29] fuse: fix memleak in cuse_channel_open

2019-10-01 Thread Sasha Levin
From: zhengbin [ Upstream commit 9ad09b1976c562061636ff1e01bfc3a57aebe56b ] If cuse_send_init fails, need to fuse_conn_put cc->fc. cuse_channel_open->fuse_conn_init->refcount_set(&fc->count, 1) ->fuse_dev_alloc->fuse_conn_get ->fuse_dev_free->fuse_conn_put Fix

<    3   4   5   6   7   8   9   10   11   12   >