Commit Graph

444044 Commits

Author SHA1 Message Date
LuK1337 f525b5edb1 Import T713XXU2BQD3 kernel source changes
Change-Id: I9897a6d702844ebd56458d82d5b7be87ab5a907b
2017-07-01 12:51:07 +02:00
Theodore Ts'o b964607f1f ext4: fix fencepost in s_first_meta_bg validation
commit 2ba3e6e8afc9b6188b471f27cf2b5e3cf34e7af2 upstream.

It is OK for s_first_meta_bg to be equal to the number of block group
descriptor blocks.  (It rarely happens, but it shouldn't cause any
problems.)

https://bugzilla.kernel.org/show_bug.cgi?id=194567

Fixes: 3a4b77cd47bb837b8557595ec7425f281f2ca1fe
Fixes: ext4: validate s_first_meta_bg at mount time
Change-Id: I401a32cc3fca59e08dd578b0e43c0429e17bd673
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2017-06-22 10:19:05 +00:00
syphyr 3c1f3051da ext4: fix condition of validate s_first_meta_bg
Fixes: ext4: validate s_first_meta_bg at mount time

Change-Id: Iea0fb0df71502c5578c3c96e992d6cc78842ca7e
2017-06-22 10:18:49 +00:00
Abhishek Singh f9b8387a82 qcacld-2.0: Enable cfg80211 layer to control power save
prima to qcacld-2.0 propagation

In PS non-offload case the "remainInPowerActiveTillDHCP" flag
allows cfg80211 layer to control BMPS and it should not be modified
by SME/CSR. SME/CSR use remainInPowerActiveTillDHCP to block BMPS
till set key is not completed. Due to this cfg80211 layer is not
in full control of BMPS.

To fix this add a new variable to block BMPS until set key is
done and let remainInPowerActiveTillDHCP be be controlled by
cfg80211 layer based on whether DHCP in progress or not.

Change-Id: I48315893a881d8da4db79a8b9366525617e8c898
CRs-Fixed: 1072635
2017-06-22 10:18:46 +00:00
David S. Miller 2a117c0c05 ipv6: Check ip6_find_1stfragopt() return value properly.
commit 7dd7eb9513bd02184d45f000ab69d78cb1fa1531 upstream.

Do not use unsigned variables to see if it returns a negative
error or not.

Fixes: 2423496af35d ("ipv6: Prevent overrun when parsing v6 header options")
Change-Id: Ib68fdb197391f1f5f14128741ac033079dccf644
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2017-06-22 10:18:42 +00:00
Eric Dumazet bb796aef76 ping: implement proper locking
commit 43a6684519ab0a6c52024b5e25322476cabad893 upstream.

We got a report of yet another bug in ping

http://www.openwall.com/lists/oss-security/2017/03/24/6

->disconnect() is not called with socket lock held.

Fix this by acquiring ping rwlock earlier.

Thanks to Daniel, Alexander and Andrey for letting us know this problem.

Fixes: c319b4d76b ("net: ipv4: add IPPROTO_ICMP socket kind")
Change-Id: Ia0694904e67dd9d31a08fcadfacfd1feaacc3cd2
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Daniel Jiang <danieljiang0415@gmail.com>
Reported-by: Solar Designer <solar@openwall.com>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-22 10:18:36 +00:00
Sreelakshmi Konamki 2f75fdd95e qcacld-2.0: Update correct msg length in oemData_SendMBOemDataReq API
In oemData_SendMBOemDataReq(), messageLen of struct 'tSirOemDataReq'
is updated with more memory than allocated to the structure.

Fix is to update messageLen with size of struct.

Change-Id: Ib60fd07543f630985fe29427809d822275bbb8e0
CRs-Fixed: 1069175
2017-06-22 10:18:33 +00:00
LuK1337 4664546f2b arch/arm64: configs: Add gts210velte & gts28velte defconfigs
Change-Id: Icec8b149a5589d3dde0d6301c20934397d2790d4
2017-06-16 23:14:24 +02:00
LuK1337 62829e8978 Merge tag 'LA.BR.1.3.6-04010-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-04010-8976.0"

Change-Id: If446d01e5305f2e7b268b761d214305e35e2ce18
2017-06-09 23:21:11 +02:00
Bharat Pawar 9e2bde7279 Revert "Revert "ARM: dts: msm: update memory map for msm8976/8956/8952 for External release""
This reverts commit 376499ac27.

Change-Id: I68fa86c047a8aef975dcf349d4dc4e8da83f07c5
Signed-off-by: Bharat Pawar <bpawar@codeaurora.org>
2017-06-07 09:58:33 -07:00
Eric Dumazet 7ea1eb900b sctp: do not inherit ipv6_{mc|ac|fl}_list from parent
SCTP needs fixes similar to 83eaddab4378 ("ipv6/dccp: do not inherit
ipv6_mc_list from parent"), otherwise bad things can happen.

Change-Id: I4ab6f39f225bd9e68b54eaec023ad737bbc6c14a
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-07 12:31:05 +02:00
Craig Gallek 7d3f424153 ipv6: Prevent overrun when parsing v6 header options
The KASAN warning repoted below was discovered with a syzkaller
program.  The reproducer is basically:
  int s = socket(AF_INET6, SOCK_RAW, NEXTHDR_HOP);
  send(s, &one_byte_of_data, 1, MSG_MORE);
  send(s, &more_than_mtu_bytes_data, 2000, 0);

The socket() call sets the nexthdr field of the v6 header to
NEXTHDR_HOP, the first send call primes the payload with a non zero
byte of data, and the second send call triggers the fragmentation path.

The fragmentation code tries to parse the header options in order
to figure out where to insert the fragment option.  Since nexthdr points
to an invalid option, the calculation of the size of the network header
can made to be much larger than the linear section of the skb and data
is read outside of it.

This fix makes ip6_find_1stfrag return an error if it detects
running out-of-bounds.

[   42.361487] ==================================================================
[   42.364412] BUG: KASAN: slab-out-of-bounds in ip6_fragment+0x11c8/0x3730
[   42.365471] Read of size 840 at addr ffff88000969e798 by task ip6_fragment-oo/3789
[   42.366469]
[   42.366696] CPU: 1 PID: 3789 Comm: ip6_fragment-oo Not tainted 4.11.0+ #41
[   42.367628] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 04/01/2014
[   42.368824] Call Trace:
[   42.369183]  dump_stack+0xb3/0x10b
[   42.369664]  print_address_description+0x73/0x290
[   42.370325]  kasan_report+0x252/0x370
[   42.370839]  ? ip6_fragment+0x11c8/0x3730
[   42.371396]  check_memory_region+0x13c/0x1a0
[   42.371978]  memcpy+0x23/0x50
[   42.372395]  ip6_fragment+0x11c8/0x3730
[   42.372920]  ? nf_ct_expect_unregister_notifier+0x110/0x110
[   42.373681]  ? ip6_copy_metadata+0x7f0/0x7f0
[   42.374263]  ? ip6_forward+0x2e30/0x2e30
[   42.374803]  ip6_finish_output+0x584/0x990
[   42.375350]  ip6_output+0x1b7/0x690
[   42.375836]  ? ip6_finish_output+0x990/0x990
[   42.376411]  ? ip6_fragment+0x3730/0x3730
[   42.376968]  ip6_local_out+0x95/0x160
[   42.377471]  ip6_send_skb+0xa1/0x330
[   42.377969]  ip6_push_pending_frames+0xb3/0xe0
[   42.378589]  rawv6_sendmsg+0x2051/0x2db0
[   42.379129]  ? rawv6_bind+0x8b0/0x8b0
[   42.379633]  ? _copy_from_user+0x84/0xe0
[   42.380193]  ? debug_check_no_locks_freed+0x290/0x290
[   42.380878]  ? ___sys_sendmsg+0x162/0x930
[   42.381427]  ? rcu_read_lock_sched_held+0xa3/0x120
[   42.382074]  ? sock_has_perm+0x1f6/0x290
[   42.382614]  ? ___sys_sendmsg+0x167/0x930
[   42.383173]  ? lock_downgrade+0x660/0x660
[   42.383727]  inet_sendmsg+0x123/0x500
[   42.384226]  ? inet_sendmsg+0x123/0x500
[   42.384748]  ? inet_recvmsg+0x540/0x540
[   42.385263]  sock_sendmsg+0xca/0x110
[   42.385758]  SYSC_sendto+0x217/0x380
[   42.386249]  ? SYSC_connect+0x310/0x310
[   42.386783]  ? __might_fault+0x110/0x1d0
[   42.387324]  ? lock_downgrade+0x660/0x660
[   42.387880]  ? __fget_light+0xa1/0x1f0
[   42.388403]  ? __fdget+0x18/0x20
[   42.388851]  ? sock_common_setsockopt+0x95/0xd0
[   42.389472]  ? SyS_setsockopt+0x17f/0x260
[   42.390021]  ? entry_SYSCALL_64_fastpath+0x5/0xbe
[   42.390650]  SyS_sendto+0x40/0x50
[   42.391103]  entry_SYSCALL_64_fastpath+0x1f/0xbe
[   42.391731] RIP: 0033:0x7fbbb711e383
[   42.392217] RSP: 002b:00007ffff4d34f28 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
[   42.393235] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbbb711e383
[   42.394195] RDX: 0000000000001000 RSI: 00007ffff4d34f60 RDI: 0000000000000003
[   42.395145] RBP: 0000000000000046 R08: 00007ffff4d34f40 R09: 0000000000000018
[   42.396056] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000400aad
[   42.396598] R13: 0000000000000066 R14: 00007ffff4d34ee0 R15: 00007fbbb717af00
[   42.397257]
[   42.397411] Allocated by task 3789:
[   42.397702]  save_stack_trace+0x16/0x20
[   42.398005]  save_stack+0x46/0xd0
[   42.398267]  kasan_kmalloc+0xad/0xe0
[   42.398548]  kasan_slab_alloc+0x12/0x20
[   42.398848]  __kmalloc_node_track_caller+0xcb/0x380
[   42.399224]  __kmalloc_reserve.isra.32+0x41/0xe0
[   42.399654]  __alloc_skb+0xf8/0x580
[   42.400003]  sock_wmalloc+0xab/0xf0
[   42.400346]  __ip6_append_data.isra.41+0x2472/0x33d0
[   42.400813]  ip6_append_data+0x1a8/0x2f0
[   42.401122]  rawv6_sendmsg+0x11ee/0x2db0
[   42.401505]  inet_sendmsg+0x123/0x500
[   42.401860]  sock_sendmsg+0xca/0x110
[   42.402209]  ___sys_sendmsg+0x7cb/0x930
[   42.402582]  __sys_sendmsg+0xd9/0x190
[   42.402941]  SyS_sendmsg+0x2d/0x50
[   42.403273]  entry_SYSCALL_64_fastpath+0x1f/0xbe
[   42.403718]
[   42.403871] Freed by task 1794:
[   42.404146]  save_stack_trace+0x16/0x20
[   42.404515]  save_stack+0x46/0xd0
[   42.404827]  kasan_slab_free+0x72/0xc0
[   42.405167]  kfree+0xe8/0x2b0
[   42.405462]  skb_free_head+0x74/0xb0
[   42.405806]  skb_release_data+0x30e/0x3a0
[   42.406198]  skb_release_all+0x4a/0x60
[   42.406563]  consume_skb+0x113/0x2e0
[   42.406910]  skb_free_datagram+0x1a/0xe0
[   42.407288]  netlink_recvmsg+0x60d/0xe40
[   42.407667]  sock_recvmsg+0xd7/0x110
[   42.408022]  ___sys_recvmsg+0x25c/0x580
[   42.408395]  __sys_recvmsg+0xd6/0x190
[   42.408753]  SyS_recvmsg+0x2d/0x50
[   42.409086]  entry_SYSCALL_64_fastpath+0x1f/0xbe
[   42.409513]
[   42.409665] The buggy address belongs to the object at ffff88000969e780
[   42.409665]  which belongs to the cache kmalloc-512 of size 512
[   42.410846] The buggy address is located 24 bytes inside of
[   42.410846]  512-byte region [ffff88000969e780, ffff88000969e980)
[   42.411941] The buggy address belongs to the page:
[   42.412405] page:ffffea000025a780 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
[   42.413298] flags: 0x100000000008100(slab|head)
[   42.413729] raw: 0100000000008100 0000000000000000 0000000000000000 00000001800c000c
[   42.414387] raw: ffffea00002a9500 0000000900000007 ffff88000c401280 0000000000000000
[   42.415074] page dumped because: kasan: bad access detected
[   42.415604]
[   42.415757] Memory state around the buggy address:
[   42.416222]  ffff88000969e880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   42.416904]  ffff88000969e900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   42.417591] >ffff88000969e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   42.418273]                    ^
[   42.418588]  ffff88000969ea00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   42.419273]  ffff88000969ea80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   42.419882] ==================================================================

Change-Id: Ie92389967e2f4168b00120fe86201e02916c098b
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Craig Gallek <kraig@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-07 12:31:04 +02:00
Linux Build Service Account aa442f2bb2 Merge AU_LINUX_ANDROID_LA.BR.1.3.6_RB1.07.01.02.255.039 on remote branch
Change-Id: If99bd16f401f5578bfc9d7d2248d2cbf1af380d7
2017-06-06 05:15:04 -07:00
Eric Dumazet 26216d6730 ipv6: fix out of bound writes in __ip6_append_data()
Andrey Konovalov and idaifish@gmail.com reported crashes caused by
one skb shared_info being overwritten from __ip6_append_data()

Andrey program lead to following state :

copy -4200 datalen 2000 fraglen 2040
maxfraglen 2040 alloclen 2048 transhdrlen 0 offset 0 fraggap 6200

The skb_copy_and_csum_bits(skb_prev, maxfraglen, data + transhdrlen,
fraggap, 0); is overwriting skb->head and skb_shared_info

Since we apparently detect this rare condition too late, move the
code earlier to even avoid allocating skb and risking crashes.

Once again, many thanks to Andrey and syzkaller team.

Change-Id: Ie338b060f4b446f3d9784bb17e5f1bf829dfb6de
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Reported-by: <idaifish@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-02 01:18:35 +02:00
WANG Cong 105e5f5164 ipv6/dccp: do not inherit ipv6_mc_list from parent
Like commit 657831ffc38e ("dccp/tcp: do not inherit mc_list from parent")
we should clear ipv6_mc_list etc. for IPv6 sockets too.

Change-Id: If8dc0cefa694a73589b6599b63d2c5c7c4d1c0aa
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-02 01:18:34 +02:00
Jan Kara c33b5230df ext4: fix data exposure after a crash
Huang has reported that in his powerfail testing he is seeing stale
block contents in some of recently allocated blocks although he mounts
ext4 in data=ordered mode. After some investigation I have found out
that indeed when delayed allocation is used, we don't add inode to
transaction's list of inodes needing flushing before commit. Originally
we were doing that but commit f3b59291a6 removed the logic with a
flawed argument that it is not needed.

The problem is that although for delayed allocated blocks we write their
contents immediately after allocating them, there is no guarantee that
the IO scheduler or device doesn't reorder things and thus transaction
allocating blocks and attaching them to inode can reach stable storage
before actual block contents. Actually whenever we attach freshly
allocated blocks to inode using a written extent, we should add inode to
transaction's ordered inode list to make sure we properly wait for block
contents to be written before committing the transaction. So that is
what we do in this patch. This also handles other cases where stale data
exposure was possible - like filling hole via mmap in
data=ordered,nodelalloc mode.

The only exception to the above rule are extending direct IO writes where
blkdev_direct_IO() waits for IO to complete before increasing i_size and
thus stale data exposure is not possible. For now we don't complicate
the code with optimizing this special case since the overhead is pretty
low. In case this is observed to be a performance problem we can always
handle it using a special flag to ext4_map_blocks().

Change-Id: I3d2d79f0f6743159481f80fc10faf042a18927f1
CC: stable@vger.kernel.org
Fixes: f3b59291a6
Reported-by: "HUANG Weller (CM/ESW12-CN)" <Weller.Huang@cn.bosch.com>
Tested-by: "HUANG Weller (CM/ESW12-CN)" <Weller.Huang@cn.bosch.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-06-02 01:18:33 +02:00
Linux Build Service Account b4dca19c78 Merge "msm: camera: Prevent info leak in kernel driver." 2017-05-31 18:44:46 -07:00
Linux Build Service Account 5d174a5a33 Merge "diag: Add proper synchronization checks to msg mask table" 2017-05-31 18:44:46 -07:00
Linux Build Service Account 251b7fcbfa Merge "msm: msm_bus: Add mutex to protect node_list" 2017-05-31 12:55:16 -07:00
VijayaKumar T M c3fe5bc184 msm: camera: Prevent info leak in kernel driver.
-Use %pK for kernel address to avoid the information leak.

CRs-Fixed: 2009672
Change-Id: Ib0631d5578aba033510babe4f43e2a63bb959747
Signed-off-by: Alok Kediya <kediya@codeaurora.org>
Signed-off-by: VijayaKumar T M <vtmuni@codeaurora.org>
2017-05-31 10:44:54 -07:00
Gopikrishna Mogasati c4de80bf39 diag: Add proper synchronization checks to msg mask table
This fix removes dependency between real time message mask
table and build time message mask table. Also this fix
synchronizes retrieval and modification of real time message
mask table.

CRs-Fixed: 2015227
Change-Id: Id0a0964337ec4645d7061fc35120dfa061a990ff
Signed-off-by: Gopikrishna Mogasati <gmogas@codeaurora.org>
2017-05-31 21:20:06 +05:30
Linux Build Service Account a9db53d011 Merge "soc: qcom: msm_bus: add mutex lock for cllist data" 2017-05-30 13:08:50 -07:00
Linux Build Service Account fa94b08f7d Merge "input: synaptics: fix for buggy code poined by SIL tool" 2017-05-30 13:08:50 -07:00
Linux Build Service Account c5f525d43c Merge "msm: ipa: do not use delay in SSR" 2017-05-30 13:08:49 -07:00
David Dai 636bc7b683 msm: msm_bus: Add mutex to protect node_list
Static variable node_list list need to be protected with a mutex
to prevent race conditions and use after free cases.

Change-Id: I4790b06712b8a8b401f43418cfcc53b415fb0019
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2017-05-30 07:19:24 -07:00
Maria Yu 455affe5f7 soc: qcom: msm_bus: add mutex lock for cllist data
Cldata needed to be protected by lock since crash
happened when synchronous update and free.

CRs-Fixed: 2034222
Change-Id: Ied86461b784d69d9758dc3fc793a8a0de86e7f9c
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
2017-05-29 23:32:28 -07:00
Andrew Chant 21f3674803 input: synaptics: fix for buggy code poined by SIL tool
Place file offset validity checks under mutex for
synaptics_dsx_rmi_dev.c touch driver.

Git-repo: https://android.googlesource.com/kernel/msm
Git-commit: e1fb1600fc222337989e3084d68df929882deae5
Change-Id: I2c32babbccb483547204cb2843973abf97e988a5
Signed-off-by: Andrew Chant <achant@google.com>
[srkupp@codeaurora.org: This change is a fix for buggy
code pointed by sil after merging the above commit.}
Signed-off-by: Srinivasa Rao Kuppala <srkupp@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Signed-off-by: Niranjan Reddy Dumbala <ndumba@codeaurora.org>
2017-05-29 23:12:14 -07:00
Skylar Chang 569da1544d msm: ipa: do not use delay in SSR
In some rare race condition during SSR, modem might
programmed commands to IPA to lock the pipe, and AP will
enable delay on this pipe which will prevent IPA to read
unlock command. In this case IPA HW will be stalled as it
is locked forever on this pipe.

CRs-Fixed: 1040724
Change-Id: Ifc874c9e881eb1b3ccea321679bb272cd427fabb
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Acked-by: Mohammed Javid <mjavid@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Signed-off-by: Utkarsh Saxena <usaxena@codeaurora.org>
2017-05-28 04:36:30 -07:00
LuK1337 18aceede84 Merge tag 'LA.BR.1.3.6-03910-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-03910-8976.0"

Change-Id: I16643fc055aa2965fe5903396a8e5158c42cf1bc
2017-05-26 13:28:48 +02:00
VijayaKumar T M e41c30bbaf msm: camera2: cpp: Fix iommu_attach/detach compat_ioctl issue
When the Camera application exercises the  V4L2  ioctl operations, CPP
driver would attempt to the copy  user space buffer  contents into the
internal kernel buffer.  If an invalid length of the user space buffer
is passed onto the driver, it could trigger buffer overflow condition.

Thus, fix this by copying user space buffer contents into kernel space
buffer of the  driver for further processing, only after checking for
proper length of user space buffer.

CRs-fixed: 2025367
Change-Id: I85cf4a961884c7bb0d036299b886044aef7baf7c
Signed-off-by: Ravi kumar Koyyana <rkoyyana@codeaurora.org>
Signed-off-by: VijayaKumar T M <vtmuni@codeaurora.org>
2017-05-26 14:52:01 +05:30
Ravi kumar Koyyana b3d9bb0190 msm: camera2: cpp: Fix out-of-bounds frame or command buffer access
When user application provides invalid (out of range) stripe size and
stripe indices, while submitting  requests for the stripe based image
processing by the CPP kernel driver, the driver could  perform out of
bounds access of the internal buffers.

This fix ensures that stripe size and indices of frame/command buffer
are properly validated during the configuration and before processing
such requests through the CPP hardware block.

CRs-fixed: 2002207
Change-Id: Ib79e36fb507d8e75d8fc28afb990020a0e1bf845
Signed-off-by: Ravi kumar Koyyana <rkoyyana@codeaurora.org>
Signed-off-by: VijayaKumar T M <vtmuni@codeaurora.org>
2017-05-26 10:46:55 +05:30
Linux Build Service Account f5f7a9cedb Merge "msm: mdss: remove client from device list if failed to register" 2017-05-25 17:05:52 -07:00
Sandeep Panda 093e3bd422 msm: mdss: remove client from device list if failed to register
If there is any failure while registering a DBA client with MDSS
driver, then remove the client from device client list first and
then free the client. Otherwise driver might crash when
traversing the device client list in later stage, because of an
uninitialized entry in the list.

Change-Id: I60666f4c3dea5c7ea7b7c77bcb14b080ee25b54d
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
2017-05-24 00:27:54 -07:00
Xiaojun Sang ebc0c18555 ASoC: msm: remove unused msm-compr-q6-v2
msm-compr-q6-v2.c and msm-compr-q6-v2.h are no longer used.

CRs-Fixed: 2022953
Change-Id: I856d90a212a3e123a2c8b80092aff003f7c608c7
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2017-05-24 10:33:25 +05:30
Linux Build Service Account 320e0a8efb Merge "USB: f_qc_rndis: Prevent use-after-free for _rndis_qc" 2017-05-23 05:18:35 -07:00
Pratham Pratap 19a678f496 USB: f_qc_rndis: Prevent use-after-free for _rndis_qc
Assume that there are two threads, thread1 is setting
value of _rndis_qc variable in rndis_qc_bind_config_vendor
function. Thread2 jumps in and get the value of _rndis_qc
in rndis_qc_open_dev function before it is freed in
rndis_qc_bind_config_vendor function, since rndis_ipa_init
or usb_add_function failed. Use-after-free will happen as
Thread2 is referencing freed objects. To prevent this
spinlock is used where ever it is needed to protect
_rndis_qc variable.

Change-Id: Ibfe10cedc18bcb19dd01cd2bec43a5554fd008bc
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
2017-05-22 23:29:36 -07:00
Linux Build Service Account c0323439c3 Merge "ASoC: msm-cpe: Fix range checking in function fw_name_store" 2017-05-22 20:26:47 -07:00
Xiaoyu Ye 7def49a588 ASoC: msm-cpe: Fix range checking in function fw_name_store
The range checking between "WCD_CPE_IMAGE_FNAME_MAX" and
"copy_count" is off-by-one due to the size of array
"core->dyn_fname" is "WCD_CPE_IMAGE_FNAME_MAX". Subtract
one from the range checking to fix this issue.

Change-Id: I87fd55206f79ad7b13c3878f6642bf5579303b17
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2017-05-22 16:46:46 -07:00
Linux Build Service Account 4eeebe9614 Merge "ASoC: msm-lsm-client: use kzalloc instead of kmalloc" 2017-05-22 12:41:40 -07:00
Linux Build Service Account 7f9e5f664a Merge "msm: camera: Allow driver file to be opend only once." 2017-05-22 07:13:52 -07:00
Bhalchandra Gajare 53fea72ac3 ASoC: msm-lsm-client: use kzalloc instead of kmalloc
In the ioctl function, driver allocates memory to store data
internally before calling copy_to_user to copy data to user-space.
It is possible that kernel internal information can be leaked to
user space through this if the allocated memory is not completely
overwritten with valid data. Use kzalloc to fix this.

CRs-fixed: 2026045
Change-Id: I754ae2157034a135aaca4a15badf10d2567b7ed6
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2017-05-22 05:35:32 -07:00
Eric Dumazet aae7bf925a dccp/tcp: do not inherit mc_list from parent
syzkaller found a way to trigger double frees from ip_mc_drop_socket()

It turns out that leave a copy of parent mc_list at accept() time,
which is very bad.

Very similar to commit 8b485ce69876 ("tcp: do not inherit
fastopen_req from parent")

Initial report from Pray3r, completed by Andrey one.
Thanks a lot to them !

Change-Id: I9ab96385fcbcad25d3e6829927d586b91d22afe8
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Pray3r <pray3r.z@gmail.com>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-20 14:06:16 +02:00
Andrey Konovalov 97c0aca710 net/packet: fix overflow in check for tp_frame_nr
When calculating rb->frames_per_block * req->tp_block_nr the result
can overflow.

Add a check that tp_block_size * tp_block_nr <= UINT_MAX.

Since frames_per_block <= tp_block_size, the expression would
never overflow.

Change-Id: I3598423e621275aa1d890b80bcf9018929087d90
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
2017-05-20 14:06:10 +02:00
Andrey Konovalov 4135b95a32 net/packet: fix overflow in check for tp_reserve
When calculating po->tp_hdrlen + po->tp_reserve the result can overflow.

Fix by checking that tp_reserve <= INT_MAX on assign.

Change-Id: I6a4ea0cbe87cfd3db0979896c9bf9b3c626ec1d6
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
2017-05-20 14:06:05 +02:00
Srinivas Girigowda 0b0d108b41 qcacld-2.0: Remove obsolete set/reset ssid hotlist
Remove obsolete set/reset ssid hotlist.

Change-Id: I130b775cb5ec8c7a5073e7004bf6526448269399
CRs-Fixed: 1102593
2017-05-20 14:06:00 +02:00
Andrew Chant 1948807c1c sdcardfs: limit stacking depth
Limit filesystem stacking to prevent stack overflow.

Bug: 32761463
Change-Id: I8b1462b9c0d6c7f00cf110724ffb17e7f307c51e
Signed-off-by: Andrew Chant <achant@google.com>
CVE-2014-9922
2017-05-20 14:05:54 +02:00
Tom Marshall 5e3b9e76db kernel: Fix potential refcount leak in su check
Change-Id: I7e1ecb78bfc951bf645a1462988dcd93c4247a9b
2017-05-20 00:38:05 +02:00
Gaoxiang Chen aef9dd9fdc msm: camera: don't cut to 8bits for validating enum variable
In msm_ispif_is_intf_valid(),
we convert a enum variable msm_ispif_vfe_intf,
to uint8_t type for validating.

This could cause potential issue,
if the value is crafted in such a way that lower 8bits pass the validation.

Don't use uint8_t as input parm to avoid such vulnerability.

CRs-Fixed: 2008469
Change-Id: I4ee400ac0edd830decfbe5712966d968976a268a
Signed-off-by: Gaoxiang Chen <gaochen@codeaurora.org>
2017-05-18 23:37:35 -07:00
LuK1337 40e2de6755 kernel: Fix mismerge of `kernel: Only expose su when daemon is running`
Change-Id: Id9d3135ee6aba529b934aea521d15e1252d315d7
2017-05-16 22:40:21 +02:00
Linux Build Service Account b7d2b05736 Merge "ALSA: pcm : Call kill_fasync() in stream lock" 2017-05-15 10:44:37 -07:00