Commit graph

608133 commits

Author SHA1 Message Date
Christophe JAILLET
3498083352 sctp: Fix the link time qualifier of 'sctp_ctrlsock_exit()'
[ Upstream commit b456d72412ca8797234449c25815e82f4e1426c0 ]

The '.exit' functions from 'pernet_operations' structure should be marked
as __net_exit, not __net_init.

Fixes: 8e2d61e0ae ("sctp: fix race on protocol/netns initialization")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-21 07:12:40 +02:00
Cong Wang
f1b5406b5f sch_hhf: ensure quantum and hhf_non_hh_weight are non-zero
[ Upstream commit d4d6ec6dac07f263f06d847d6f732d6855522845 ]

In case of TCA_HHF_NON_HH_WEIGHT or TCA_HHF_QUANTUM is zero,
it would make no progress inside the loop in hhf_dequeue() thus
kernel would get stuck.

Fix this by checking this corner case in hhf_change().

Fixes: 10239edf86 ("net-qdisc-hhf: Heavy-Hitter Filter (HHF) qdisc")
Reported-by: syzbot+bc6297c11f19ee807dc2@syzkaller.appspotmail.com
Reported-by: syzbot+041483004a7f45f1f20a@syzkaller.appspotmail.com
Reported-by: syzbot+55be5f513bed37fc4367@syzkaller.appspotmail.com
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: Terry Lam <vtlam@google.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-21 07:12:39 +02:00
Subash Abhinov Kasiviswanathan
19dc97c984 net: Fix null de-reference of device refcount
[ Upstream commit 10cc514f451a0f239aa34f91bc9dc954a9397840 ]

In event of failure during register_netdevice, free_netdev is
invoked immediately. free_netdev assumes that all the netdevice
refcounts have been dropped prior to it being called and as a
result frees and clears out the refcount pointer.

However, this is not necessarily true as some of the operations
in the NETDEV_UNREGISTER notifier handlers queue RCU callbacks for
invocation after a grace period. The IPv4 callback in_dev_rcu_put
tries to access the refcount after free_netdev is called which
leads to a null de-reference-

44837.761523:   <6> Unable to handle kernel paging request at
                    virtual address 0000004a88287000
44837.761651:   <2> pc : in_dev_finish_destroy+0x4c/0xc8
44837.761654:   <2> lr : in_dev_finish_destroy+0x2c/0xc8
44837.762393:   <2> Call trace:
44837.762398:   <2>  in_dev_finish_destroy+0x4c/0xc8
44837.762404:   <2>  in_dev_rcu_put+0x24/0x30
44837.762412:   <2>  rcu_nocb_kthread+0x43c/0x468
44837.762418:   <2>  kthread+0x118/0x128
44837.762424:   <2>  ret_from_fork+0x10/0x1c

Fix this by waiting for the completion of the call_rcu() in
case of register_netdevice errors.

Fixes: 93ee31f14f ("[NET]: Fix free_netdev on register_netdev failure.")
Cc: Sean Tranchetti <stranche@codeaurora.org>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-21 07:12:39 +02:00
Eric Biggers
79bf5c3c94 isdn/capi: check message length in capi_write()
[ Upstream commit fe163e534e5eecdfd7b5920b0dfd24c458ee85d6 ]

syzbot reported:

    BUG: KMSAN: uninit-value in capi_write+0x791/0xa90 drivers/isdn/capi/capi.c:700
    CPU: 0 PID: 10025 Comm: syz-executor379 Not tainted 4.20.0-rc7+ #2
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
      __dump_stack lib/dump_stack.c:77 [inline]
      dump_stack+0x173/0x1d0 lib/dump_stack.c:113
      kmsan_report+0x12e/0x2a0 mm/kmsan/kmsan.c:613
      __msan_warning+0x82/0xf0 mm/kmsan/kmsan_instr.c:313
      capi_write+0x791/0xa90 drivers/isdn/capi/capi.c:700
      do_loop_readv_writev fs/read_write.c:703 [inline]
      do_iter_write+0x83e/0xd80 fs/read_write.c:961
      vfs_writev fs/read_write.c:1004 [inline]
      do_writev+0x397/0x840 fs/read_write.c:1039
      __do_sys_writev fs/read_write.c:1112 [inline]
      __se_sys_writev+0x9b/0xb0 fs/read_write.c:1109
      __x64_sys_writev+0x4a/0x70 fs/read_write.c:1109
      do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291
      entry_SYSCALL_64_after_hwframe+0x63/0xe7
    [...]

The problem is that capi_write() is reading past the end of the message.
Fix it by checking the message's length in the needed places.

Reported-and-tested-by: syzbot+0849c524d9c634f5ae66@syzkaller.appspotmail.com
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-21 07:12:39 +02:00
Christophe JAILLET
b2786ad2c1 ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()'
[ Upstream commit d23dbc479a8e813db4161a695d67da0e36557846 ]

The '.exit' functions from 'pernet_operations' structure should be marked
as __net_exit, not __net_init.

Fixes: d862e54614 ("net: ipv6: Implement /proc/net/icmp6.")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-21 07:12:38 +02:00
Bjørn Mork
5bd616b44f cdc_ether: fix rndis support for Mediatek based smartphones
[ Upstream commit 4d7ffcf3bf1be98d876c570cab8fc31d9fa92725 ]

A Mediatek based smartphone owner reports problems with USB
tethering in Linux.  The verbose USB listing shows a rndis_host
interface pair (e0/01/03 + 10/00/00), but the driver fails to
bind with

[  355.960428] usb 1-4: bad CDC descriptors

The problem is a failsafe test intended to filter out ACM serial
functions using the same 02/02/ff class/subclass/protocol as RNDIS.
The serial functions are recognized by their non-zero bmCapabilities.

No RNDIS function with non-zero bmCapabilities were known at the time
this failsafe was added. But it turns out that some Wireless class
RNDIS functions are using the bmCapabilities field. These functions
are uniquely identified as RNDIS by their class/subclass/protocol, so
the failing test can safely be disabled.  The same applies to the two
types of Misc class RNDIS functions.

Applying the failsafe to Communication class functions only retains
the original functionality, and fixes the problem for the Mediatek based
smartphone.

Tow examples of CDC functional descriptors with non-zero bmCapabilities
from Wireless class RNDIS functions are:

0e8d:000a  Mediatek Crosscall Spider X5 3G Phone

      CDC Header:
        bcdCDC               1.10
      CDC ACM:
        bmCapabilities       0x0f
          connection notifications
          sends break
          line coding and serial state
          get/set/clear comm features
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          1

and

19d2:1023  ZTE K4201-z

      CDC Header:
        bcdCDC               1.10
      CDC ACM:
        bmCapabilities       0x02
          line coding and serial state
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          1
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1

The Mediatek example is believed to apply to most smartphones with
Mediatek firmware.  The ZTE example is most likely also part of a larger
family of devices/firmwares.

Suggested-by: Lars Melin <larsm17@gmail.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-21 07:12:38 +02:00
Nicolas Dichtel
7a55aba16c bridge/mdb: remove wrong use of NLM_F_MULTI
[ Upstream commit 94a72b3f024fc7e9ab640897a1e38583a470659d ]

NLM_F_MULTI must be used only when a NLMSG_DONE message is sent at the end.
In fact, NLMSG_DONE is sent only at the end of a dump.

Libraries like libnl will wait forever for NLMSG_DONE.

Fixes: 949f1e39a6 ("bridge: mdb: notify on router port add and del")
CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-21 07:12:37 +02:00
Linux Build Service Account
16ede3da1a Merge "usb: dwc3-msm: Disable HSPHY autosuspend before core_init" 2019-09-20 16:08:19 -07:00
Michael Adisumarta
03879f74a7 msm: ipa: add additional checks to prevent use-after free errors
Adding a function to check for dangling pointer using IPA IDR structure
to avoid use after free error.

Change-Id: I0bd3d733bf10403366abc643f89c3e5c5e6228e9
Acked-by: Suhas Mallesh <smallesh@qti.qualcomm.com>
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
2019-09-20 15:46:28 -07:00
Linux Build Service Account
c652adc152 Merge "diag: Update event and log ranges of diag masks" 2019-09-20 04:12:11 -07:00
Linux Build Service Account
a9fa29f9e3 Merge "ARM: dts: msm: Disable QUSB2 PHY autosuspend for MSM8996" 2019-09-20 04:12:09 -07:00
Harshdeep Dhatt
9346c6a04b msm: kgsl: Disable deprecated ioctls
Disabling sparse ioctls as they are deprecated.

Change-Id: I5a4c78ec96fad4cda29a61d090e8bfb798123e3f
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
2019-09-20 10:00:10 +05:30
Amit Nischal
7b08812a59 ARM: dts: msm: Remove GPU min and low svs clocks for MSM8996ProAU
As per new clock plan for GFX3D clock, min and low svs levels are
not required so update the gpu pwr levels for msm_gpu node.

Change-Id: I6e0c8e60e9e2bbbf12c86b7652832f55306b45ac
Signed-off-by: Amit Nischal <anischal@codeaurora.org>
2019-09-19 11:02:30 -04:00
Manoj Prabhu B
111f87a373 diag: Update event and log ranges of diag masks
Update the latest macro definitions of event code and log code
ranges.

Change-Id: Ice3827c13cbb3a5ec30139079561cf527620fcef
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2019-09-18 22:40:53 -07:00
Shiju Mathew
011ac5089f soc: qcom: hab: reset comm-dev after free
To prevent use after the release.

Change-Id: I1f79fdd4bce38dd3870f5da57ffdc8ee7d719735
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
2019-09-18 19:56:00 -07:00
Linux Build Service Account
36f663352d Merge "diag: Update diag get log request structure" 2019-09-18 08:57:57 -07:00
Mayank Rana
358afa5742 dwc3-msm: Replace autosuspend delay functionality with stop host mode
With ID clear notification i.e. USB host mode disconnect, current
code is using PM runtime autosuspend functionality to put USB into
LPM having autosuspend delay of 1sec. With USB host mode cable
disconnect/connect having delay of less than 1 second, USB doesn't
go into LPM in between USB host mode disconnect and USB host mode
cable connect. This results into XHCI controller not being reset as
expected causing USB low speed and high speed device enumeration
issue with connect-debounce failure condition. Fix this issue by
replacing autosuspend functionality by pm_runtime_put_sync_suspend()
to put USB into LPM with USB host cable disconnect immediately.
While at it, also move queueing of sm_work function to dedicated
sm_usb_wq from system workqueue to avoid parallel runs.

Change-Id: I0db6ea7e63b853e419ccfd51808b8955e874db76
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-09-18 16:10:24 +05:30
Linux Build Service Account
6c6294eab2 Merge "msm: adsprpc: print process kill failure only when subsystem is up" 2019-09-18 00:30:43 -07:00
Linux Build Service Account
ec229a74a6 Merge "msm: kgsl: Make the "scratch" global buffer use a random GPU address" 2019-09-18 00:30:36 -07:00
Linux Build Service Account
d2896f14b1 Merge "msm: kgsl: Verify the offset of the profiling buffer" 2019-09-17 15:46:44 -07:00
Linux Build Service Account
2eacd40256 Merge "qseecom: correct range check in __qseecom_update_qteec_req_buf" 2019-09-17 04:46:22 -07:00
Jordan Crouse
5ffb9e5b7a msm: kgsl: Make the "scratch" global buffer use a random GPU address
Select a random global GPU address for the "scratch" buffer that is used
by the ringbuffer for various tasks.

Change-Id: Ic0dedbaddda71dbf9cb2adab3c6c33a24d6a604c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
2019-09-17 02:18:24 -07:00
Jordan Crouse
19f118bcf5 msm: kgsl: Use a bitmap allocator for global addressing
To prepare to allow global buffers to allocate a semi-random GPU address
move from a sequential allocator to a bitmap based one.

Change-Id: Ic0dedbadba36c4c7b7839528103997724eac7d6d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
2019-09-17 02:18:12 -07:00
Jordan Crouse
fbc6b845ce msm: kgsl: Execute user profiling commands in an IB
Execute user profiling in an indirect buffer. This ensures that addresses
and values specified directly from the user don't end up in the
ringbuffer.

Change-Id: Ic0dedbadedcaab29ce5738a39c1ff6269261bae4
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
2019-09-17 02:17:38 -07:00
Jordan Crouse
377294f396 msm: kgsl: Verify the offset of the profiling buffer
If a command is using a profiling buffer, make sure that the offset
is within the bounds of the specified memory descriptor.

Change-Id: Ic0dedbadc77e8eccd957136467bd0c56a1af2dab
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2019-09-17 02:17:16 -07:00
c_mtharu
fab8f054af msm: adsprpc: Fix integer overflow in refcount of map
Integer overflow in refcount of map is leading to use after free. Error
out if refcount reaches INT_MAX.

Change-Id: I21e88361a8e70ef8c5c9593f1fc0ddd2b351a55a
Acked-by: Himateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2019-09-17 12:52:12 +05:30
Tharun Kumar Merugu
a5cdf80ea8 msm: adsprpc: print process kill failure only when subsystem is up
Print error message if process kill on remote subsystem failed.
Validate channel ID before dereferencing the channel info struct.

When trying to release process on DSP, print failure message only
when the subsystem is up, to avoid flooding of kernel logs for
daemons.

Change-Id: I1b7325d686f6e8699e6f98f529c5dff85cce630d
Acked-by: Thyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2019-09-17 00:10:12 -07:00
Mark Salyzyn
aa6ba1d906 Revert "ANDROID: regression introduced override_creds=off"
This reverts commit 72c5343cdb.

Reason for revert: android-4.4 is for 'q' security updates, it is not dead.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 140816499
Change-Id: Ia99c0b420db306631e669428bb71eb8a2493ddc1
2019-09-16 15:32:53 +00:00
Srinivasarao P
869c392a21 Merge android-4.4.193 (3edc5af) into msm-4.4
* refs/heads/tmp-3edc5af
  Linux 4.4.193
  vhost: make sure log_num < in_num
  af_packet: tone down the Tx-ring unsupported spew.
  x86, boot: Remove multiple copy of static function sanitize_boot_params()
  clk: s2mps11: Add used attribute to s2mps11_dt_match
  scripts/decode_stacktrace: match basepath using shell prefix operator, not regex
  vhost/test: fix build for vhost test
  xfrm: clean up xfrm protocol checks
  ALSA: hda/realtek - Fix overridden device-specific initialization
  ALSA: hda - Fix potential endless loop at applying quirks
  ANDROID: regression introduced override_creds=off

Change-Id: I2a9b4c63e3572bbfe461ace3ccc41451a6ef700c
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-09-16 17:24:36 +05:30
Greg Kroah-Hartman
83f541302c This is the 4.4.193 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl1/KBYACgkQONu9yGCS
 aT4ubg//drwICDaJ09JHnZJ8ojogmPqKUbnit65qKADxhOG3ikwaESXlghZHjZKl
 SbZTnzb562WVzMSCU9WBDEx2DQJcY/EtM4y140yP08GRDUfeqCoCTScysbCSlY5j
 3B8ztlT/yNtuiGiFdaR9kCkwcV60++rdVyZ0+xeSMYpUdG9T9xkAmOCPZlvpWmjH
 a4VRG1oKdGTcPbxVe/7j4bwUvXacOhjHtn31cQaOeSRmPS5kwB5T4MOBSXPjzRmk
 VgyvniL/oNrqeCsFuK2NUjepv6yui1uDIQyc+/t5cdCTQWbIfI/PejZxgX6SZvt6
 qrt4ZuKpBTFXp6H/Hiy1KJ9cqHkqpkiGN0ggwzsz89asP0sXJa3h9Wp7u2e5OzsS
 rXNOFoO3CnGoWkummrWxKsvimwyieMUW473JD17QwUom/0KlpF3A9nYZFsAXUyOf
 WDLgMAmQblPl3sMmyE0FT2vm5RBbb70UbvP3NGB4HboB5f0A26cmedAl5QuG/Cj6
 /X1InHlJPK2DSKBy4CLH2z23RncVBPERRt8ZZCTHYutqfOPOjIh11PA7V7RJkFkK
 GHBzK2wUR0DYjG+C3Rxr5trX9SGSC9G38jw40+E7IGZVyN9FrajK5WPIm8vJ7Ovk
 yJgLDzGIP8gqsfVwSUALLD9si0ol6UxjBxmvf3oijx+/ZAZUJBM=
 =+5vp
 -----END PGP SIGNATURE-----

Merge 4.4.193 into android-4.4-p

Changes in 4.4.193
	ALSA: hda - Fix potential endless loop at applying quirks
	ALSA: hda/realtek - Fix overridden device-specific initialization
	xfrm: clean up xfrm protocol checks
	vhost/test: fix build for vhost test
	scripts/decode_stacktrace: match basepath using shell prefix operator, not regex
	clk: s2mps11: Add used attribute to s2mps11_dt_match
	x86, boot: Remove multiple copy of static function sanitize_boot_params()
	af_packet: tone down the Tx-ring unsupported spew.
	vhost: make sure log_num < in_num
	Linux 4.4.193

Change-Id: If2283bf8bc29f3deaf1c047c8ec9e502fbdf0521
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2019-09-16 09:51:32 +02:00
Greg Kroah-Hartman
3edc5af3e7 This is the 4.4.193 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl1/KBYACgkQONu9yGCS
 aT4ubg//drwICDaJ09JHnZJ8ojogmPqKUbnit65qKADxhOG3ikwaESXlghZHjZKl
 SbZTnzb562WVzMSCU9WBDEx2DQJcY/EtM4y140yP08GRDUfeqCoCTScysbCSlY5j
 3B8ztlT/yNtuiGiFdaR9kCkwcV60++rdVyZ0+xeSMYpUdG9T9xkAmOCPZlvpWmjH
 a4VRG1oKdGTcPbxVe/7j4bwUvXacOhjHtn31cQaOeSRmPS5kwB5T4MOBSXPjzRmk
 VgyvniL/oNrqeCsFuK2NUjepv6yui1uDIQyc+/t5cdCTQWbIfI/PejZxgX6SZvt6
 qrt4ZuKpBTFXp6H/Hiy1KJ9cqHkqpkiGN0ggwzsz89asP0sXJa3h9Wp7u2e5OzsS
 rXNOFoO3CnGoWkummrWxKsvimwyieMUW473JD17QwUom/0KlpF3A9nYZFsAXUyOf
 WDLgMAmQblPl3sMmyE0FT2vm5RBbb70UbvP3NGB4HboB5f0A26cmedAl5QuG/Cj6
 /X1InHlJPK2DSKBy4CLH2z23RncVBPERRt8ZZCTHYutqfOPOjIh11PA7V7RJkFkK
 GHBzK2wUR0DYjG+C3Rxr5trX9SGSC9G38jw40+E7IGZVyN9FrajK5WPIm8vJ7Ovk
 yJgLDzGIP8gqsfVwSUALLD9si0ol6UxjBxmvf3oijx+/ZAZUJBM=
 =+5vp
 -----END PGP SIGNATURE-----

Merge 4.4.193 into android-4.4

Changes in 4.4.193
	ALSA: hda - Fix potential endless loop at applying quirks
	ALSA: hda/realtek - Fix overridden device-specific initialization
	xfrm: clean up xfrm protocol checks
	vhost/test: fix build for vhost test
	scripts/decode_stacktrace: match basepath using shell prefix operator, not regex
	clk: s2mps11: Add used attribute to s2mps11_dt_match
	x86, boot: Remove multiple copy of static function sanitize_boot_params()
	af_packet: tone down the Tx-ring unsupported spew.
	vhost: make sure log_num < in_num
	Linux 4.4.193

Change-Id: I184694e569ff2252cf7721d77b57229ca899f634
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2019-09-16 09:48:34 +02:00
Greg Kroah-Hartman
e19c5132f7 Linux 4.4.193 2019-09-16 08:13:37 +02:00
yongduan
35b29a78cc vhost: make sure log_num < in_num
commit 060423bfdee3f8bc6e2c1bac97de24d5415e2bc4 upstream.

The code assumes log_num < in_num everywhere, and that is true as long as
in_num is incremented by descriptor iov count, and log_num by 1. However
this breaks if there's a zero sized descriptor.

As a result, if a malicious guest creates a vring desc with desc.len = 0,
it may cause the host kernel to crash by overflowing the log array. This
bug can be triggered during the VM migration.

There's no need to log when desc.len = 0, so just don't increment log_num
in this case.

Fixes: 3a4d5c94e9 ("vhost_net: a kernel-level virtio server")
Cc: stable@vger.kernel.org
Reviewed-by: Lidong Chen <lidongchen@tencent.com>
Signed-off-by: ruippan <ruippan@tencent.com>
Signed-off-by: yongduan <yongduan@tencent.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-16 08:13:36 +02:00
Dave Jones
8cc953562e af_packet: tone down the Tx-ring unsupported spew.
[ Upstream commit 6ae81ced378820c4c6434b1dedba14a7122df310 ]

Trinity and other fuzzers can hit this WARN on far too easily,
resulting in a tainted kernel that hinders automated fuzzing.

Replace it with a rate-limited printk.

Signed-off-by: Dave Jones <davej@codemonkey.org.uk>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-16 08:13:36 +02:00
Zhenzhong Duan
52b0d2ee55 x86, boot: Remove multiple copy of static function sanitize_boot_params()
commit 8c5477e8046ca139bac250386c08453da37ec1ae upstream.

Kernel build warns:
 'sanitize_boot_params' defined but not used [-Wunused-function]

at below files:
  arch/x86/boot/compressed/cmdline.c
  arch/x86/boot/compressed/error.c
  arch/x86/boot/compressed/early_serial_console.c
  arch/x86/boot/compressed/acpi.c

That's becausethey each include misc.h which includes a definition of
sanitize_boot_params() via bootparam_utils.h.

Remove the inclusion from misc.h and have the c file including
bootparam_utils.h directly.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/1563283092-1189-1-git-send-email-zhenzhong.duan@oracle.com
[nc: Fixed conflict around lack of 67b6662559f7f]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-16 08:13:36 +02:00
Nathan Chancellor
f935c94189 clk: s2mps11: Add used attribute to s2mps11_dt_match
[ Upstream commit 9c940bbe2bb47e03ca5e937d30b6a50bf9c0e671 ]

Clang warns after commit 8985167ecf57 ("clk: s2mps11: Fix matching when
built as module and DT node contains compatible"):

drivers/clk/clk-s2mps11.c:242:34: warning: variable 's2mps11_dt_match'
is not needed and will not be emitted [-Wunneeded-internal-declaration]
static const struct of_device_id s2mps11_dt_match[] = {
                                 ^
1 warning generated.

This warning happens when a variable is used in some construct that
doesn't require a reference to that variable to be emitted in the symbol
table; in this case, it's MODULE_DEVICE_TABLE, which only needs to hold
the data of the variable, not the variable itself.

$ nm -S drivers/clk/clk-s2mps11.o | rg s2mps11_dt_match
00000078 000003d4 R __mod_of__s2mps11_dt_match_device_table

Normally, with device ID table variables, it means that the variable
just needs to be tied to the device declaration at the bottom of the
file, like s2mps11_clk_id:

$ nm -S drivers/clk/clk-s2mps11.o | rg s2mps11_clk_id
00000000 00000078 R __mod_platform__s2mps11_clk_id_device_table
00000000 00000078 r s2mps11_clk_id

However, because the comment above this deliberately doesn't want this
variable added to .of_match_table, we need to mark s2mps11_dt_match as
__used to silence this warning. This makes it clear to Clang that the
variable is used for something, even if a reference to it isn't being
emitted.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Fixes: 8985167ecf57 ("clk: s2mps11: Fix matching when built as module and DT node contains compatible")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-16 08:13:36 +02:00
Nicolas Boichat
7ab6e38aec scripts/decode_stacktrace: match basepath using shell prefix operator, not regex
[ Upstream commit 31013836a71e07751a6827f9d2ad41ef502ddaff ]

The basepath may contain special characters, which would confuse the regex
matcher.  ${var#prefix} does the right thing.

Link: http://lkml.kernel.org/r/20190518055946.181563-1-drinkcat@chromium.org
Fixes: 67a28de47faa8358 ("scripts/decode_stacktrace: only strip base path when a prefix of the path")
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-16 08:13:36 +02:00
Tiwei Bie
17b919f0e6 vhost/test: fix build for vhost test
commit 264b563b8675771834419057cbe076c1a41fb666 upstream.

Since vhost_exceeds_weight() was introduced, callers need to specify
the packet weight and byte weight in vhost_dev_init(). Note that, the
packet weight isn't counted in this patch to keep the original behavior
unchanged.

Fixes: e82b9b0727ff ("vhost: introduce vhost_exceeds_weight()")
Cc: stable@vger.kernel.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-16 08:13:35 +02:00
Cong Wang
e1b22f7a0b xfrm: clean up xfrm protocol checks
commit dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 upstream.

In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
I introduced a check for xfrm protocol, but according to Herbert
IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
it should be removed from validate_tmpl().

And, IPSEC_PROTO_ANY is expected to only match 3 IPSec-specific
protocols, this is why xfrm_state_flush() could still miss
IPPROTO_ROUTING, which leads that those entries are left in
net->xfrm.state_all before exit net. Fix this by replacing
IPSEC_PROTO_ANY with zero.

This patch also extracts the check from validate_tmpl() to
xfrm_id_proto_valid() and uses it in parse_ipsecrequest().
With this, no other protocols should be added into xfrm.

Fixes: 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
Reported-by: syzbot+0bf0519d6e0de15914fe@syzkaller.appspotmail.com
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-16 08:13:35 +02:00
Takashi Iwai
949f4ca254 ALSA: hda/realtek - Fix overridden device-specific initialization
commit 89781d0806c2c4f29072d3f00cb2dd4274aabc3d upstream.

The recent change to shuffle the codec initialization procedure for
Realtek via commit 607ca3bd220f ("ALSA: hda/realtek - EAPD turn on
later") caused the silent output on some machines.  This change was
supposed to be safe, but it isn't actually; some devices have quirk
setups to override the EAPD via COEF or BTL in the additional verb
table, which is applied at the beginning of snd_hda_gen_init().  And
this EAPD setup is again overridden in alc_auto_init_amp().

For recovering from the regression, tell snd_hda_gen_init() not to
apply the verbs there by a new flag, then apply the verbs in
alc_init().

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204727
Fixes: 607ca3bd220f ("ALSA: hda/realtek - EAPD turn on later")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-16 08:13:35 +02:00
Takashi Iwai
272e183586 ALSA: hda - Fix potential endless loop at applying quirks
commit 333f31436d3db19f4286f8862a00ea1d8d8420a1 upstream.

Since the chained quirks via chained_before flag is applied before the
depth check, it may lead to the endless recursive calls, when the
chain were set up incorrectly.  Fix it by moving the depth check at
the beginning of the loop.

Fixes: 1f57825077 ("ALSA: hda - Add chained_before flag to the fixup entry")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-16 08:13:34 +02:00
Rajasekaran Kalidoss
6305836174 cnss2: support wakeup using gpio
To support remote wakeup of MSM8996, a GPIO needs
to be configured as a wakeup interrupt source.
WLAN firmware can toggle this pin to wakeup the
Host when wireless wakeup is triggered.

Change-Id: Id13652f262f37649bb35196f21ae1ff90b7a637a
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-09-15 23:12:20 -07:00
Zhen Kong
b5c5ac439d qseecom: correct range check in __qseecom_update_qteec_req_buf
Make change to validate if there exists enough space to write a
struct qseecom_param_memref instead of a unit32 value, in the
request buffer in __qseecom_update_qteec_req_buf.

Change-Id: I4e092f7aa2b23648c2cedfada311828b9ceb35dc
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2019-09-13 10:31:46 -07:00
Mark Salyzyn
72c5343cdb ANDROID: regression introduced override_creds=off
Fixes a regression introduced by the series of commits:
commit 272fcd1ca7ceb252b1c3a2961110c7c1722707cf
("ANDROID: overlayfs: override_creds=off option bypass creator_cred"),
commit aab9adb4b8
("Merge 4.4.179 into android-4.4") that took in an incomplete,
backport of commit 54a07fff4b
("ovl: fix uid/gid when creating over whiteout") (or upstream
commit d0e13f5bbe4be7c8f27736fc40503dcec04b7de0
("ovl: fix uid/gid when creating over whiteout"))
where a crash is observed in ovl_create_or_link() when a
simple re-direction command in vendor directory.

/vendor/bin/<Any test> > /vendor/bin/test_log.txt 2>&1&

After further debugging we see that if the output is redirected to a
file which doesn’t exist we see this stack:

[  377.382745]  ovl_create_or_link+0xac/0x710
[  377.382745]  ovl_create_object+0xb8/0x110
[  377.382745]  ovl_create+0x34/0x40
[  377.382745]  path_openat+0xd44/0x15a8
[  377.382745]  do_filp_open+0x80/0x128
[  377.382745]  do_sys_open+0x140/0x250
[  377.382745]  __arm64_sys_openat+0x2c/0x38

ovl_override_creds returns NULL because the override_cred flag is set
to false.  This causes ovl_revert_creds also to fail.

There is another call to check override_cred in override_cred call
which overrides the creds permanently as there no revert_creds
associated.  So whenever next commit_cred is called we see the crash
as the credentials are permanently overridden.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Tested-by: Rishabh/Jeevan <jshriram@qualcomm.corp-partner.google.com>
Bug: 140816499
Bug: 109821005
Bug: 112955896
Bug: 127298877
Bug: 137541192
Change-Id: Icd0d9be82fc57af5ead1eeab99f79adf3adf62ef
2019-09-13 09:31:12 -07:00
Mark Salyzyn
3dcafcc6c0 ANDROID: regression introduced override_creds=off
Fixes a regression introduced by the series of commits:
commit 17bd9a7f78
("ANDROID: overlayfs ovl_create_of_link regression"),
commit 272fcd1ca7ceb252b1c3a2961110c7c1722707cf
("ANDROID: overlayfs: override_creds=off option bypass creator_cred"),
commit aab9adb4b8
("Merge 4.4.179 into android-4.4") that took in an incomplete,
backport of commit 54a07fff4b
("ovl: fix uid/gid when creating over whiteout") (or upstream
commit d0e13f5bbe4be7c8f27736fc40503dcec04b7de0
("ovl: fix uid/gid when creating over whiteout"))
where a crash is observed a crash in ovl_create_or_link() when a
simple re-direction command in vendor directory.

/vendor/bin/<Any test> > /vendor/bin/test_log.txt 2>&1&

After further debugging we see that if the output is redirected to a
file which doesn’t exist we see this stack:

[  377.382745]  ovl_create_or_link+0xac/0x710
[  377.382745]  ovl_create_object+0xb8/0x110
[  377.382745]  ovl_create+0x34/0x40
[  377.382745]  path_openat+0xd44/0x15a8
[  377.382745]  do_filp_open+0x80/0x128
[  377.382745]  do_sys_open+0x140/0x250
[  377.382745]  __arm64_sys_openat+0x2c/0x38

ovl_override_creds returns NULL because the override_cred flag is set
to false.  This causes ovl_revert_creds also to fail.

There is another call to check override_cred in override_cred call
which overrides the creds permanently as there no revert_creds
associated.  So whenever next commit_cred is called we see the crash
as the credentials are permanently overridden.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Tested-by: Rishabh/Jeevan <jshriram@qualcomm.corp-partner.google.com>
Bug: 140816499
Bug: 109821005
Bug: 112955896
Bug: 127298877
Bug: 137541192
Change-Id: Icd0d9be82fc57af5ead1eeab99f79adf3adf62ef
2019-09-13 08:55:53 -07:00
Linux Build Service Account
6e94fb15c8 Merge "msm: qcn: Change spin_lock api to synchronize clients" 2019-09-13 07:57:20 -07:00
Linux Build Service Account
579c3a61d1 Merge "msm: qti_sdio_client: Return error number in diag callback" 2019-09-13 07:57:19 -07:00
Linux Build Service Account
7cc2dc9f84 Merge "icnss: Correct condition to check invalid address range" 2019-09-13 07:57:18 -07:00
Linux Build Service Account
cec46a59f3 Merge "Merge android-4.4.192 (da6d147) into msm-4.4" 2019-09-13 07:57:17 -07:00
Amandeep Singh
9bc62df416 msm: Update config name of function-1 driver
Update config name to enable and disable SDIO function-1
driver support and its dependencies.

Change-Id: I91de5e75c115f755ddc84bd80e5942162120f6cf
Signed-off-by: Amandeep Singh <amansing@codeaurora.org>
2019-09-13 12:52:05 +05:30