Commit graph

578207 commits

Author SHA1 Message Date
Eric Dumazet
29c1418082 tcp: fix use after free in tcp_xmit_retransmit_queue()
When tcp_sendmsg() allocates a fresh and empty skb, it puts it at the
tail of the write queue using tcp_add_write_queue_tail()

Then it attempts to copy user data into this fresh skb.

If the copy fails, we undo the work and remove the fresh skb.

Unfortunately, this undo lacks the change done to tp->highest_sack and
we can leave a dangling pointer (to a freed skb)

Later, tcp_xmit_retransmit_queue() can dereference this pointer and
access freed memory. For regular kernels where memory is not unmapped,
this might cause SACK bugs because tcp_highest_sack_seq() is buggy,
returning garbage instead of tp->snd_nxt, but with various debug
features like CONFIG_DEBUG_PAGEALLOC, this can crash the kernel.

This bug was found by Marco Grassi thanks to syzkaller.

Change-Id: Iba5975e360eb2b2729b6f958b7cb00bfc469e51b
Fixes: 6859d49475 ("[TCP]: Abstract tp->highest_sack accessing & point to next skb")
Reported-by: Marco Grassi <marco.gra@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
Git-commit: bb1fceca22492109be12640d49f5ea5a544c6bb4
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
2016-11-18 16:41:19 -08:00
Vegard Nossum
44e1cd2173 block: fix use-after-free in seq file
I got a KASAN report of use-after-free:

    ==================================================================
    BUG: KASAN: use-after-free in klist_iter_exit+0x61/0x70 at addr ffff8800b6581508
    Read of size 8 by task trinity-c1/315
    =============================================================================
    BUG kmalloc-32 (Not tainted): kasan: bad access detected
    -----------------------------------------------------------------------------

    Disabling lock debugging due to kernel taint
    INFO: Allocated in disk_seqf_start+0x66/0x110 age=144 cpu=1 pid=315
            ___slab_alloc+0x4f1/0x520
            __slab_alloc.isra.58+0x56/0x80
            kmem_cache_alloc_trace+0x260/0x2a0
            disk_seqf_start+0x66/0x110
            traverse+0x176/0x860
            seq_read+0x7e3/0x11a0
            proc_reg_read+0xbc/0x180
            do_loop_readv_writev+0x134/0x210
            do_readv_writev+0x565/0x660
            vfs_readv+0x67/0xa0
            do_preadv+0x126/0x170
            SyS_preadv+0xc/0x10
            do_syscall_64+0x1a1/0x460
            return_from_SYSCALL_64+0x0/0x6a
    INFO: Freed in disk_seqf_stop+0x42/0x50 age=160 cpu=1 pid=315
            __slab_free+0x17a/0x2c0
            kfree+0x20a/0x220
            disk_seqf_stop+0x42/0x50
            traverse+0x3b5/0x860
            seq_read+0x7e3/0x11a0
            proc_reg_read+0xbc/0x180
            do_loop_readv_writev+0x134/0x210
            do_readv_writev+0x565/0x660
            vfs_readv+0x67/0xa0
            do_preadv+0x126/0x170
            SyS_preadv+0xc/0x10
            do_syscall_64+0x1a1/0x460
            return_from_SYSCALL_64+0x0/0x6a

    CPU: 1 PID: 315 Comm: trinity-c1 Tainted: G    B           4.7.0+ #62
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
     ffffea0002d96000 ffff880119b9f918 ffffffff81d6ce81 ffff88011a804480
     ffff8800b6581500 ffff880119b9f948 ffffffff8146c7bd ffff88011a804480
     ffffea0002d96000 ffff8800b6581500 fffffffffffffff4 ffff880119b9f970
    Call Trace:
     [<ffffffff81d6ce81>] dump_stack+0x65/0x84
     [<ffffffff8146c7bd>] print_trailer+0x10d/0x1a0
     [<ffffffff814704ff>] object_err+0x2f/0x40
     [<ffffffff814754d1>] kasan_report_error+0x221/0x520
     [<ffffffff8147590e>] __asan_report_load8_noabort+0x3e/0x40
     [<ffffffff83888161>] klist_iter_exit+0x61/0x70
     [<ffffffff82404389>] class_dev_iter_exit+0x9/0x10
     [<ffffffff81d2e8ea>] disk_seqf_stop+0x3a/0x50
     [<ffffffff8151f812>] seq_read+0x4b2/0x11a0
     [<ffffffff815f8fdc>] proc_reg_read+0xbc/0x180
     [<ffffffff814b24e4>] do_loop_readv_writev+0x134/0x210
     [<ffffffff814b4c45>] do_readv_writev+0x565/0x660
     [<ffffffff814b8a17>] vfs_readv+0x67/0xa0
     [<ffffffff814b8de6>] do_preadv+0x126/0x170
     [<ffffffff814b92ec>] SyS_preadv+0xc/0x10

This problem can occur in the following situation:

open()
 - pread()
    - .seq_start()
       - iter = kmalloc() // succeeds
       - seqf->private = iter
    - .seq_stop()
       - kfree(seqf->private)
 - pread()
    - .seq_start()
       - iter = kmalloc() // fails
    - .seq_stop()
       - class_dev_iter_exit(seqf->private) // boom! old pointer

As the comment in disk_seqf_stop() says, stop is called even if start
failed, so we need to reinitialise the private pointer to NULL when seq
iteration stops.

An alternative would be to set the private pointer to NULL when the
kmalloc() in disk_seqf_start() fails.

Change-Id: Ia3c791c6cf81a6c156561106230cbf5e8dfad0bc
Cc: stable@vger.kernel.org
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git
Git-commit: 77da160530dd1dc94f6ae15a981f24e5f0021e84
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
2016-11-18 16:39:10 -08:00
Vijayavardhan Vennapusa
beafbd43d5 USB: gagget: f_fs: Return error if TX req is queued during device offline
when USB cable is disconnected during TX data transfers, endpoints will
be disabled during function disable. If userspace client tries to queue
requests on disabled endpoints, driver will wait till endpoints are
enabled and then queues previous session requests. This results in kernel
driver and userspace driver out of sync and due to this, stall will be
seen. Hence fix this issue by returning error value if client tries to
queue requests on TX endpoint during device offline.

CRs-Fixed: 633497
Change-Id: I3e43b8a704367aff7fe8dd88159315aef811c51c
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-11-18 16:09:57 -08:00
Service qcabuildsw
42939d0685 Merge "msm: wlan: update regulatory database" into msm-4.4 2016-11-18 15:41:21 -08:00
Olav Haugan
704e5bfc25 sched: Ensure proper synch between isolation, hotplug, and suspend
Isolation code needs to be synchronized with both hotplug and suspend.
Ensure this by taking the lock that is taken by both paths and ensure
hotplug notifiers are processed for suspend/resume.

Change-Id: I663588cfd2f9e3972b9adc1a10887ef36cd70c57
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2016-11-18 14:04:39 -08:00
Ashay Jaiswal
206b28bea6 ARM: dts: msm: add charger/fg device nodes for PMFALCON
Add charger/FG device nodes along with the necessary
configuration.
Keep all these nodes disabled for simulator/RUMI platform.

CRs-fixed: 1091731
Change-Id: I9c751d777d8402cdea3cdfb27da1a19a98a250e2
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2016-11-18 18:49:03 +05:30
Johannes Berg
3b64a0127c cfg80211: validate beacon int as part of iface combinations
Remove the pointless checking against interface combinations in
the initial basic beacon interval validation, that currently isn't
taking into account radar detection or channels properly. Instead,
just validate the basic range there, and then delay real checking
to the interface combination validation that drivers must do.

This means that drivers wanting to use the beacon_int_min_gcd will
now have to pass the new_beacon_int when validating the AP/mesh
start.

CRs-Fixed: 1087922
Change-Id: Iec536bcdf4ed95e3d796324fd8bf5df259b340b0
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Git-commit: 4c8dea638c16141adb046fd2e0cab51dfe43650c
[liord@codeaurora.org: Fix conflicts]
Signed-off-by: Lior David <liord@codeaurora.org>
2016-11-18 14:16:44 +02:00
Johannes Berg
54afc7997e cfg80211: fix beacon interval in interface combination iteration
We shouldn't abort the iteration with an error when one of the
potential combinations can't accomodate the beacon interval
request, we should just skip that particular combination. Fix
the code to do so.

CRs-Fixed: 1087922
Change-Id: Ib1ae7221291b8176d61d58e756a3814c80d98d27
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Git-commit: 0507a3ac6e98f50583912ec78d07c2e4daaf2b28
[liord@codeaurora.org: cherry-pick without changes]
Signed-off-by: Lior David <liord@codeaurora.org>
2016-11-18 14:15:29 +02:00
Purushottam Kushwaha
9a27bdb53f cfg80211: identically validate beacon interval for AP/MESH/IBSS
Beacon interval interface combinations validation was missing
for MESH/IBSS join, add those.

Johannes: also move the beacon interval check disallowing really
tiny and really big intervals into the common function, which
adds it for AP mode.

CRs-Fixed: 1087922
Change-Id: I282300533dcd80f65c9ba366246d028a6130ffff
Signed-off-by: Purushottam Kushwaha <pkushwah@qti.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Git-commit: 12d20fc9186a742d40e824f575df5aa62be31d69
[liord@codeaurora.org: fix conflicts and trivial compile errors]
Signed-off-by: Lior David <liord@codeaurora.org>
2016-11-18 14:13:42 +02:00
Linux Build Service Account
2f088241d7 Merge "msm: kgsl: Make sure USE_CPU_MAP + MAP_USER_MEM work together" 2016-11-18 01:55:04 -08:00
Linux Build Service Account
efcb7b1d55 Merge "msm: kgsl: Fix pagetable member of struct kgsl_memdesc" 2016-11-18 01:55:03 -08:00
Linux Build Service Account
c10fa02a2e Merge "ARM: dts: msm: Enable auto GM for WLED in pmicobalt" 2016-11-18 01:55:01 -08:00
Linux Build Service Account
7ee7f710ec Merge "leds: qpnp-wled: Add support to configure auto PFM for pmicobalt" 2016-11-18 01:55:01 -08:00
Linux Build Service Account
a708ddf420 Merge "msm: ipa3: linearize large skbs" 2016-11-18 01:55:00 -08:00
Linux Build Service Account
dc3c5f14a2 Merge "msm: mdss: hide additional kernel addresses from unprivileged users" 2016-11-18 01:54:59 -08:00
Linux Build Service Account
6f4c99dfce Merge "ASoC: msm: Fix sound card registration failure" 2016-11-18 01:54:58 -08:00
Linux Build Service Account
b140cb0936 Merge "msm: sde: remove secure camera ctrl_id definition" 2016-11-18 01:54:57 -08:00
Linux Build Service Account
0bdfb6133f Merge "ARM: dts: msm: Add ufs regulators for msmfalcon interposer" 2016-11-18 01:54:57 -08:00
Linux Build Service Account
072148d62f Merge "usb: pd: Stop processing SVDM if handler found" 2016-11-18 01:54:56 -08:00
Linux Build Service Account
54e5bae2ed Merge "sched/hmp: Enhance co-location and scheduler boost features" 2016-11-18 01:54:54 -08:00
Linux Build Service Account
d1a64e4014 Merge "USB: Allow skipping device resume during system resume" 2016-11-18 01:54:53 -08:00
Linux Build Service Account
a8277a5b93 Merge "clk: msm: Add the CLKFLAG_NO_RATE_CACHE flag for MM clocks on MSM COBALT" 2016-11-18 01:54:52 -08:00
Linux Build Service Account
69fe3ef296 Merge "clk: qcom: Add support to be able to slew PLL" 2016-11-18 01:54:52 -08:00
Linux Build Service Account
73542728de Merge "qseecom: improve error checks in qseecom_probe()" 2016-11-18 01:54:51 -08:00
Linux Build Service Account
473a3d597b Merge "msm: mdss: Add systrace for readptr_done" 2016-11-18 01:54:50 -08:00
Linux Build Service Account
54f38dfe87 Merge "ARM: dts: msm: Add physical dimensions for NT35597 panel" 2016-11-18 01:54:49 -08:00
Linux Build Service Account
2ddc39e634 Merge "msm: mdss: fix incorrect mutex unlocking during NOTIFY_UPDATE_STOP" 2016-11-18 01:54:48 -08:00
Linux Build Service Account
db18e6f95e Merge "msm: mdss: fix race condition in dsi clk off request" 2016-11-18 01:54:46 -08:00
Linux Build Service Account
07d79c7409 Merge "ARM: dts: msm: specify I2C configuration for msmfalcon" 2016-11-18 01:54:45 -08:00
Linux Build Service Account
24adf86dfa Merge "ARM: dts: msm: specify UART configuration on msmfalcon." 2016-11-18 01:54:45 -08:00
Linux Build Service Account
0956d6dd49 Merge "clk: qcom: Add support for debugfs support" 2016-11-18 01:54:43 -08:00
Linux Build Service Account
5d4d0ab7a7 Merge "clk: Add support to allow client to print all enabled clocks" 2016-11-18 01:54:42 -08:00
Linux Build Service Account
29674d7418 Merge "scsi: ufs: enable auto hibern8 only after device initialization" 2016-11-18 01:54:41 -08:00
Linux Build Service Account
0f04e7c48a Merge "scsi: ufs: fix sleep in atomic context" 2016-11-18 01:54:40 -08:00
Linux Build Service Account
94410a85f4 Merge "phy: qcom-ufs: update ufs phy 1-lane settings" 2016-11-18 01:54:36 -08:00
Linux Build Service Account
bf1c2c6407 Merge "diag: Set the diag write buffers to busy state on channel close" 2016-11-18 01:54:35 -08:00
xiaonian
6e4116a679 ARM: dts: msm: change UFS/SDHC2 power supply for msmcobalt interposer QRD
Change the power supply for msmcobalt QRD interposer platform
to use regulators from pmfalcon.

CRs-Fixed: 1090535
Change-Id: Ib1fdb0454c6e1d770ea6ec11a6032f8553d56c06
Signed-off-by: xiaonian <xiaonian@codeaurora.org>
2016-11-18 16:55:53 +08:00
Deepak Kushwah
e4216c500a ARM: dts: msm: Add venus device nodes for starlord
Add venus device nodes to support hardware accelerated
video codecs for starlord.

CRs-Fixed: 1088324
Change-Id: I2e8ffab214106c01557446e00dbebe2cc2a52bd1
Signed-off-by: Deepak Kushwah <dkushwah@codeaurora.org>
2016-11-17 22:18:04 -08:00
Ashish Garg
4f161b67ae ARM: dts: msm: enable mdss power supplies for falcon track3
Specify the regulators for mdss on falcon track3.

Change-Id: Ie828c8568ef09c89cff157d16d3cb322647b6f6e
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
2016-11-18 10:16:41 +05:30
Anirudh Ghayal
323102d378 ARM: dts: msm: Add dummy regulator for LCDB bias
Add the LDO and NCP display +ve and -ve bias for LCD
display.

Change-Id: Ia85688854f26fe871d5c1253c2d51d75d84deb8f
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2016-11-18 10:15:22 +05:30
Linux Build Service Account
9adece3859 Promotion of kernel.lnx.4.4-161117.
CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1087423   I20a04c766e55c75db15662e9a13e20396b35f30e   msm: sde: Fix SDE rotator context list locking
1079648   I2ebdc0c41c521e56a400d685b6254174cffdc14b   msm: cpp: Use the src clock node to read the cpp src clo
1088608   I9c014261f5e25b3ec4585747d324ea2cb6ab18fb   icnss: Collect ramdump from MSA memory space
1079648   I436ad7fca01e599714f1bcb0abc06e5bc1165350   ARM: dts: msm: Add cpp src clock rates configuration for
1081738   Ibaa555cec8cfd296125af3e6277df5331f5c438b   leds: qpnp-wled: Add support to configure VREF_CONTROL f
1082787   I8c8bcf9da42668f3964b4dffcbc1b15465ea8018   icnss: Update WLFW header file to the latest and add fw_

Change-Id: If91f3f1170ebb92da7041b4b819c751f04474f1c
CRs-Fixed: 1088608, 1082787, 1087423, 1079648, 1081738
2016-11-17 21:17:41 -07:00
Chandana Kishori Chiluveru
291a7d133e ARM: dts: msm: Add support for USB device for msmfalcon and msmtriton
Add common dtsi file for msmfalcon and msmtriton. Also Add
device tree entry for super speed USB3 controller, super speed
phy and high speed phy.

Change-Id: I326eceeddff8e77d346c3365fa46cd539324451f
Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
2016-11-17 19:53:16 -08:00
Jack Pham
d96857fbff usb: pd: Don't suspend charging unless changing voltages
To optimize charging during power negotiation and the voltage
is not changing, for example when transitioning from implicit
contract to the default 5V PDO, there is no requirement to
suspend the charging and hence setting the charger's
PROP_PD_CURRENT_MAX can be avoided. It is only needed when
changing voltages, in which case current limit should be
calculated based on pSnkStdby (2.5W), or when staying at the
same voltage and decreasing current.

Also fix the incorrect setting of PROP_CURRENT_MAX to
PROP_PD_CURRENT_MAX when doing a sink->source swap.

Change-Id: Ib53902459646e590df4dc7fcb00f833d5e8f41ed
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-17 15:42:35 -08:00
Johannes Berg
ed8559eaeb cfg80211: make wdev_list accessible to drivers
There's no harm in having drivers read the list, since they can
use RCU protection or RTNL locking; allow this to not require
each and every driver to also implement its own bookkeeping.

CRs-Fixed: 1087922
Change-Id: I2f38b8ba1ddbe6041a4189f5d9b72c982f0fb367
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Git-commit: 53873f134d285191ef6435882d55837093a36c53
[liord@codeaurora.org: fix conflicts]
Signed-off-by: Lior David <liord@codeaurora.org>
2016-11-18 01:20:15 +02:00
Siddartha Mohanadoss
1f2e772d9c iio: rradc: Update reading USBIN_V channel
Increase the refresh rate for the RRADC to support
reading refreshed USBIN voltage at a higher frequency.
To support the higher frequency at which the data
is refreshed enable continuous mode and force update
on reading every cycle on the USBIN_V trigger.
After reading the USBIN_V result set the RRADC to non
continuous mode with default trigger setting.

Change-Id: I7e9ada5de1f619c6a34a4b2e1764f5e908564ce5
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2016-11-17 15:08:05 -08:00
Yuanyuan Liu
c576ff4ddf icnss: Reset mpm_wcssaon_config bits before top level reset
Clear mpm_wcssaon_config bits before top level reset.
If those bits are non-zero during WLAN is enabled,
there could be random failures.

CRs-Fixed: 1086372
Change-Id: Ia03380dfa4852c80fedb38f3c79f55d8d1a9a7f6
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2016-11-17 14:01:08 -08:00
Harry Yang
fbff4fcc80 qcom-charger: smb2: Disable try.SINK mode in the probe
Currently we disable try.SINK right before pd becomes active and
re-enable it right after inactive. This breaks typec compliance.

To fix it, disable try.SINK mode in the probe and never enable it.

Change-Id: I61523188f45daca026b90943c845b43a8327f51e
Signed-off-by: Harry Yang <harryy@codeaurora.org>
2016-11-17 13:28:59 -08:00
Harry Yang
73337d532d qcom-charger: Change usb_icl votable for PD vote
Currently there is an issue introduced by forcing the results of
the icl_votable while pd is active. icl_votable is a min voter
and since the DEFAULT_VOTER votes 1.5Amps that becomes the max
one could draw when pd is active. This is incorrect and hence the
issue.

Note that DEFAULT_VOTER is only needed while DCP is present.

So, to fix it, rename DEFAULT_VOTER to DCP_VOTER and make DCP_VOTER
unvote and vote when pd_active is set and unset respectively.

CRs-Fixed: 1091477
Change-Id: I7435f05f20e12a7704ae5d9597b5cdc9b5a61d00
Signed-off-by: Harry Yang <harryy@codeaurora.org>
2016-11-17 13:28:58 -08:00
Amar Singhal
1a8e292bce msm: wlan: update regulatory database
Incorporate the 2016-10-31 updates to the internal regulatory
database. Update countries Bahrain, Belize, Chile, Egypt, Honduras,
India, S Korea, Nepal, Panama, Russia, Senegal, TT and UAE. Also
update St. Kitts&Navis and St. Lucia dfs region.

Change-Id: Ia151b2dd5229f07790ac961af298305b24e098fb
CRs-Fixed: 1091511
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
2016-11-17 12:19:51 -08:00
Mohamed Moussa
0eed236e78 ARM: dts: msm: Add DT for mediabox variant of apqcobalt
Device tree creation of new mediabox variant of
apqcobalt.

CRs-Fixed: 1091110
Change-Id: I4f8070e7fd0aa39664208cfab2448b5a95ab2326
Signed-off-by: Mohamed Moussa <mmouss@codeaurora.org>
Signed-off-by: David Ng <dave@codeaurora.org>
2016-11-17 10:52:52 -08:00