Commit Graph

659596 Commits

Author SHA1 Message Date
ckkim
6ad97dceb7 ODROID-HC4:remove pwm-fan pinctrl(PWM_C : GPIOC_4 remove)
Signed-off-by: ckkim <changkon12@gmail.com>
Change-Id: I36ddb1889cc1d181372c8925e58726d71a615d4e
4.9.236-51 4.9.236-104
2020-11-10 09:24:26 -03:00
Dongjin Kim
8fb70183bd Revert "ODROID-COMMON: osd: Adjust osd scaler and vout serve to fit in KODI"
This reverts commit 6f7138e3ac.

Change-Id: Ib57697cf7668460ab81bf951d0dee1e003adba44
4.9.236-50
2020-11-05 17:17:51 +09:00
Dongjin Kim
67281d47ea Revert "ODROID-COMMON:osd: Adjust osd scaler and vout serve to fit in KODI. Only works in S922(N2/N2+)."
This reverts commit 0427609dc9.

Change-Id: Idcf054d6da7a2602dbac904ae2a6ec6da0ee00bf
2020-11-05 17:17:48 +09:00
ckkim
800070774d ODROID-N2/N2+:no soundcard error fix.
Change-Id: I71319cf50a1fd07b9ec48edc62e2a0bbcf565ba9
4.9.236-103
2020-11-04 13:26:52 +09:00
Mauro Ribeiro
b865c9de61 Merge "ODROID-COMMON:osd: Adjust osd scaler and vout serve to fit in KODI. Only works in S922(N2/N2+)." into odroidg12-4.9.y 4.9.236-98 2020-10-30 22:39:19 +09:00
Deokgyu Yang
98774b1480 ODROID-COMMON: drivers/spi: Set the 64 bits per word by default
The existing force64b routine might not work properly under specific
conditions. This patch fixes that bug of 64 bits per word and forces
use that option. It will improve SPI performance significantly.

Signed-off-by: Deokgyu Yang <secugyu@gmail.com>
Change-Id: I85a58d425303ea1765b7b83ee5dd5f0a7f4203fc
2020-10-30 16:09:06 +09:00
ckkim
0427609dc9 ODROID-COMMON:osd: Adjust osd scaler and vout serve to fit in KODI. Only works in S922(N2/N2+).
Change-Id: I7a16dd2cbde63d8b716aab17d85fb9dc1157e2ff
2020-10-29 18:28:25 +09:00
Luke go
3fb04f4ee0 ODROID-HC4: arm64/dtbs: overlay: Changed fanspeed.
- Because of noise, Changed the fan speed by adjust pwm frequency.

Change-Id: Ie12eb7f16cfbf1eeab01cb4694540b8260985a47
2020-10-22 09:53:12 +09:00
Dongjin Kim
bd5043c030 ODROID-HC4: arm64/dts: add PWM pinctrl for cooling fan
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I44e55ae09a1cbd6eb46b5636147f5f3f35ef28a8
2020-10-20 17:21:07 +09:00
Luke go
d615a4cadc ODROID-COMMON: arm64/dts: overlay: Add the PWM examples.
- pwmfan, pwm-backlight.

Change-Id: Id1cdbbebc80962f0ed51be05d95b771c1af6be30
2020-10-20 17:20:56 +09:00
Luke go
154309864d ODROID-COMMON: arm64/dts: overlay: Separate PWM and apply overlay.
- The PWM's configuration is difference between the n2 and c4. So
  separate configuration and placed to the device tree overlays.

Change-Id: Ia870ce6ea4404c8bc7028ae7f1cc72174406ed27
2020-10-20 17:19:11 +09:00
Luke go
5d32c14779 ODROID-C4/HC4: arm64/dts: overlay: Add overlay to run fully loaded fan
speed.

Change-Id: I56dd11c2cc88406ed695e1594301a759eedfc017
Signed-off-by: Luke go <sangch.go@gmail.com>
2020-10-16 16:01:25 +09:00
Luke Go
d136a8e5b6 ODROID: bt: Bugfix.
- power_low_level value is not applied correctly.

Change-Id: Id98d8e819e0502f7ec2ae27f972a926ac7c855d2
Signed-off-by: Luke Go <sangch.go@gmail.com>
2020-10-14 12:22:49 +09:00
Luke go
2da194b281 ODROID-C4: Add wifi/bt combo.
Change-Id: I7aee51cd8c8babcebf3b060f9b09cbd6f00212f1
2020-10-14 12:22:27 +09:00
Dongjin Kim
2ea1cdf417 ODROID-COMMON: clock: remove confusing kernel warning
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Ic13f009bc8221317e554921d3da2a420fce28c53
4.9.236-37
2020-10-12 14:23:13 +09:00
Dongjin Kim
e7fb2db2f4 ODROID-HC4: cpufreq: add to use kernel parameter to set max cpufreq
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I5ce9b4b69e4f436f183292764149950d74131900
2020-10-07 12:11:08 +09:00
Dongjin Kim
4c7f82cbfc ODROID-COMMON: config: add ATA drivers for ODROID-HC4
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Iaf336ea71095938d4da5a2abb0cbe9c61e43ee95
2020-10-07 12:11:08 +09:00
Dongjin Kim
5fb3d92bb2 ODROID-HC4: arm64/boot: add PWM based fan node entry
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I8cf61fe74f59411c92b7367099664cba6b5e576e
2020-10-07 12:11:08 +09:00
Dongjin Kim
aa5ce947c0 ODROID-HC4: arm64/dts: add SPI flash memory
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: If6ae6a414d1f27ab48c7a337aa8241603146376a
2020-10-07 12:11:08 +09:00
Dongjin Kim
a73de30e3b ODROID-HC4: arm64/dts: add USB host support on 'rev.20200512'
[1] GPIOAO_2 is tied to control USB 2.0 host power
[2] USB 3.0 PHY must be disabled exclusively for PCIe.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I340ca69f6da448a441ed75c506ea569947a581c4
2020-10-07 12:11:08 +09:00
Dongjin Kim
5068036653 ODROID-HC4: arch/arm64: Introduce new board 'ODROID-HC4'
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I8ba3c401aedacfcf1307049fac66ebb13bddfa6d
2020-10-07 12:11:08 +09:00
Dongjin Kim
d227b6e25e ODROID-C4: cpufreq: fix typo to set the default cpufreq
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Ie790225b30477ee0af821c55066df1f83c819b51
2020-10-07 12:11:08 +09:00
Luke go
b60f79adbc ODROID-C4: arm64/dts: overlay: Add sdio.
Change-Id: I87bf7ff7f68863b79826b5d10e8eb840c0e70c1e
2020-09-24 15:17:06 +09:00
Luke go
efe463052b ODROID-C4: wireless: esp8089: Support esp8089 driver.
- The esp8089 driver supports many esp's wifi modules. So it is imported.

Change-Id: If039882e183e454baff2c222bf7a1282b6705459
2020-09-24 15:14:34 +09:00
Joy Cho
cbb49c05e1 Merge "ODROID-COMMON: hdmitx: Adjust 2560x1600 timing to use lower pixel clock" into odroidg12-4.9.y 4.9.236-38 4.9.236-39 2020-09-24 10:35:13 +09:00
Dongjin Kim
04f0d87806 ODROID-N2: arm64/dts: move the default SPDIF to GPIOA_11 to GPIOA_13
- Add gpio's spdifout overlays. It support GPIOA 13 - PIN7 spdifout.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: If18cbdc8b9995accbe79df1d060ca8f1677758b5
2020-09-22 14:38:57 +09:00
Joy Cho
5695340a34 ODROID-COMMON: hdmitx: Adjust 2560x1600 timing to use lower pixel clock
With some specific monitors those pixel clock is under 300MHz,
unstable display operation may occur.
So, default timing for 2560x1600p60hz is set as following.

Detailed mode: Clock 268.500 MHz, 641 mm x 401 mm
               2560 2608 2640 2720 ( 48  32  80)
               1600 1602 1608 1646 (  2   6  38)
               +hsync -vsync
               VertFreq: 59.972 Hz, HorFreq: 98.713 kHz

Change-Id: I7812a491b5d81379cd4568223d478909ecd882c4
2020-09-20 12:09:58 +09:00
Joy Cho
9c5a019836 vout: cvbs: Update cvbscable option detection
Change-Id: Ia80e740f913439e03f2f4f2ae01e85aabcc096fd
2020-09-16 21:05:39 +09:00
Mauro (mdrjr) Ribeiro
de23fd9c97 Merge tag 'v4.9.236' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.236 stable release

Change-Id: I469c4a63c9bc761ca785b08ef0a1ff5ad2c1f650
4.9.236-36 4.9.236-97
2020-09-15 10:54:30 -03:00
Mauro (mdrjr) Ribeiro
b5e205b376 Merge tag 'v4.9.235' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.235 stable release

Change-Id: I826c11db869c580205ffc19d9d811c6b136c95cb
2020-09-15 10:54:19 -03:00
Mauro (mdrjr) Ribeiro
3cb1471988 Merge tag 'v4.9.234' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.234 stable release
2020-09-15 10:54:07 -03:00
Mauro (mdrjr) Ribeiro
4d6f772c22 Merge tag 'v4.9.233' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.233 stable release
2020-09-15 10:53:28 -03:00
Mauro (mdrjr) Ribeiro
d4468d096e Merge tag 'v4.9.232' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.232 stable release

Change-Id: I39e43636ab0570c5338daac4cc6eba64d257c955
2020-09-15 10:52:47 -03:00
Mauro (mdrjr) Ribeiro
ac06db4d16 Merge tag 'v4.9.231' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.231 stable release
2020-09-15 10:52:40 -03:00
Greg Kroah-Hartman
65676505f8 Linux 4.9.236
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:40 +02:00
Jakub Kicinski
6048d57b66 net: disable netpoll on fresh napis
[ Upstream commit 96e97bc07e ]

napi_disable() makes sure to set the NAPI_STATE_NPSVC bit to prevent
netpoll from accessing rings before init is complete. However, the
same is not done for fresh napi instances in netif_napi_add(),
even though we expect NAPI instances to be added as disabled.

This causes crashes during driver reconfiguration (enabling XDP,
changing the channel count) - if there is any printk() after
netif_napi_add() but before napi_enable().

To ensure memory ordering is correct we need to use RCU accessors.

Reported-by: Rob Sherwood <rsher@fb.com>
Fixes: 2d8bff1269 ("netpoll: Close race condition between poll_one_napi and napi_disable")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:40 +02:00
Xin Long
20e63db771 sctp: not disable bh in the whole sctp_get_port_local()
[ Upstream commit 3106ecb43a ]

With disabling bh in the whole sctp_get_port_local(), when
snum == 0 and too many ports have been used, the do-while
loop will take the cpu for a long time and cause cpu stuck:

  [ ] watchdog: BUG: soft lockup - CPU#11 stuck for 22s!
  [ ] RIP: 0010:native_queued_spin_lock_slowpath+0x4de/0x940
  [ ] Call Trace:
  [ ]  _raw_spin_lock+0xc1/0xd0
  [ ]  sctp_get_port_local+0x527/0x650 [sctp]
  [ ]  sctp_do_bind+0x208/0x5e0 [sctp]
  [ ]  sctp_autobind+0x165/0x1e0 [sctp]
  [ ]  sctp_connect_new_asoc+0x355/0x480 [sctp]
  [ ]  __sctp_connect+0x360/0xb10 [sctp]

There's no need to disable bh in the whole function of
sctp_get_port_local. So fix this cpu stuck by removing
local_bh_disable() called at the beginning, and using
spin_lock_bh() instead.

The same thing was actually done for inet_csk_get_port() in
Commit ea8add2b19 ("tcp/dccp: better use of ephemeral
ports in bind()").

Thanks to Marcelo for pointing the buggy code out.

v1->v2:
  - use cond_resched() to yield cpu to other tasks if needed,
    as Eric noticed.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: Ying Xu <yinxu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
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>
2020-09-12 11:47:40 +02:00
Kamil Lorenc
3412e02663 net: usb: dm9601: Add USB ID of Keenetic Plus DSL
[ Upstream commit a609d02591 ]

Keenetic Plus DSL is a xDSL modem that uses dm9620 as its USB interface.

Signed-off-by: Kamil Lorenc <kamil@re-ws.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:39 +02:00
Paul Moore
a542f4fe6e netlabel: fix problems with mapping removal
[ Upstream commit d3b990b7f3 ]

This patch fixes two main problems seen when removing NetLabel
mappings: memory leaks and potentially extra audit noise.

The memory leaks are caused by not properly free'ing the mapping's
address selector struct when free'ing the entire entry as well as
not properly cleaning up a temporary mapping entry when adding new
address selectors to an existing entry.  This patch fixes both these
problems such that kmemleak reports no NetLabel associated leaks
after running the SELinux test suite.

The potentially extra audit noise was caused by the auditing code in
netlbl_domhsh_remove_entry() being called regardless of the entry's
validity.  If another thread had already marked the entry as invalid,
but not removed/free'd it from the list of mappings, then it was
possible that an additional mapping removal audit record would be
generated.  This patch fixes this by returning early from the removal
function when the entry was previously marked invalid.  This change
also had the side benefit of improving the code by decreasing the
indentation level of large chunk of code by one (accounting for most
of the diffstat).

Fixes: 63c4168874 ("netlabel: Add network address selectors to the NetLabel/LSM domain mapping")
Reported-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:39 +02:00
Jakub Kicinski
23603e69bc bnxt: don't enable NAPI until rings are ready
commit 96ecdcc992 upstream.

Netpoll can try to poll napi as soon as napi_enable() is called.
It crashes trying to access a doorbell which is still NULL:

 BUG: kernel NULL pointer dereference, address: 0000000000000000
 CPU: 59 PID: 6039 Comm: ethtool Kdump: loaded Tainted: G S                5.9.0-rc1-00469-g5fd99b5d9950-dirty #26
 RIP: 0010:bnxt_poll+0x121/0x1c0
 Code: c4 20 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 41 8b 86 a0 01 00 00 41 23 85 18 01 00 00 49 8b 96 a8 01 00 00 0d 00 00 00 24 <89> 02
41 f6 45 77 02 74 cb 49 8b ae d8 01 00 00 31 c0 c7 44 24 1a
  netpoll_poll_dev+0xbd/0x1a0
  __netpoll_send_skb+0x1b2/0x210
  netpoll_send_udp+0x2c9/0x406
  write_ext_msg+0x1d7/0x1f0
  console_unlock+0x23c/0x520
  vprintk_emit+0xe0/0x1d0
  printk+0x58/0x6f
  x86_vector_activate.cold+0xf/0x46
  __irq_domain_activate_irq+0x50/0x80
  __irq_domain_activate_irq+0x32/0x80
  __irq_domain_activate_irq+0x32/0x80
  irq_domain_activate_irq+0x25/0x40
  __setup_irq+0x2d2/0x700
  request_threaded_irq+0xfb/0x160
  __bnxt_open_nic+0x3b1/0x750
  bnxt_open_nic+0x19/0x30
  ethtool_set_channels+0x1ac/0x220
  dev_ethtool+0x11ba/0x2240
  dev_ioctl+0x1cf/0x390
  sock_do_ioctl+0x95/0x130

Reported-by: Rob Sherwood <rsher@fb.com>
Fixes: c0c050c58d ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:39 +02:00
Shung-Hsi Yu
ce391ac20e net: ethernet: mlx4: Fix memory allocation in mlx4_buddy_init()
commit cbedcb044e upstream.

On machines with much memory (> 2 TByte) and log_mtts_per_seg == 0, a
max_order of 31 will be passed to mlx_buddy_init(), which results in
s = BITS_TO_LONGS(1 << 31) becoming a negative value, leading to
kvmalloc_array() failure when it is converted to size_t.

  mlx4_core 0000:b1:00.0: Failed to initialize memory region table, aborting
  mlx4_core: probe of 0000:b1:00.0 failed with error -12

Fix this issue by changing the left shifting operand from a signed literal to
an unsigned one.

Fixes: 225c7b1fee ("IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters")
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:39 +02:00
Max Staudt
e942ed86e5 affs: fix basic permission bits to actually work
[ Upstream commit d3a84a8d0d ]

The basic permission bits (protection bits in AmigaOS) have been broken
in Linux' AFFS - it would only set bits, but never delete them.
Also, contrary to the documentation, the Archived bit was not handled.

Let's fix this for good, and set the bits such that Linux and classic
AmigaOS can coexist in the most peaceful manner.

Also, update the documentation to represent the current state of things.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-12 11:47:39 +02:00
Fabian Frederick
f0c44a60ac fs/affs: use octal for permissions
[ Upstream commit 1bafd6f164 ]

According to commit f90774e1fd ("checkpatch: look for symbolic
permissions and suggest octal instead")

Link: http://lkml.kernel.org/r/20170109191208.6085-5-fabf@skynet.be
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Al Viro <viro@zeniv.linux.org.uk>
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>
2020-09-12 11:47:39 +02:00
Takashi Sakamoto
ad2eb69aef ALSA; firewire-tascam: exclude Tascam FE-8 from detection
Tascam FE-8 is known to support communication by asynchronous transaction
only. The support can be implemented in userspace application and
snd-firewire-ctl-services project has the support. However, ALSA
firewire-tascam driver is bound to the model.

This commit changes device entries so that the model is excluded. In a
commit 53b3ffee78 ("ALSA: firewire-tascam: change device probing
processing"), I addressed to the concern that version field in
configuration differs depending on installed firmware. However, as long
as I checked, the version number is fixed. It's safe to return version
number back to modalias.

Fixes: 53b3ffee78 ("ALSA: firewire-tascam: change device probing processing")
Cc: <stable@vger.kernel.org> # 4.4+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20200823075537.56255-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-09-12 11:47:39 +02:00
Himadri Pandya
968ec616e7 net: usb: Fix uninit-was-stored issue in asix_read_phy_addr()
commit a092b7233f upstream.

The buffer size is 2 Bytes and we expect to receive the same amount of
data. But sometimes we receive less data and run into uninit-was-stored
issue upon read. Hence modify the error check on the return value to match
with the buffer size as a prevention.

Reported-and-tested by: syzbot+a7e220df5a81d1ab400e@syzkaller.appspotmail.com
Signed-off-by: Himadri Pandya <himadrispandya@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:39 +02:00
Johannes Berg
2e34f0fcc6 cfg80211: regulatory: reject invalid hints
commit 47caf685a6 upstream.

Reject invalid hints early in order to not cause a kernel
WARN later if they're restored to or similar.

Reported-by: syzbot+d451401ffd00a60677ee@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=d451401ffd00a60677ee
Link: https://lore.kernel.org/r/20200819084648.13956-1-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:39 +02:00
Muchun Song
47b1be3953 mm/hugetlb: fix a race between hugetlb sysctl handlers
commit 17743798d8 upstream.

There is a race between the assignment of `table->data` and write value
to the pointer of `table->data` in the __do_proc_doulongvec_minmax() on
the other thread.

  CPU0:                                 CPU1:
                                        proc_sys_write
  hugetlb_sysctl_handler                  proc_sys_call_handler
  hugetlb_sysctl_handler_common             hugetlb_sysctl_handler
    table->data = &tmp;                       hugetlb_sysctl_handler_common
                                                table->data = &tmp;
      proc_doulongvec_minmax
        do_proc_doulongvec_minmax           sysctl_head_finish
          __do_proc_doulongvec_minmax         unuse_table
            i = table->data;
            *i = val;  // corrupt CPU1's stack

Fix this by duplicating the `table`, and only update the duplicate of
it.  And introduce a helper of proc_hugetlb_doulongvec_minmax() to
simplify the code.

The following oops was seen:

    BUG: kernel NULL pointer dereference, address: 0000000000000000
    #PF: supervisor instruction fetch in kernel mode
    #PF: error_code(0x0010) - not-present page
    Code: Bad RIP value.
    ...
    Call Trace:
     ? set_max_huge_pages+0x3da/0x4f0
     ? alloc_pool_huge_page+0x150/0x150
     ? proc_doulongvec_minmax+0x46/0x60
     ? hugetlb_sysctl_handler_common+0x1c7/0x200
     ? nr_hugepages_store+0x20/0x20
     ? copy_fd_bitmaps+0x170/0x170
     ? hugetlb_sysctl_handler+0x1e/0x20
     ? proc_sys_call_handler+0x2f1/0x300
     ? unregister_sysctl_table+0xb0/0xb0
     ? __fd_install+0x78/0x100
     ? proc_sys_write+0x14/0x20
     ? __vfs_write+0x4d/0x90
     ? vfs_write+0xef/0x240
     ? ksys_write+0xc0/0x160
     ? __ia32_sys_read+0x50/0x50
     ? __close_fd+0x129/0x150
     ? __x64_sys_write+0x43/0x50
     ? do_syscall_64+0x6c/0x200
     ? entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fixes: e5ff215941 ("hugetlb: multiple hstates for multiple page sizes")
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/20200828031146.43035-1-songmuchun@bytedance.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:38 +02:00
Mrinal Pandey
913412eda1 checkpatch: fix the usage of capture group ( ... )
commit 13e45417ce upstream.

The usage of "capture group (...)" in the immediate condition after `&&`
results in `$1` being uninitialized.  This issues a warning "Use of
uninitialized value $1 in regexp compilation at ./scripts/checkpatch.pl
line 2638".

I noticed this bug while running checkpatch on the set of commits from
v5.7 to v5.8-rc1 of the kernel on the commits with a diff content in
their commit message.

This bug was introduced in the script by commit e518e9a59e
("checkpatch: emit an error when there's a diff in a changelog").  It
has been in the script since then.

The author intended to store the match made by capture group in variable
`$1`.  This should have contained the name of the file as `[\w/]+`
matched.  However, this couldn't be accomplished due to usage of capture
group and `$1` in the same regular expression.

Fix this by placing the capture group in the condition before `&&`.
Thus, `$1` can be initialized to the text that capture group matches
thereby setting it to the desired and required value.

Fixes: e518e9a59e ("checkpatch: emit an error when there's a diff in a changelog")
Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Reviewed-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Joe Perches <joe@perches.com>
Link: https://lkml.kernel.org/r/20200714032352.f476hanaj2dlmiot@mrinalpandey
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:38 +02:00
Alex Williamson
54764e8dfb vfio/pci: Fix SR-IOV VF handling with MMIO blocking
commit ebfa440ce3 upstream.

SR-IOV VFs do not implement the memory enable bit of the command
register, therefore this bit is not set in config space after
pci_enable_device().  This leads to an unintended difference
between PF and VF in hand-off state to the user.  We can correct
this by setting the initial value of the memory enable bit in our
virtualized config space.  There's really no need however to
ever fault a user on a VF though as this would only indicate an
error in the user's management of the enable bit, versus a PF
where the same access could trigger hardware faults.

Fixes: abafbc551f ("vfio-pci: Invalidate mmaps and block MMIO access on disabled memory")
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:38 +02:00
Tim Froidcoeur
d370e95778 net: initialize fastreuse on inet_inherit_port
commit d76f3351ce upstream.

In the case of TPROXY, bind_conflict optimizations for SO_REUSEADDR or
SO_REUSEPORT are broken, possibly resulting in O(n) instead of O(1) bind
behaviour or in the incorrect reuse of a bind.

the kernel keeps track for each bind_bucket if all sockets in the
bind_bucket support SO_REUSEADDR or SO_REUSEPORT in two fastreuse flags.
These flags allow skipping the costly bind_conflict check when possible
(meaning when all sockets have the proper SO_REUSE option).

For every socket added to a bind_bucket, these flags need to be updated.
As soon as a socket that does not support reuse is added, the flag is
set to false and will never go back to true, unless the bind_bucket is
deleted.

Note that there is no mechanism to re-evaluate these flags when a socket
is removed (this might make sense when removing a socket that would not
allow reuse; this leaves room for a future patch).

For this optimization to work, it is mandatory that these flags are
properly initialized and updated.

When a child socket is created from a listen socket in
__inet_inherit_port, the TPROXY case could create a new bind bucket
without properly initializing these flags, thus preventing the
optimization to work. Alternatively, a socket not allowing reuse could
be added to an existing bind bucket without updating the flags, causing
bind_conflict to never be called as it should.

Call inet_csk_update_fastreuse when __inet_inherit_port decides to create
a new bind_bucket or use a different bind_bucket than the one of the
listen socket.

Fixes: 093d282321 ("tproxy: fix hash locking issue when using port redirection in __inet_inherit_port()")
Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Tim Froidcoeur <tim.froidcoeur@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Tim Froidcoeur <tim.froidcoeur@tessares.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:38 +02:00