Commit graph

889,574 commits

Author SHA1 Message Date
Balakrishna Godavarthi
50cfb94d72 Bluetooth: Update power sources for QCA6390/QCA6490
This change will add all the power sources which are needed
for BT SoC's QCA6390 and QCA6490 to operate.

Change-Id: Ice58ba2b5c637c9be5cab5118c4b060037c1077d
Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
2020-08-02 17:59:29 -07:00
qctecmdr
2abb78b918 Merge "arm64: defconfig: Enable mem2mem drivers on Holi" 2020-08-02 15:29:57 -07:00
qctecmdr
859b461670 Merge "leds: qti-flash: Fix LMH mitigation configuration" 2020-08-02 15:29:56 -07:00
qctecmdr
1fee83940f Merge "arm64: defconfig: Disable LSE_ATOMIC for holi target" 2020-08-02 12:46:03 -07:00
qctecmdr
31f2100c3c Merge "iommu/arm-smmu: Support client configured dynamic domains only in QGKI" 2020-08-02 12:46:03 -07:00
qctecmdr
552f518a28 Merge "msm: kgsl: Update pagefault policy when KGSL_STATE_ACTIVE" 2020-08-02 12:46:02 -07:00
qctecmdr
790840acae Merge "ABI: Update whitelist for arch timer" 2020-08-02 12:46:02 -07:00
qctecmdr
b0c199468a Merge "usb: misc: nb7vpq904m: support 4 lanes display" 2020-08-02 12:46:02 -07:00
qctecmdr
e9ba39aef7 Merge "arm64: defconfig: Enable interconnect driver for sdxlemur" 2020-08-02 12:46:01 -07:00
qctecmdr
2d45ba2f8c Merge "msm: adsprpc: Allow kernel and static handle contexts" 2020-08-02 12:46:01 -07:00
Mayank Grover
8eb897e6a6 arm64: defconfig: Disable LSE_ATOMIC for holi target
LSE_ATOMIC is not supported for holi targets.
Change to disable LSE atomic operations, which
may result in crash for non-cacheable memory atomic
access.

Change-Id: Ibe2aba59de3b907908bae99f9f1cd92e128f348d
Signed-off-by: Ashish Bhimanpalliwar <abhiman@codeaurora.org>
Signed-off-by: Mayank Grover <groverm@codeaurora.org>
2020-08-02 18:25:12 +05:30
Yuanfang Zhang
cbfc1dfde8 defconfig: Disable CTI save function on perf build for holi
Disable CTI save function on perf build to avoid the power and performance
issue.

Change-Id: Ie656b6e911c841b134a78cba0fc5ba089a3deffc
Signed-off-by: Yuanfang Zhang <zhangyuanfang@codeaurora.org>
2020-08-02 18:20:32 +05:30
Raghavendra Kakarla
94344bd445 defconfig: Disable the CONFIG_ARM_CPUILDE_PSCI for holi
for qgki, as we are using the lpm-levels driver for our core
and cluster lpms so disbaling the CONFIG_ARM_CPUILDE_PSCI for
holi in qgki config.

Change-Id: Ie9e40d5fb4ef7324e2c556cea4db26d63ca1ab3e
Signed-off-by: Raghavendra Kakarla <rkakarla@codeaurora.org>
2020-08-02 18:15:43 +05:30
Sriharsha Allenki
a75b1261de defconfig: holi-gki: Enable various configfs functions
Enable various USB CONFIGFS driver modules that add
support for NCM, CCID, CDEV, and GSI and support
for USB host mode video devices as well.

Also, enable the driver module to support USB PHY
and low power audio as well.

Change-Id: Icecd4af4be776f2b8b31677287a086cd6788a3b8
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
2020-08-02 18:11:13 +05:30
Raviteja Tamatam
a854cd0248 arm64: defconfig: Enable mem2mem drivers on Holi
Enable memory to memory multimedia driver support
to allow v4l2 rotator compilation in Holi.

Change-Id: Iaabd0c7ec6f74c0ba2cad5e4d79825339333e33f
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2020-08-02 16:21:52 +05:30
qctecmdr
b6aab13b4e Merge "leds: qpnp-flash-v2: Convert power_supply properties to iio" 2020-08-02 02:57:22 -07:00
qctecmdr
c493a193b0 Merge "scsi: ufs: Configure Vccq/Vccq2 with supplied load in LPM" 2020-08-02 02:57:21 -07:00
qctecmdr
2175496d8c Merge "interconnect: qcom: Add USB3 master for Holi" 2020-08-02 02:57:21 -07:00
Greg Kroah-Hartman
9c8aa25e29 ANDROID: GKI: fix symbol_get/put() build error on arm64 defconfig
kernelci reports a remaining symbol_get/put() build error on arm64
defconfig builds:
	https://kernelci.org/build/android/branch/android11-5.4/kernel/ASB-2020-07-05_5.4-stable-650-ga35cf7283648/

so fix that up by changing the offending driver to be built in and not a
module.

Bug: 162613590
Fixes: 882b7ca141 ("ANDROID: GKI: do not export symbol_get/put()")
Reported-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5934da42852ccf309164a6d6238073b99de5edb2
2020-08-02 08:44:07 +02:00
Isaac J. Manjarres
219ea790c9 arm64: defconfig: Enable dmabuf destructor support on all targets
Enable dmabuf destructor support for all targets.

Change-Id: Ibcea7c4b97bffd5ca5b5f2d168f8befb5acb5317
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-08-01 22:57:06 -07:00
Liam Mark
236b06ac63 dma-buf: Add support to set a destructor on a dma-buf
dma-buf destructor support is useful as it allows clients an opportunity
to undo any attributes, such as security attributes, they have applied to
the dma-buf's memory.

The destructor is called when the dma-buf is freed, if the destructor
returns an error the dma-buf's exporter release function is not called in
order to ensure that memory which has not been properly cleaned up isn't
returned to the system.

Change-Id: If2173b23b441157b3638110f02e2ff90ab6ad1aa
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: resolve merge conflicts/qseecom redefinitions]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-08-01 22:57:06 -07:00
Jishnu Prakash
4866e3fefd arm64: defconfig: Enable PMIC drivers required for holi
Enable PMIC drivers required for holi. Correct some existing
PMIC defconfigs.

Change-Id: Iabbcc7ccb0d18dc4853cd32753a41a82a2c3d815
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
2020-08-01 22:55:08 -07:00
qctecmdr
5756e32237 Merge "sound: usb: Fix error handling path" 2020-08-01 20:06:46 -07:00
qctecmdr
a8cbc18ef6 Merge "iommu/iommu-logger: Log IOMMU client name in debug structures" 2020-08-01 20:06:45 -07:00
qctecmdr
66641c7b90 Merge "msm: kgsl: Don't map DDR as strongly ordered" 2020-08-01 20:06:45 -07:00
Odelu Kukatla
bfc522e814 interconnect: qcom: Add USB3 master for Holi
Add USB3 master so that client can vote for bandwidth
on Holi.

Change-Id: I37661eda4febdff619a703f423aca957f91347b5
Signed-off-by: Odelu Kukatla <okukatla@codeaurora.org>
2020-08-01 11:09:10 -07:00
Chris Lew
b1f8486a62 Revert "qrtr: orphan socket in qrtr_release()"
This reverts commit b7d3d6df72.

This is a preparation change for merging android11-5.4.55 into
msm-5.4 branch. Equivalent change was already merged into
downstream via:

0d116bcb6a net: qrtr: Detach socket from sock during release

Change-Id: Ic028abd16de40c7e0b93ec7f6cf45303103eb087
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2020-08-01 09:52:43 -07:00
Odelu Kukatla
1a9b237caa icc: dt-bindings: Add USB3 master ID for Holi
Add USB3 master ID for Holi so that client can vote
for bandwidth.

Change-Id: Ied8597df5bb86989657d8493816c4a882b898b3f
Signed-off-by: Odelu Kukatla <okukatla@codeaurora.org>
2020-08-01 20:19:22 +05:30
ronaldk
f61549c9f7 msm: cvp: Dynamic clock voting
Get fps info from UMD and cycle count from FW to scale CVP
clock frequency to match CVP workload.

Change-Id: I47c18173987360271f0b2575e815aff0e00afa8d
Signed-off-by: ronaldk <ronaldk@codeaurora.org>
Signed-off-by: George Shen <sqiao@codeaurora.org>
2020-08-01 07:25:12 -07:00
Greg Kroah-Hartman
a35cf72836 ANDROID: GKI: Fix up "do not export symbol_get/put()" commit
When removing the export from symbol_get/put(), I disabled lots of
different drivers in the allmodconfig build file.

As some pointed out, that's not the nicest thing to do, as we really do
want the build coverage, so instead, "tweak" the Kconfig files to make
the problamatic modules be built-in to the kernel image.  That removes
the problem of the export going away and still gives us good build
testing coverage, without modifying any real-world device
configurations.

Note, 3 config options are "turned off" so they can not be selected, as
they could not be worked around in any semi-sane manner:
	VIDEO_CX23885
	DELL_LAPTOP
	SAMPLE_HW_BREAKPOINT
none of which affects any known Android devices.

Bug: 162613590
Fixes: 882b7ca141 ("ANDROID: GKI: do not export symbol_get/put()")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia28f73a64566438940b876a5d9c1a0137c6304d0
2020-08-01 14:28:51 +02:00
Saurabh Sahu
894fef24b2 arm64: defconfig: Add support for clock/CPUFREQHW in HOLI
Enable GCC, GPUCC, DISPCC, CLK_SMD_RPM, DEBUGCC and CPUFREQ_HW for HOLI.

Change-Id: I2b06341da3a815bc33b0d45a5dcd8cada632be6b
Signed-off-by: Saurabh Sahu <sausah@codeaurora.org>
2020-08-01 15:25:18 +05:30
Greg Kroah-Hartman
53b501f197 This is the 5.4.55 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl8kSvEACgkQONu9yGCS
 aT52hg//TXqmLGJiUw/sx0fULFuJqdkaiyhQXFbLz6WZUWGUxNlpD8qC6GbLPe0t
 jZSkUB02iHXgVaTxaN9oefixwRSG/NWLl3cbE4enpjhTpmMIQ5BStEH+AJmZKYLF
 9e/zTVHsynUneTskLgukoKInEuqtg9XS473jBgQS724RZA/LI5BfNquMoENtyj/E
 xbwZK9wol1DzSYAs5QQ93WesUothxvLA1dlAuqzQ2mq9zevWSz+nVSgsT1kYNUfd
 LpZ1AdRbxMlsNLToUd+lkZ21ZxHw7i58KhbyZr5fbQbzqr5NmP33F4qbSplwOSX6
 WsdpkET/GaZgOY9yw41KYG8vv9tMYnXYuxyYc2xgxhnU/dmItKQ1bxnFzJODNbnc
 8FglncvuN0daJdDOTxBWUoLLotiqUVPBWa4i1sPQlPRGN9m1PBe5KpSUH7U1wK5f
 8nHFP6KU0DKaFLHaVF2aSfWlX3r5gR66wSc5RWwNBjiOr8pLIBWeb06CpH7BwQhl
 9xzvYW++4NgqaAz6jKZJ0XEZZKY8nJRs1SoUYRQRk8MKhYpHB7SlVMDvrjs9i3gt
 wGGwohYBcwczh1i7MRRkodusj0g+1D6Tr4EEdH/NhIcL0yd9eZrnv7noQCS6HZlD
 BFfS0vPMQU/JHQL7G/vdN+73eDdnRFZjbClwnDrsRTJL5NDfqM0=
 =jer2
 -----END PGP SIGNATURE-----

Merge 5.4.55 into android11-5.4

Changes in 5.4.55
	AX.25: Fix out-of-bounds read in ax25_connect()
	AX.25: Prevent out-of-bounds read in ax25_sendmsg()
	dev: Defer free of skbs in flush_backlog
	drivers/net/wan/x25_asy: Fix to make it work
	ip6_gre: fix null-ptr-deref in ip6gre_init_net()
	net-sysfs: add a newline when printing 'tx_timeout' by sysfs
	net: udp: Fix wrong clean up for IS_UDPLITE macro
	qrtr: orphan socket in qrtr_release()
	rtnetlink: Fix memory(net_device) leak when ->newlink fails
	rxrpc: Fix sendmsg() returning EPIPE due to recvmsg() returning ENODATA
	tcp: allow at most one TLP probe per flight
	AX.25: Prevent integer overflows in connect and sendmsg
	sctp: shrink stream outq only when new outcnt < old outcnt
	sctp: shrink stream outq when fails to do addstream reconf
	udp: Copy has_conns in reuseport_grow().
	udp: Improve load balancing for SO_REUSEPORT.
	regmap: debugfs: check count when read regmap file
	PM: wakeup: Show statistics for deleted wakeup sources again
	Revert "dpaa_eth: fix usage as DSA master, try 3"
	Linux 5.4.55

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I776630d05a9d6a34f76719cb3d2fb6b9790d643b
2020-08-01 11:46:55 +02:00
Greg Kroah-Hartman
763a90d27e ANDROID: GKI: fix up abi definition files
Something went wrong with TH and it was not catching these changes over
the past few days :(

So update the abi definition files.  These changes are due to a number
of different previous commits for config option requests by partners.

Leaf changes summary: 108 artifacts changed (14 filtered out)
Changed leaf types summary: 2 (1 filtered out) leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 105 Changed (13 filtered out), 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 1 Changed, 0 Added variable

105 functions with some sub-type change:

1 Changed variable:
  [C] 'const v4l2_subdev_ops v4l2_subdev_call_wrappers' was changed at v4l2-subdev.c:321:1:
    CRC value (modversions) changed from 0x58d0c3c0 to 0xc38e0511

'struct dma_buf at dma-buf.h:382:1' changed:
  type size changed from 1984 to 2048 (in bits)
  1 data member insertion:
    'spinlock_t dma_buf::name_lock', at offset 832 (in bits) at dma-buf.h:392:1
  there are data member changes:
    'module* dma_buf::owner' offset changed from 832 to 896 (in bits) (by +64 bits)
    'list_head dma_buf::list_node' offset changed from 896 to 960 (in bits) (by +64 bits)
    'void* dma_buf::priv' offset changed from 1024 to 1088 (in bits) (by +64 bits)
    'dma_resv* dma_buf::resv' offset changed from 1088 to 1152 (in bits) (by +64 bits)
    'wait_queue_head_t dma_buf::poll' offset changed from 1152 to 1216 (in bits) (by +64 bits)
    'dma_buf_poll_cb_t dma_buf::cb_excl' offset changed from 1344 to 1408 (in bits) (by +64 bits)
    'dma_buf_poll_cb_t dma_buf::cb_shared' offset changed from 1664 to 1728 (in bits) (by +64 bits)
  87 impacted interfaces

'struct v4l2_subdev_fh at v4l2-subdev.h:906:1' changed:
  type size changed from 1216 to 1280 (in bits)
  1 data member insertion:
    'v4l2_subdev_pad_config* v4l2_subdev_fh::pad', at offset 1216 (in bits) at v4l2-subdev.h:910:1
  14 impacted interfaces

Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I0d1b931cbfbcfe938360f71d1d34ca6d10347bfb
2020-08-01 11:43:08 +02:00
Can Guo
80d85e5d97 scsi: ufs: Make sure clk scaling happens only when hba is runtime ACTIVE
If someone plays with the UFS clk scaling devfreq governor through sysfs,
ufshcd_devfreq_scale may be called even when hba is not runtime ACTIVE,
which can lead to unexpected error. We cannot just protect it by calling
pm_runtime_get_sync, because that may cause racing problem since hba
runtime suspend ops needs to suspend clk scaling. In order to fix it, call
pm_runtime_get_noresume and check hba's runtime status, then only proceed
if hba is runtime ACTIVE, otherwise just bail.

governor_store
 devfreq_performance_handler
  update_devfreq
   devfreq_set_target
    ufshcd_devfreq_target
     ufshcd_devfreq_scale

Change-Id: I1345985d50bcb239b7af008f7d295de3d7581112
Signed-off-by: Can Guo <cang@codeaurora.org>
2020-08-01 11:36:43 +08:00
qctecmdr
8380023f87 Merge "arm64: defconfig: Enabled download/reboot reason drivers for Lahaina" 2020-07-31 18:29:40 -07:00
Yue Ma
c4e9e0ada3 cnss2: Add support to remove WLAN recovery from SSR framework
WLAN driver and device can work independently from any other sub
systems so add the support to avoid using MSM SSR framework for
recovery. This can give more flexibility to enable recovery for
non-MSM platforms.

Change-Id: I0365163deee1ab213c6326b44761788a5f7a6a0d
Signed-off-by: Yue Ma <yuem@codeaurora.org>
2020-07-31 18:09:48 -07:00
Kishore Sri venkata Ganesh Bolisetty
02103dc49e soc: qcom: msm_perf: fix invalid usage of dev freq qos apis
msm_perf is attempting to add freq qos requests without waiting
for policy create notifications.
This may cause corruption at latter point of time when it
attempts to trigger freq qos update requests.
The changes registers for policy create notifications and
defers the add requests until dev freq is up.

Change-Id: Idee4268ded948062e627cc4dcdf85ceaf48e5ce7
Signed-off-by: Kishore Sri venkata Ganesh Bolisetty <bsrivenk@codeaurora.org>
2020-07-31 16:48:19 -07:00
Sureshnaidu Laveti
e4136a51c4 ABI: Update whitelist for arch timer
Update whitelist for arch_timer_read_counter
export symbol.

Change-Id: I274eede68d7d82d3ba9f30f2024974ddc7b00afa
Signed-off-by: Sureshnaidu Laveti <lsuresh@codeaurora.org>
2020-07-31 15:04:17 -07:00
Todd Kjos
59fd4b22d7 Revert "ANDROID: GKI: Enable CONFIG_USB_DWC3"
This reverts commit 91632070d0.

Reason for revert: Breaks downstream partners

Bug: 162570532
Change-Id: Ifa109eacbcd8da7b7e3ca93500957907451ce3f6
Signed-off-by: Todd Kjos <tkjos@google.com>
2020-07-31 19:09:17 +00:00
Greg Kroah-Hartman
fc1058d293 ANDROID: GKI: remove symbols from sunxi for uas driver
The driver is built into the kernel image, no need to list them here
anymore.

Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie270cf7edf65fe866712e71bf8c4932c1d6cb3f2
2020-07-31 18:48:41 +02:00
Greg Kroah-Hartman
169b93899c Linux 5.4.55
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:32 +02:00
Vladimir Oltean
909dbf09cd Revert "dpaa_eth: fix usage as DSA master, try 3"
This reverts commit 40a904b1c2.

The patch is not wrong, but the Fixes: tag is. It should have been:

	Fixes: 060ad66f9795 ("dpaa_eth: change DMA device")

which means that it's fixing a commit which was introduced in:

git tag --contains 060ad66f97954
v5.5

which then means it should have not been backported to linux-5.4.y,
where things _were_ working and now they're not.

Reported-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:32 +02:00
zhuguangqing
4918285a6c PM: wakeup: Show statistics for deleted wakeup sources again
commit e976eb4b91e906f20ec25b20c152d53c472fc3fd upstream.

After commit 00ee22c289 (PM / wakeup: Use seq_open() to show wakeup
stats), print_wakeup_source_stats(m, &deleted_ws) is not called from
wakeup_sources_stats_seq_show() any more.

Because deleted_ws is one of the wakeup sources, it should be shown
too, so add it to the end of all other wakeup sources.

Signed-off-by: zhuguangqing <zhuguangqing@xiaomi.com>
[ rjw: Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:32 +02:00
Peng Fan
59242fa1d2 regmap: debugfs: check count when read regmap file
commit 74edd08a4fbf51d65fd8f4c7d8289cd0f392bd91 upstream.

When executing the following command, we met kernel dump.
dmesg -c > /dev/null; cd /sys;
for i in `ls /sys/kernel/debug/regmap/* -d`; do
	echo "Checking regmap in $i";
	cat $i/registers;
done && grep -ri "0x02d0" *;

It is because the count value is too big, and kmalloc fails. So add an
upper bound check to allow max size `PAGE_SIZE << (MAX_ORDER - 1)`.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/1584064687-12964-1-git-send-email-peng.fan@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:32 +02:00
Kuniyuki Iwashima
df89c1ee03 udp: Improve load balancing for SO_REUSEPORT.
[ Upstream commit efc6b6f6c3113e8b203b9debfb72d81e0f3dcace ]

Currently, SO_REUSEPORT does not work well if connected sockets are in a
UDP reuseport group.

Then reuseport_has_conns() returns true and the result of
reuseport_select_sock() is discarded. Also, unconnected sockets have the
same score, hence only does the first unconnected socket in udp_hslot
always receive all packets sent to unconnected sockets.

So, the result of reuseport_select_sock() should be used for load
balancing.

The noteworthy point is that the unconnected sockets placed after
connected sockets in sock_reuseport.socks will receive more packets than
others because of the algorithm in reuseport_select_sock().

    index | connected | reciprocal_scale | result
    ---------------------------------------------
    0     | no        | 20%              | 40%
    1     | no        | 20%              | 20%
    2     | yes       | 20%              | 0%
    3     | no        | 20%              | 40%
    4     | yes       | 20%              | 0%

If most of the sockets are connected, this can be a problem, but it still
works better than now.

Fixes: acdcecc612 ("udp: correct reuseport selection with connected sockets")
CC: Willem de Bruijn <willemb@google.com>
Reviewed-by: Benjamin Herrenschmidt <benh@amazon.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:31 +02:00
Kuniyuki Iwashima
6735c126d2 udp: Copy has_conns in reuseport_grow().
[ Upstream commit f2b2c55e512879a05456eaf5de4d1ed2f7757509 ]

If an unconnected socket in a UDP reuseport group connect()s, has_conns is
set to 1. Then, when a packet is received, udp[46]_lib_lookup2() scans all
sockets in udp_hslot looking for the connected socket with the highest
score.

However, when the number of sockets bound to the port exceeds max_socks,
reuseport_grow() resets has_conns to 0. It can cause udp[46]_lib_lookup2()
to return without scanning all sockets, resulting in that packets sent to
connected sockets may be distributed to unconnected sockets.

Therefore, reuseport_grow() should copy has_conns.

Fixes: acdcecc612 ("udp: correct reuseport selection with connected sockets")
CC: Willem de Bruijn <willemb@google.com>
Reviewed-by: Benjamin Herrenschmidt <benh@amazon.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:31 +02:00
Xin Long
86512c6938 sctp: shrink stream outq when fails to do addstream reconf
[ Upstream commit 3ecdda3e9ad837cf9cb41b6faa11b1af3a5abc0c ]

When adding a stream with stream reconf, the new stream firstly is in
CLOSED state but new out chunks can still be enqueued. Then once gets
the confirmation from the peer, the state will change to OPEN.

However, if the peer denies, it needs to roll back the stream. But when
doing that, it only sets the stream outcnt back, and the chunks already
in the new stream don't get purged. It caused these chunks can still be
dequeued in sctp_outq_dequeue_data().

As its stream is still in CLOSE, the chunk will be enqueued to the head
again by sctp_outq_head_data(). This chunk will never be sent out, and
the chunks after it can never be dequeued. The assoc will be 'hung' in
a dead loop of sending this chunk.

To fix it, this patch is to purge these chunks already in the new
stream by calling sctp_stream_shrink_out() when failing to do the
addstream reconf.

Fixes: 11ae76e67a ("sctp: implement receiver-side procedures for the Reconf Response Parameter")
Reported-by: Ying Xu <yinxu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:31 +02:00
Xin Long
46e7c7efc3 sctp: shrink stream outq only when new outcnt < old outcnt
[ Upstream commit 8f13399db22f909a35735bf8ae2f932e0c8f0e30 ]

It's not necessary to go list_for_each for outq->out_chunk_list
when new outcnt >= old outcnt, as no chunk with higher sid than
new (outcnt - 1) exists in the outqueue.

While at it, also move the list_for_each code in a new function
sctp_stream_shrink_out(), which will be used in the next patch.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:31 +02:00
Dan Carpenter
bbf6af4a93 AX.25: Prevent integer overflows in connect and sendmsg
[ Upstream commit 17ad73e941b71f3bec7523ea4e9cbc3752461c2d ]

We recently added some bounds checking in ax25_connect() and
ax25_sendmsg() and we so we removed the AX25_MAX_DIGIS checks because
they were no longer required.

Unfortunately, I believe they are required to prevent integer overflows
so I have added them back.

Fixes: 8885bb0621f0 ("AX.25: Prevent out-of-bounds read in ax25_sendmsg()")
Fixes: 2f2a7ffad5c6 ("AX.25: Fix out-of-bounds read in ax25_connect()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:31 +02:00
Yuchung Cheng
182ffc6645 tcp: allow at most one TLP probe per flight
[ Upstream commit 76be93fc0702322179bb0ea87295d820ee46ad14 ]

Previously TLP may send multiple probes of new data in one
flight. This happens when the sender is cwnd limited. After the
initial TLP containing new data is sent, the sender receives another
ACK that acks partial inflight.  It may re-arm another TLP timer
to send more, if no further ACK returns before the next TLP timeout
(PTO) expires. The sender may send in theory a large amount of TLP
until send queue is depleted. This only happens if the sender sees
such irregular uncommon ACK pattern. But it is generally undesirable
behavior during congestion especially.

The original TLP design restrict only one TLP probe per inflight as
published in "Reducing Web Latency: the Virtue of Gentle Aggression",
SIGCOMM 2013. This patch changes TLP to send at most one probe
per inflight.

Note that if the sender is app-limited, TLP retransmits old data
and did not have this issue.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 18:39:31 +02:00