]> git.proxmox.com Git - mirror_ubuntu-kernels.git/log
mirror_ubuntu-kernels.git
18 months agoUBUNTU: SAUCE: scripts: rust: drop is_rust_module.sh
Andrea Righi [Mon, 13 Feb 2023 16:29:14 +0000 (17:29 +0100)]
UBUNTU: SAUCE: scripts: rust: drop is_rust_module.sh

BugLink: https://bugs.launchpad.net/bugs/2007654
With the constraint "!DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE" to
enable Rust we don't need is_rust_module.sh anymore, since
'pahole --lang_exclude=rust' has already the capability to exclude Rust
compilation units, so let's just drop this script.

Link: https://lore.kernel.org/bpf/20230111152050.559334-1-yakoyoku@gmail.com/
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: rust: fix regexp in scripts/is_rust_module.sh
Andrea Righi [Fri, 10 Feb 2023 15:11:46 +0000 (16:11 +0100)]
UBUNTU: SAUCE: rust: fix regexp in scripts/is_rust_module.sh

BugLink: https://bugs.launchpad.net/bugs/2007654
nm can use "R" or "r" to show read-only data sections, but
scripts/is_rust_module.sh can only recognize "r", so with some versions
of binutils it can fail to detect if a module is a Rust module or not.

Right now we're using this script only to determine if we need to skip
BTF generation (that is disabled globally if CONFIG_RUST is enabled),
but it's still nice to fix this script to do the proper job.

Moreover, with this patch applied I can also relax the constraint of
"RUST depends on !DEBUG_INFO_BTF" and build a kernel with Rust and BTF
enabled at the same time (of course BTF generation is still skipped for
Rust modules).

(cherry-picked from https://lore.kernel.org/lkml/CQFMIYLWW6ZO.3LCN13CG142KC@vincent-arch/T/)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] propagate makefile variables to kernelconfig
Andrea Righi [Sat, 11 Feb 2023 10:31:09 +0000 (11:31 +0100)]
UBUNTU: [Packaging] propagate makefile variables to kernelconfig

BugLink: https://bugs.launchpad.net/bugs/2007654
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: Makefile: replace rsync with tar
Andrea Righi [Wed, 8 Mar 2023 10:40:32 +0000 (11:40 +0100)]
UBUNTU: SAUCE: Makefile: replace rsync with tar

rsync has been removed from the i386 archives starting with lunar,
causing build errors when generating kernel packages for this
architecture.

Replace rsync with tar for now, until we decide to drop i386 completely.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Config] Enable CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM
Chris Chiu [Tue, 7 Mar 2023 17:19:01 +0000 (01:19 +0800)]
UBUNTU: [Config] Enable CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM

BugLink: https://bugs.launchpad.net/bugs/2009024
Enable it to make sure the audio output is working when system
booting with the external monitor connected via docking station.

Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] debian/rules: Honor 'do_skip_checks' for builds
Juerg Haefliger [Wed, 8 Mar 2023 08:25:25 +0000 (09:25 +0100)]
UBUNTU: [Packaging] debian/rules: Honor 'do_skip_checks' for builds

One of the build steps is a config check to ensure that the generated
configs are as expected. For mainline builds, this sometimes isn't the
case but we don't care so skip that check if 'do_skip_checks' is true
(which is the case for mainline builds).

Ignore: yes
Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Ubuntu-6.2.0-1.1
Andrea Righi [Tue, 7 Mar 2023 17:45:32 +0000 (18:45 +0100)]
UBUNTU: Ubuntu-6.2.0-1.1

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: debian/dkms-versions -- update from kernel-versions (main/master)
Andrea Righi [Tue, 7 Mar 2023 17:10:47 +0000 (18:10 +0100)]
UBUNTU: debian/dkms-versions -- update from kernel-versions (main/master)

BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: link-to-tracker: update tracking bug
Andrea Righi [Tue, 7 Mar 2023 16:47:20 +0000 (17:47 +0100)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/2009621
Properties: no-test-build
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Start new release
Andrea Righi [Tue, 7 Mar 2023 16:44:31 +0000 (17:44 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: Revert "arm64/fpsimd: Make kernel_neon_ API _GPL"
Andrea Righi [Tue, 7 Mar 2023 17:43:18 +0000 (18:43 +0100)]
UBUNTU: SAUCE: Revert "arm64/fpsimd: Make kernel_neon_ API _GPL"

Temporarily revert commmit aaeca9845643 ("arm64/fpsimd: Make
kernel_neon_ API _GPL"), that is currently breaking zfs.

When zfs will be fixed we can drop this SAUCE patch.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Config] define CONFIG_SECURITY_APPARMOR_RESTRICT_USERNS
Andrea Righi [Tue, 7 Mar 2023 07:00:38 +0000 (08:00 +0100)]
UBUNTU: [Config] define CONFIG_SECURITY_APPARMOR_RESTRICT_USERNS

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: apparmor: add user namespace creation mediation
John Johansen [Fri, 9 Sep 2022 23:00:09 +0000 (16:00 -0700)]
UBUNTU: SAUCE: apparmor: add user namespace creation mediation

BugLink: https://bugs.launchpad.net/bugs/1989983
Unprivileged user namespace creation is often used as a first step
in privilege escalation attacks. Instead of disabling it at the
sysrq level, which blocks its legitimate use as for setting up a sandbox,
allow control on a per domain basis.

This allows an admin to quickly lock down a system while also still
allowing legitimate use.

BugLink: https://bugs.launchpad.net/bugs/1989983
Signed-off-by: John Johansen <john.johansen@canonical.com>
[ adjustments to apply the patch from 5.19 ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: apparmor: Add fine grained mediation of posix mqueues
John Johansen [Mon, 13 Dec 2021 23:46:09 +0000 (15:46 -0800)]
UBUNTU: SAUCE: apparmor: Add fine grained mediation of posix mqueues

BugLink: https://bugs.launchpad.net/bugs/1989983
Add fine grained mediation of posix mqueues. Specifically this patch
adds support for differentiating mqueues based on the name in the ipc
namespace. A follow on patch will add support for implied labels, and
a third patch explicit labels. This is done in part because of
dependencies on other patches to apparmor core.

BugLink: https://bugs.launchpad.net/bugs/1989983
Signed-off-by: John Johansen <john.johansen@canonical.com>
[ adjustments to port the patch from 5.19 ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoLinux 6.2.2
Greg Kroah-Hartman [Fri, 3 Mar 2023 10:56:18 +0000 (11:56 +0100)]
Linux 6.2.2

BugLink: https://bugs.launchpad.net/bugs/2009358
Link: https://lore.kernel.org/r/20230301180653.263532453@linuxfoundation.org
Tested-by: Ronald Warsow <rwarsow@gmx.de>
Tested-by: Luna Jernberg <droidbittin@gmail.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Slade Watkins <srw@sladewatkins.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUSB: core: Don't hold device lock while reading the "descriptors" sysfs file
Alan Stern [Tue, 31 Jan 2023 20:49:04 +0000 (15:49 -0500)]
USB: core: Don't hold device lock while reading the "descriptors" sysfs file

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 45bf39f8df7f05efb83b302c65ae3b9bc92b7065 upstream.

Ever since commit 83e83ecb79a8 ("usb: core: get config and string
descriptors for unauthorized devices") was merged in 2013, there has
been no mechanism for reallocating the rawdescriptors buffers in
struct usb_device after the initial enumeration.  Before that commit,
the buffers would be deallocated when a device was deauthorized and
reallocated when it was authorized and enumerated.

This means that the locking in the read_descriptors() routine is not
needed, since the buffers it reads will never be reallocated while the
routine is running.  This locking can interfere with user programs
trying to read a hub's descriptors via sysfs while new child devices
of the hub are being initialized, since the hub is locked during this
procedure.

Since the locking in read_descriptors() hasn't been needed for over
nine years, we can remove it.

Reported-and-tested-by: Troels Liebe Bentsen <troels@connectedcars.dk>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: stable@vger.kernel.org
Link: https://lore.kernel.org/r/Y9l+wDTRbuZABzsE@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agousb: typec: pd: Remove usb_suspend_supported sysfs from sink PDO
Saranya Gopal [Tue, 14 Feb 2023 11:45:42 +0000 (17:15 +0530)]
usb: typec: pd: Remove usb_suspend_supported sysfs from sink PDO

BugLink: https://bugs.launchpad.net/bugs/2009358
commit e4e7b2dc27c4bb877d850eaff69d41410b2f4237 upstream.

As per USB PD specification, 28th bit of fixed supply sink PDO
represents "higher capability" attribute and not "usb suspend
supported" attribute. So, this patch removes the usb_suspend_supported
attribute from sink PDO.

Fixes: 662a60102c12 ("usb: typec: Separate USB Power Delivery from USB Type-C")
Cc: stable <stable@kernel.org>
Reported-by: Rajaram Regupathy <rajaram.regupathy@intel.com>
Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20230214114543.205103-1-saranya.gopal@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoarm64: dts: uniphier: Fix property name in PXs3 USB node
Kunihiko Hayashi [Tue, 7 Feb 2023 02:14:29 +0000 (11:14 +0900)]
arm64: dts: uniphier: Fix property name in PXs3 USB node

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 2508d5efd7a588d07915a762e1731173854525f9 upstream.

The property "snps,usb2_gadget_lpm_disable" is wrong.
It should be fixed to "snps,usb2-gadget-lpm-disable".

Cc: stable@vger.kernel.org
Fixes: 19fee1a1096d ("arm64: dts: uniphier: Add USB-device support for PXs3 reference board")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/20230207021429.28925-1-hayashi.kunihiko@socionext.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agousb: gadget: u_serial: Add null pointer check in gserial_resume
Prashanth K [Mon, 13 Feb 2023 17:30:38 +0000 (23:00 +0530)]
usb: gadget: u_serial: Add null pointer check in gserial_resume

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 5ec63fdbca604568890c577753c6f66c5b3ef0b5 upstream.

Consider a case where gserial_disconnect has already cleared
gser->ioport. And if a wakeup interrupt triggers afterwards,
gserial_resume gets called, which will lead to accessing of
gser->ioport and thus causing null pointer dereference.Add
a null pointer check to prevent this.

Added a static spinlock to prevent gser->ioport from becoming
null after the newly added check.

Fixes: aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks")
Cc: stable <stable@kernel.org>
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/1676309438-14922-1-git-send-email-quic_prashk@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUSB: serial: option: add support for VW/Skoda "Carstick LTE"
Florian Zumbiehl [Mon, 6 Feb 2023 01:04:28 +0000 (02:04 +0100)]
USB: serial: option: add support for VW/Skoda "Carstick LTE"

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 617c331d91077f896111044628c096802551dc66 upstream.

Add support for VW/Skoda "Carstick LTE"

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1c9e ProdID=7605 Rev=02.00
S:  Manufacturer=USB Modem
S:  Product=USB Modem
C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA
I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I:  If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)

The stick has AT command interfaces on interfaces 1, 2, and 3, and does PPP
on interface 3.

Signed-off-by: Florian Zumbiehl <florz@florz.de>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agousb: dwc3: pci: add support for the Intel Meteor Lake-M
Heikki Krogerus [Wed, 15 Feb 2023 13:27:11 +0000 (15:27 +0200)]
usb: dwc3: pci: add support for the Intel Meteor Lake-M

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 8e5248c3a8778f3e394e9a19195bc7a48f567ca2 upstream.

This patch adds the necessary PCI IDs for Intel Meteor Lake-M
devices.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230215132711.35668-1-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agowifi: rtw88: usb: drop now unnecessary URB size check
Sascha Hauer [Fri, 10 Feb 2023 11:16:32 +0000 (12:16 +0100)]
wifi: rtw88: usb: drop now unnecessary URB size check

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 462c8db6a01160836c68e262d25566f2447148d9 upstream.

Now that we send URBs with the URB_ZERO_PACKET flag set we no longer
need to make sure that the URB sizes are not multiple of the
bulkout_size. Drop the check.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230210111632.1985205-4-s.hauer@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agowifi: rtw88: usb: send Zero length packets if necessary
Sascha Hauer [Fri, 10 Feb 2023 11:16:31 +0000 (12:16 +0100)]
wifi: rtw88: usb: send Zero length packets if necessary

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 07ce9fa6ab0e5e4cb5516a1f7c754ab2758fe5cd upstream.

Zero length packets are necessary when sending URBs with size
multiple of bulkout_size, otherwise the hardware just stalls.

Fixes: a82dfd33d1237 ("wifi: rtw88: Add common USB chip support")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230210111632.1985205-3-s.hauer@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agowifi: rtw88: usb: Set qsel correctly
Sascha Hauer [Fri, 10 Feb 2023 11:16:30 +0000 (12:16 +0100)]
wifi: rtw88: usb: Set qsel correctly

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 7869b834fb07c79933229840c98b02bbb7bd0d75 upstream.

We have to extract qsel from the skb before doing skb_push() on it,
otherwise qsel will always be 0.

Fixes: a82dfd33d1237 ("wifi: rtw88: Add common USB chip support")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230210111632.1985205-2-s.hauer@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoscripts/tags.sh: fix incompatibility with PCRE2
Carlos Llamas [Wed, 15 Feb 2023 18:38:50 +0000 (18:38 +0000)]
scripts/tags.sh: fix incompatibility with PCRE2

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 6ec363fc6142226b9ab5a6528f65333d729d2b6b upstream.

Starting with release 10.38 PCRE2 drops default support for using \K in
lookaround patterns as described in [1]. Unfortunately, scripts/tags.sh
relies on such functionality to collect all_compiled_soures() leading to
the following error:

  $ make COMPILED_SOURCE=1 tags
    GEN     tags
  grep: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)

The usage of \K for this pattern was introduced in commit 4f491bb6ea2a
("scripts/tags.sh: collect compiled source precisely") which speeds up
the generation of tags significantly.

In order to fix this issue without compromising the performance we can
switch over to an equivalent sed expression. The same matching pattern
is preserved here except \K is replaced with a backreference \1.

[1] https://www.pcre.org/current/doc/html/pcre2syntax.html#SEC11

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Jialu Xu <xujialu@vimux.org>
Cc: Vipin Sharma <vipinsh@google.com>
Cc: stable@vger.kernel.org
Fixes: 4f491bb6ea2a ("scripts/tags.sh: collect compiled source precisely")
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20230215183850.3353198-1-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agodrm/amd/display: Properly reuse completion structure
Stylon Wang [Tue, 10 Jan 2023 06:38:33 +0000 (14:38 +0800)]
drm/amd/display: Properly reuse completion structure

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 0cf8307adbc6beb5ff3b8a76afedc6e4e0b536a9 upstream.

[Why]
Connecting displays to TBT3 docks often produces invalid
replies for DPIA AUX requests. It turns out the completion
structure was not re-initialized before reusing it, resulting
in immature wake up to completion.

[How]
Properly call reinit_completion() on reused completion structure.

Cc: stable@vger.kernel.org
Reviewed-by: Solomon Chiu <solomon.chiu@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "Limonciello, Mario" <mario.limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agodrm/amd/display: Move DCN314 DOMAIN power control to DMCUB
Nicholas Kazlauskas [Mon, 23 Jan 2023 19:59:28 +0000 (14:59 -0500)]
drm/amd/display: Move DCN314 DOMAIN power control to DMCUB

BugLink: https://bugs.launchpad.net/bugs/2009358
commit e383b12709e32d6494c948422070c2464b637e44 upstream.

[Why]
DOMAIN power gating control is now required to be done via firmware
due to interlock with other power features. This is to avoid
intermittent issues in the LB memories.

[How]
If the firmware supports the command then use the new firmware as
the sequence can avoid potential display corruption issues.

The command will be ignored on firmware that does not support DOMAIN
power control and the pipes will remain always on - frequent PG cycling
can cause the issue to occur on the old sequence, so we should avoid it.

Reviewed-by: Hansen Dsouza <hansen.dsouza@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agovc_screen: don't clobber return value in vcs_read
Thomas Weißschuh [Mon, 20 Feb 2023 06:46:12 +0000 (06:46 +0000)]
vc_screen: don't clobber return value in vcs_read

BugLink: https://bugs.launchpad.net/bugs/2009358
commit ae3419fbac845b4d3f3a9fae4cc80c68d82cdf6e upstream.

Commit 226fae124b2d ("vc_screen: move load of struct vc_data pointer in
vcs_read() to avoid UAF") moved the call to vcs_vc() into the loop.

While doing this it also moved the unconditional assignment of

ret = -ENXIO;

This unconditional assignment was valid outside the loop but within it
it clobbers the actual value of ret.

To avoid this only assign "ret = -ENXIO" when actually needed.

[ Also, the 'goto unlock_out" needs to be just a "break", so that it
  does the right thing when it exits on later iterations when partial
  success has happened - Linus ]

Reported-by: Storm Dragon <stormdragon2976@gmail.com>
Link: https://lore.kernel.org/lkml/Y%2FKS6vdql2pIsCiI@hotmail.com/
Fixes: 226fae124b2d ("vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/lkml/64981d94-d00c-4b31-9063-43ad0a384bde@t-8ch.de/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agobpf: bpf_fib_lookup should not return neigh in NUD_FAILED state
Martin KaFai Lau [Fri, 17 Feb 2023 00:41:48 +0000 (16:41 -0800)]
bpf: bpf_fib_lookup should not return neigh in NUD_FAILED state

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 1fe4850b34ab512ff911e2c035c75fb6438f7307 upstream.

The bpf_fib_lookup() helper does not only look up the fib (ie. route)
but it also looks up the neigh. Before returning the neigh, the helper
does not check for NUD_VALID. When a neigh state (neigh->nud_state)
is in NUD_FAILED, its dmac (neigh->ha) could be all zeros. The helper
still returns SUCCESS instead of NO_NEIGH in this case. Because of the
SUCCESS return value, the bpf prog directly uses the returned dmac
and ends up filling all zero in the eth header.

This patch checks for NUD_VALID and returns NO_NEIGH if the neigh is
not valid.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230217004150.2980689-3-martin.lau@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agocrypto: arm64/sm4-gcm - Fix possible crash in GCM cryption
Herbert Xu [Thu, 2 Feb 2023 08:33:47 +0000 (16:33 +0800)]
crypto: arm64/sm4-gcm - Fix possible crash in GCM cryption

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 4e4a08868f15897ca236528771c3733fded42c62 upstream.

An often overlooked aspect of the skcipher walker API is that an
error is not just indicated by a non-zero return value, but by the
fact that walk->nbytes is zero.

Thus it is an error to call skcipher_walk_done after getting back
walk->nbytes == 0 from the previous interaction with the walker.

This is because when walk->nbytes is zero the walker is left in
an undefined state and any further calls to it may try to free
uninitialised stack memory.

The sm4 arm64 ccm code gets this wrong and ends up calling
skcipher_walk_done even when walk->nbytes is zero.

This patch rewrites the loop in a form that resembles other callers.

Reported-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Fixes: ae1b83c7d572 ("crypto: arm64/sm4 - add CE implementation for GCM mode")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoALSA: hda: cs35l41: Correct error condition handling
Vitaly Rodionov [Mon, 13 Feb 2023 14:50:06 +0000 (14:50 +0000)]
ALSA: hda: cs35l41: Correct error condition handling

BugLink: https://bugs.launchpad.net/bugs/2009358
commit 943f4e64ee177cf44d7f2c235281fcda7c32bb28 upstream.

Function cs_dsp_coeff_write_ctrl() can return 3 possible values:
0 - no change, 1 - value has changed and -1 - error, so positive value
is not an error.
Fixes: 7406bdbc4fb8 ("ASoC: wm_adsp: Return whether changed when writing controls")
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230213145008.1215849-2-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] disable signing for ppc64el
Andrea Righi [Fri, 3 Mar 2023 09:48:19 +0000 (10:48 +0100)]
UBUNTU: [Packaging] disable signing for ppc64el

ppc64el is the only remaining architecture that hasn't been verified by
IBM with the secure boot / kernel lockdown feature.

Disable signing for now, until we get proper test results.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoLinux 6.2.1
Greg Kroah-Hartman [Sat, 25 Feb 2023 10:13:30 +0000 (11:13 +0100)]
Linux 6.2.1

BugLink: https://bugs.launchpad.net/bugs/2009127
Link: https://lore.kernel.org/r/20230223130426.170746546@linuxfoundation.org
Link: https://lore.kernel.org/r/20230223141539.893173089@linuxfoundation.org
Tested-by: Luna Jernberg <droidbittin@gmail.com>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Slade Watkins <srw@sladewatkins.net>
Tested-by: Allen Pais <apais@linux.microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agobpf: add missing header file include
Linus Torvalds [Wed, 22 Feb 2023 17:52:32 +0000 (09:52 -0800)]
bpf: add missing header file include

BugLink: https://bugs.launchpad.net/bugs/2009127
commit f3dd0c53370e70c0f9b7e931bbec12916f3bb8cc upstream.

Commit 74e19ef0ff80 ("uaccess: Add speculation barrier to
copy_from_user()") built fine on x86-64 and arm64, and that's the extent
of my local build testing.

It turns out those got the <linux/nospec.h> include incidentally through
other header files (<linux/kvm_host.h> in particular), but that was not
true of other architectures, resulting in build errors

  kernel/bpf/core.c: In function ‘___bpf_prog_run’:
  kernel/bpf/core.c:1913:3: error: implicit declaration of function ‘barrier_nospec’

so just make sure to explicitly include the proper <linux/nospec.h>
header file to make everybody see it.

Fixes: 74e19ef0ff80 ("uaccess: Add speculation barrier to copy_from_user()")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
Reported-by: Huacai Chen <chenhuacai@loongson.cn>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agorandstruct: disable Clang 15 support
Eric Biggers [Wed, 8 Feb 2023 06:51:33 +0000 (22:51 -0800)]
randstruct: disable Clang 15 support

BugLink: https://bugs.launchpad.net/bugs/2009127
commit 78f7a3fd6dc66cb788c21d7705977ed13c879351 upstream.

The randstruct support released in Clang 15 is unsafe to use due to a
bug that can cause miscompilations: "-frandomize-layout-seed
inconsistently randomizes all-function-pointers structs"
(https://github.com/llvm/llvm-project/issues/60349).  It has been fixed
on the Clang 16 release branch, so add a Clang version check.

Fixes: 035f7f87b729 ("randstruct: Enable Clang support")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Bill Wendling <morbo@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230208065133.220589-1-ebiggers@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoext4: Fix function prototype mismatch for ext4_feat_ktype
Kees Cook [Wed, 4 Jan 2023 21:09:12 +0000 (13:09 -0800)]
ext4: Fix function prototype mismatch for ext4_feat_ktype

BugLink: https://bugs.launchpad.net/bugs/2009127
commit 118901ad1f25d2334255b3d50512fa20591531cd upstream.

With clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG),
indirect call targets are validated against the expected function
pointer prototype to make sure the call target is valid to help mitigate
ROP attacks. If they are not identical, there is a failure at run time,
which manifests as either a kernel panic or thread getting killed.

ext4_feat_ktype was setting the "release" handler to "kfree", which
doesn't have a matching function prototype. Add a simple wrapper
with the correct prototype.

This was found as a result of Clang's new -Wcast-function-type-strict
flag, which is more sensitive than the simpler -Wcast-function-type,
which only checks for type width mismatches.

Note that this code is only reached when ext4 is a loadable module and
it is being unloaded:

 CFI failure at kobject_put+0xbb/0x1b0 (target: kfree+0x0/0x180; expected type: 0x7c4aa698)
 ...
 RIP: 0010:kobject_put+0xbb/0x1b0
 ...
 Call Trace:
  <TASK>
  ext4_exit_sysfs+0x14/0x60 [ext4]
  cleanup_module+0x67/0xedb [ext4]

Fixes: b99fee58a20a ("ext4: create ext4_feat kobject dynamically")
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Eric Biggers <ebiggers@kernel.org>
Cc: stable@vger.kernel.org
Build-tested-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20230103234616.never.915-kees@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20230104210908.gonna.388-kees@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoplatform/x86: nvidia-wmi-ec-backlight: Add force module parameter
Hans de Goede [Fri, 17 Feb 2023 14:42:08 +0000 (15:42 +0100)]
platform/x86: nvidia-wmi-ec-backlight: Add force module parameter

BugLink: https://bugs.launchpad.net/bugs/2009127
commit 0d9bdd8a550170306c2021b8d6766c5343b870c2 upstream.

On some Lenovo Legion models, the backlight might be driven by either
one of nvidia_wmi_ec_backlight or amdgpu_bl0 at different times.

When the Nvidia WMI EC backlight interface reports the backlight is
controlled by the EC, the current backlight handling only registers
nvidia_wmi_ec_backlight (and registers no other backlight interfaces).

This hides (never registers) the amdgpu_bl0 interface, where as prior
to 6.1.4 users would have both nvidia_wmi_ec_backlight and amdgpu_bl0
and could work around things in userspace.

Add a force module parameter which can be used with acpi_backlight=native
to restore the old behavior as a workound (for now) by passing:

"acpi_backlight=native nvidia-wmi-ec-backlight.force=1"

Fixes: 8d0ca287fd8c ("platform/x86: nvidia-wmi-ec-backlight: Use acpi_video_get_backlight_type()")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217026
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
Link: https://lore.kernel.org/r/20230217144208.5721-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoplatform/x86/amd/pmf: Add depends on CONFIG_POWER_SUPPLY
Shyam Sundar S K [Mon, 13 Feb 2023 12:14:57 +0000 (17:44 +0530)]
platform/x86/amd/pmf: Add depends on CONFIG_POWER_SUPPLY

BugLink: https://bugs.launchpad.net/bugs/2009127
commit 3004e8d2a0a98bbf4223ae146464fadbff68bf78 upstream.

It is reported that amd_pmf driver is missing "depends on" for
CONFIG_POWER_SUPPLY causing the following build error.

ld: drivers/platform/x86/amd/pmf/core.o: in function `amd_pmf_remove':
core.c:(.text+0x10): undefined reference to `power_supply_unreg_notifier'
ld: drivers/platform/x86/amd/pmf/core.o: in function `amd_pmf_probe':
core.c:(.text+0x38f): undefined reference to `power_supply_reg_notifier'
make[1]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1
make: *** [Makefile:1248: vmlinux] Error 2

Add this to the Kconfig file.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217028
Fixes: c5258d39fc4c ("platform/x86/amd/pmf: Add helper routine to update SPS thermals")
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20230213121457.1764463-1-Shyam-sundar.S-k@amd.com
Cc: stable@vger.kernel.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoaudit: update the mailing list in MAINTAINERS
Paul Moore [Tue, 7 Feb 2023 15:21:47 +0000 (10:21 -0500)]
audit: update the mailing list in MAINTAINERS

BugLink: https://bugs.launchpad.net/bugs/2009127
commit 6c6cd913accd77008f74a1a9d57b816db3651daa upstream.

We've moved the upstream Linux Kernel audit subsystem discussions to
a new mailing list, this patch updates the MAINTAINERS info with the
new list address.

Marking this for stable inclusion to help speed uptake of the new
list across all of the supported kernel releases.  This is a doc only
patch so the risk should be close to nil.

Cc: stable@vger.kernel.org
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agowifi: mwifiex: Add missing compatible string for SD8787
Lukas Wunner [Fri, 27 Jan 2023 14:01:00 +0000 (15:01 +0100)]
wifi: mwifiex: Add missing compatible string for SD8787

BugLink: https://bugs.launchpad.net/bugs/2009127
commit 36dd7a4c6226133b0b7aa92b8e604e688d958d0c upstream.

Commit e3fffc1f0b47 ("devicetree: document new marvell-8xxx and
pwrseq-sd8787 options") documented a compatible string for SD8787 in
the devicetree bindings, but neglected to add it to the mwifiex driver.

Fixes: e3fffc1f0b47 ("devicetree: document new marvell-8xxx and pwrseq-sd8787 options")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: stable@vger.kernel.org # v4.11+
Cc: Matt Ranostay <mranostay@ti.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/320de5005ff3b8fd76be2d2b859fd021689c3681.1674827105.git.lukas@wunner.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoHID: mcp-2221: prevent UAF in delayed work
Benjamin Tissoires [Thu, 16 Feb 2023 10:22:58 +0000 (11:22 +0100)]
HID: mcp-2221: prevent UAF in delayed work

BugLink: https://bugs.launchpad.net/bugs/2009127
commit 47e91fdfa511139f2549687edb0d8649b123227b upstream.

If the device is plugged/unplugged without giving time for mcp_init_work()
to complete, we might kick in the devm free code path and thus have
unavailable struct mcp_2221 while in delayed work.

Canceling the delayed_work item is enough to solve the issue, because
cancel_delayed_work_sync will prevent the work item to requeue itself.

Fixes: 960f9df7c620 ("HID: mcp2221: add ADC/DAC support via iio subsystem")
CC: stable@vger.kernel.org
Acked-by: Jiri Kosina <jkosina@suse.cz>
Link: https://lore.kernel.org/r/20230215-wip-mcp2221-v2-1-109f71fd036e@redhat.com
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agox86/static_call: Add support for Jcc tail-calls
Peter Zijlstra [Thu, 26 Jan 2023 15:34:27 +0000 (16:34 +0100)]
x86/static_call: Add support for Jcc tail-calls

BugLink: https://bugs.launchpad.net/bugs/2009127
commit 923510c88d2b7d947c4217835fd9ca6bd65cc56c upstream.

Clang likes to create conditional tail calls like:

  0000000000000350 <amd_pmu_add_event>:
  350:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1) 351: R_X86_64_NONE      __fentry__-0x4
  355:       48 83 bf 20 01 00 00 00         cmpq   $0x0,0x120(%rdi)
  35d:       0f 85 00 00 00 00       jne    363 <amd_pmu_add_event+0x13>     35f: R_X86_64_PLT32     __SCT__amd_pmu_branch_add-0x4
  363:       e9 00 00 00 00          jmp    368 <amd_pmu_add_event+0x18>     364: R_X86_64_PLT32     __x86_return_thunk-0x4

Where 0x35d is a static call site that's turned into a conditional
tail-call using the Jcc class of instructions.

Teach the in-line static call text patching about this.

Notably, since there is no conditional-ret, in that case patch the Jcc
to point at an empty stub function that does the ret -- or the return
thunk when needed.

Reported-by: "Erhard F." <erhard_f@mailbox.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/Y9Kdg9QjHkr9G5b5@hirez.programming.kicks-ass.net
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agox86/alternatives: Teach text_poke_bp() to patch Jcc.d32 instructions
Peter Zijlstra [Mon, 23 Jan 2023 20:59:17 +0000 (21:59 +0100)]
x86/alternatives: Teach text_poke_bp() to patch Jcc.d32 instructions

BugLink: https://bugs.launchpad.net/bugs/2009127
commit ac0ee0a9560c97fa5fe1409e450c2425d4ebd17a upstream.

In order to re-write Jcc.d32 instructions text_poke_bp() needs to be
taught about them.

The biggest hurdle is that the whole machinery is currently made for 5
byte instructions and extending this would grow struct text_poke_loc
which is currently a nice 16 bytes and used in an array.

However, since text_poke_loc contains a full copy of the (s32)
displacement, it is possible to map the Jcc.d32 2 byte opcodes to
Jcc.d8 1 byte opcode for the int3 emulation.

This then leaves the replacement bytes; fudge that by only storing the
last 5 bytes and adding the rule that 'length == 6' instruction will
be prefixed with a 0x0f byte.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20230123210607.115718513@infradead.org
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agox86/alternatives: Introduce int3_emulate_jcc()
Peter Zijlstra [Mon, 23 Jan 2023 20:59:16 +0000 (21:59 +0100)]
x86/alternatives: Introduce int3_emulate_jcc()

BugLink: https://bugs.launchpad.net/bugs/2009127
commit db7adcfd1cec4e95155e37bc066fddab302c6340 upstream.

Move the kprobe Jcc emulation into int3_emulate_jcc() so it can be
used by more code -- specifically static_call() will need this.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20230123210607.057678245@infradead.org
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agouaccess: Add speculation barrier to copy_from_user()
Dave Hansen [Tue, 21 Feb 2023 20:30:15 +0000 (12:30 -0800)]
uaccess: Add speculation barrier to copy_from_user()

BugLink: https://bugs.launchpad.net/bugs/2009127
commit 74e19ef0ff8061ef55957c3abd71614ef0f42f47 upstream.

The results of "access_ok()" can be mis-speculated.  The result is that
you can end speculatively:

if (access_ok(from, size))
// Right here

even for bad from/size combinations.  On first glance, it would be ideal
to just add a speculation barrier to "access_ok()" so that its results
can never be mis-speculated.

But there are lots of system calls just doing access_ok() via
"copy_to_user()" and friends (example: fstat() and friends).  Those are
generally not problematic because they do not _consume_ data from
userspace other than the pointer.  They are also very quick and common
system calls that should not be needlessly slowed down.

"copy_from_user()" on the other hand uses a user-controller pointer and
is frequently followed up with code that might affect caches.  Take
something like this:

if (!copy_from_user(&kernelvar, uptr, size))
do_something_with(kernelvar);

If userspace passes in an evil 'uptr' that *actually* points to a kernel
addresses, and then do_something_with() has cache (or other)
side-effects, it could allow userspace to infer kernel data values.

Add a barrier to the common copy_from_user() code to prevent
mis-speculated values which happen after the copy.

Also add a stub for architectures that do not define barrier_nospec().
This makes the macro usable in generic code.

Since the barrier is now usable in generic code, the x86 #ifdef in the
BPF code can also go away.

Reported-by: Jordy Zomer <jordyzomer@google.com>
Suggested-by: Linus Torvalds <torvalds@linuxfoundation.org>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Daniel Borkmann <daniel@iogearbox.net> # BPF bits
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] update variants
Andrea Righi [Fri, 3 Mar 2023 07:47:52 +0000 (08:47 +0100)]
UBUNTU: [Packaging] update variants

BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] rename package to linux
Andrea Righi [Fri, 3 Mar 2023 07:43:54 +0000 (08:43 +0100)]
UBUNTU: [Packaging] rename package to linux

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agowifi: mt76: mt7921: fix error code of return in mt7921_acpi_read
Aaron Ma [Fri, 3 Mar 2023 07:29:18 +0000 (15:29 +0800)]
wifi: mt76: mt7921: fix error code of return in mt7921_acpi_read

BugLink: https://bugs.launchpad.net/bugs/2009118
Kernel NULL pointer dereference when ACPI SAR table isn't implemented well.
Fix the error code of return to mark the ACPI SAR table as invalid.

[    5.077128] mt7921e 0000:06:00.0: sar cnt = 0
[    5.077381] BUG: kernel NULL pointer dereference, address:
0000000000000004
[    5.077630] #PF: supervisor read access in kernel mode
[    5.077883] #PF: error_code(0x0000) - not-present page
[    5.078138] PGD 0 P4D 0
[    5.078398] Oops: 0000 [#1] PREEMPT SMP NOPTI
[    5.079202] RIP: 0010:mt7921_init_acpi_sar+0x106/0x220
[mt7921_common]
...
[    5.080786] Call Trace:
[    5.080786]  <TASK>
[    5.080786]  mt7921_register_device+0x37d/0x490 [mt7921_common]
[    5.080786]  mt7921_pci_probe.part.0+0x2ee/0x310 [mt7921e]
[    5.080786]  mt7921_pci_probe+0x52/0x70 [mt7921e]
[    5.080786]  local_pci_probe+0x47/0x90
[    5.080786]  pci_call_probe+0x55/0x190
[    5.080786]  pci_device_probe+0x84/0x120

Fixes: f965333e491e ("mt76: mt7921: introduce ACPI SAR support")
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 888d89034f9eaeab9b5b75f13dbe35376c7dd471)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: overlayfs: handle idmapped mounts in ovl_do_(set|remove)xattr
Alexander Mikhalitsyn [Thu, 2 Mar 2023 21:23:55 +0000 (22:23 +0100)]
UBUNTU: SAUCE: overlayfs: handle idmapped mounts in ovl_do_(set|remove)xattr

BugLink: http://bugs.launchpad.net/bugs/2009065
We have to use ovl_upper_mnt_userns(ofs) helper to get proper user namespace
for idmapped layer. Otherwise we'll get -EPERM.

Right now, overlayfs on top of idmapped layer always mounted as read-only.
This is serious blocker for LXD/LXC unprivileged containers users who run
Docker containers inside.

Reproducer:
$ cd /idmapped/mount/path
$ mkdir {work,upper,lower,ovl}
$ mount -t overlay overlay -o lowerdir=lower,upperdir=upper,workdir=work ovl
$ touch ovl/test
touch: cannot touch 'ovl/test': Read-only file system

Error from dmesg:
overlayfs: failed to create directory work/work (errno: 1); mounting read-only

Reproducible on all Ubuntu kernels with the base >= 5.19

Fixes: eea996a46f ("UBUNTU: SAUCE: overlayfs: Skip permission checking for trusted.overlayfs.* xattrs")
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agodrm/i915/display: Prune Interlace modes for Display >=12
Ankit Nautiyal [Thu, 5 Jan 2023 12:41:25 +0000 (18:11 +0530)]
drm/i915/display: Prune Interlace modes for Display >=12

BugLink: https://bugs.launchpad.net/bugs/1993561
Defeature Display Interlace support.
Support for interlace modes is removed from Gen 12 onwards.
Pruning the interlace modes for HDMI for Display >=12.
Bspec: 50490

v2: Add check for both DP and HDMI. (Ville)
Get rid of redundant check for interlace mode in modevalid. (Ville)

v3: Simplify the condition to avoid interlace modes. (Jani)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230105124125.1129653-1-ankit.k.nautiyal@intel.com
(cherry picked from commit f71c9b7bc35ff7c1fb68d114903876eec658439b)
Signed-off-by: Koba Ko <koba.ko@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agodrm/i915/display: Drop check for doublescan mode in modevalid
Ankit Nautiyal [Fri, 10 Feb 2023 06:30:53 +0000 (14:30 +0800)]
drm/i915/display: Drop check for doublescan mode in modevalid

BugLink: https://bugs.launchpad.net/bugs/1993561
Since the DP/HDMI connector do not set connector->doublescan_allowed,
the doublescan modes will get automatically filtered during
drm_helper_probe_single_connector_modes().

Therefore check for double scan modes is not required and is dropped
from modevalid functions for both DP and HDMI.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221017143038.1748319-2-ankit.k.nautiyal@intel.com
(cherry picked from commit 9d04eb20bc71a383b4d4e383b0b7fac8d38a2e34)
Signed-off-by: Koba Ko <koba.ko@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: drm/i915/display/psr: Disable PSR2 sel fetch on panel SHP 5457
Kai-Heng Feng [Fri, 24 Feb 2023 16:18:20 +0000 (00:18 +0800)]
UBUNTU: SAUCE: drm/i915/display/psr: Disable PSR2 sel fetch on panel SHP 5457

BugLink: https://bugs.launchpad.net/bugs/2007516
There's a panel on XPS 9320 flickers since PSR2 sel fetch became enabled
by default on Linux kernel >= 5.16.

Vendor & Product Identification:
 Manufacturer: SHP
 Model: 5457

Temporarily disable PSR2 sel fetch so the panel falls back to use PSR1
while Intel GFX devs are working on the issue [0].

[0] https://gitlab.freedesktop.org/drm/intel/-/issues/7836

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agos390/mm: add support for RDP (Reset DAT-Protection)
Gerald Schaefer [Tue, 28 Feb 2023 14:08:09 +0000 (15:08 +0100)]
s390/mm: add support for RDP (Reset DAT-Protection)

BugLink: https://bugs.launchpad.net/bugs/1982378
RDP instruction allows to reset DAT-protection bit in a PTE, with less
CPU synchronization overhead than IPTE instruction. In particular, IPTE
can cause machine-wide synchronization overhead, and excessive IPTE usage
can negatively impact machine performance.

RDP can be used instead of IPTE, if the new PTE only differs in SW bits
and _PAGE_PROTECT HW bit, for PTE protection changes from RO to RW.
SW PTE bit changes are allowed, e.g. for dirty and young tracking, but none
of the other HW-defined part of the PTE must change. This is because the
architecture forbids such changes to an active and valid PTE, which
is why invalidation with IPTE is always used first, before writing a new
entry.

The RDP optimization helps mainly for fault-driven SW dirty-bit tracking.
Writable PTEs are initially always mapped with HW _PAGE_PROTECT bit set,
to allow SW dirty-bit accounting on first write protection fault, where
the DAT-protection would then be reset. The reset is now done with RDP
instead of IPTE, if RDP instruction is available.

RDP cannot always guarantee that the DAT-protection reset is propagated
to all CPUs immediately. This means that spurious TLB protection faults
on other CPUs can now occur. For this, common code provides a
flush_tlb_fix_spurious_fault() handler, which will now be used to do a
CPU-local TLB flush. However, this will clear the whole TLB of a CPU, and
not just the affected entry. For more fine-grained flushing, by simply
doing a (local) RDP again, flush_tlb_fix_spurious_fault() would need to
also provide the PTE pointer.

Note that spurious TLB protection faults cannot really be distinguished
from racing pagetable updates, where another thread already installed the
correct PTE. In such a case, the local TLB flush would be unnecessary
overhead, but overall reduction of CPU synchronization overhead by not
using IPTE is still expected to be beneficial.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
(cherry picked from commit 0807b856521f3313d3912ebb52a9144215c4ff08)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agos390/zcrypt: introduce ctfm field in struct CPRBX
Harald Freudenberger [Tue, 28 Feb 2023 14:14:21 +0000 (15:14 +0100)]
s390/zcrypt: introduce ctfm field in struct CPRBX

BugLink: https://bugs.launchpad.net/bugs/2003637
Modify the CPRBX struct to expose a new field ctfm for use with hardware
command filtering within a CEX8 crypto card in CCA coprocessor mode.

The field replaces a reserved byte padding field so that the layout of the
struct and the size does not change.

The new field is used only by user space applications which may use this to
expose the HW filtering facilities in the crypto firmware layers.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
(cherry picked from commit ad0faae6ceab7d138dddf9a58eab7151c519e0d3)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: Revert "fbdev: Make registered_fb[] private to fbmem.c"
Andrea Righi [Fri, 24 Feb 2023 10:46:28 +0000 (11:46 +0100)]
UBUNTU: SAUCE: Revert "fbdev: Make registered_fb[] private to fbmem.c"

This reverts commit 5727dcfd8486 ("fbdev: Make registered_fb[] private
to fbmem.c") that is currently breaking nvidia-510 and
nvidia-515-server.

This patch can be safely dropped once nvidia will correctly support
newer kernels.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: selftest: rtcpie: Force passing unreliable subtest
Andrei Gherzan [Mon, 20 Feb 2023 13:04:57 +0000 (13:04 +0000)]
UBUNTU: SAUCE: selftest: rtcpie: Force passing unreliable subtest

BugLink: https://bugs.launchpad.net/bugs/1814234
Since 0b63accf87225b5eb7e52814c374cf02d733d4bb, the test includes a
verification of time passage that is unstable as it is prone to
different results based on the system load.

Other investigations led to disabling this test in various other
places/projects. For example, Linaro also disabled it[1].

We have chosen to keep this test but to force its result unconditionally
successful as opposed to reverting the aforementioned commit because:
1. it keeps running the test with results and data that we can use in
   the future for any "smarter" way to deal with it - eg. statistical
   approach
2. it minimizes the maintenance burden of this patch kept in our kernel
   trees

It is worth mentioning that upstream was contacted via the mailing list
with no feedback[2]. The request was to increase the current tolerance
set at 10%.

[1] https://bugs.linaro.org/show_bug.cgi?id=3402#c9
[2] https://lore.kernel.org/lkml/a304b6f1-11db-543b-2cb3-372f34dc7697@linaro.org/

Signed-off-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agos390/ipl: add loadparm parameter to eckd ipl/reipl data
Sven Schnelle [Tue, 21 Feb 2023 16:53:26 +0000 (17:53 +0100)]
s390/ipl: add loadparm parameter to eckd ipl/reipl data

BugLink: https://bugs.launchpad.net/bugs/2003394
commit 87fd22e0ae92 ("s390/ipl: add eckd support") missed to add the
loadparm attribute to the new eckd ipl/reipl data.

Fixes: 87fd22e0ae92 ("s390/ipl: add eckd support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
(cherry picked from commit 6bb361d5d8eb1dbc9e0b190eeee27a2ac4d1119f linux-next)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agos390/ipl: add DEFINE_GENERIC_LOADPARM()
Sven Schnelle [Tue, 21 Feb 2023 16:53:25 +0000 (17:53 +0100)]
s390/ipl: add DEFINE_GENERIC_LOADPARM()

BugLink: https://bugs.launchpad.net/bugs/2003394
In the current code each reipl type implements its own pair of loadparm
show/store functions. Add a macro to deduplicate the code a bit.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Fixes: 87fd22e0ae92 ("s390/ipl: add eckd support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
(cherry picked from commit c676aac66f5b2b03a1090bc6b1891486255f7159 linux-next)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type
Louis Rannou [Fri, 3 Feb 2023 07:07:54 +0000 (09:07 +0200)]
UBUNTU: SAUCE: mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type

spi_nor_set_erase_type() was used either to set or to mask out an erase
type. When we used it to mask out an erase type a shift-out-of-bounds
was hit:
UBSAN: shift-out-of-bounds in drivers/mtd/spi-nor/core.c:2237:24
shift exponent 4294967295 is too large for 32-bit type 'int'

The setting of the size_{shift, mask} and of the opcode are unnecessary
when the erase size is zero, as throughout the code just the erase size
is considered to determine whether an erase type is supported or not.
Setting the opcode to 0xFF was wrong too as nobody guarantees that 0xFF
is an unused opcode. Thus when masking out an erase type, just set the
erase size to zero. This will fix the shift-out-of-bounds.

Fixes: 5390a8df769e ("mtd: spi-nor: add support to non-uniform SFDP SPI NOR flash memories")
Cc: stable@vger.kernel.org
Reported-by: Alexander Stein <Alexander.Stein@tq-group.com>
Signed-off-by: Louis Rannou <lrannou@baylibre.com>
Tested-by: Alexander Stein <Alexander.Stein@tq-group.com>
Link: https://lore.kernel.org/r/20230203070754.50677-1-tudor.ambarus@linaro.org
[ta: refine changes, new commit message, fix compilation error]
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
(cherry picked from https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?h=spi-nor/next&id=f0f0cfdc3a024e21161714f2e05f0df3b84d42ad)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: drm/i915/sseu: fix max_subslices array-index-out-of-bounds access
Andrea Righi [Mon, 20 Feb 2023 17:02:23 +0000 (18:02 +0100)]
UBUNTU: SAUCE: drm/i915/sseu: fix max_subslices array-index-out-of-bounds access

It seems that commit bc3c5e0809ae ("drm/i915/sseu: Don't try to store EU
mask internally in UAPI format") exposed a potential out-of-bounds
access, reported by UBSAN as following on a laptop with a gen 11 i915
card:

  UBSAN: array-index-out-of-bounds in drivers/gpu/drm/i915/gt/intel_sseu.c:65:27
  index 6 is out of range for type 'u16 [6]'
  CPU: 2 PID: 165 Comm: systemd-udevd Not tainted 6.2.0-9-generic #9-Ubuntu
  Hardware name: Dell Inc. XPS 13 9300/077Y9N, BIOS 1.11.0 03/22/2022
  Call Trace:
   <TASK>
   show_stack+0x4e/0x61
   dump_stack_lvl+0x4a/0x6f
   dump_stack+0x10/0x18
   ubsan_epilogue+0x9/0x3a
   __ubsan_handle_out_of_bounds.cold+0x42/0x47
   gen11_compute_sseu_info+0x121/0x130 [i915]
   intel_sseu_info_init+0x15d/0x2b0 [i915]
   intel_gt_init_mmio+0x23/0x40 [i915]
   i915_driver_mmio_probe+0x129/0x400 [i915]
   ? intel_gt_probe_all+0x91/0x2e0 [i915]
   i915_driver_probe+0xe1/0x3f0 [i915]
   ? drm_privacy_screen_get+0x16d/0x190 [drm]
   ? acpi_dev_found+0x64/0x80
   i915_pci_probe+0xac/0x1b0 [i915]
   ...

According to the definition of sseu_dev_info, eu_mask->hsw is limited to
a maximum of GEN_MAX_SS_PER_HSW_SLICE (6) sub-slices, but
gen11_sseu_info_init() can potentially set 8 sub-slices, in the
!IS_JSL_EHL(gt->i915) case.

Fix this by reserving up to 8 slots for max_subslices in the eu_mask
struct.

Reported-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
(cherry-picked from https://lore.kernel.org/lkml/20230220171858.131416-1-andrea.righi@canonical.com/T/#u)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Ubuntu-unstable-6.2.0-10.10
Andrea Righi [Mon, 20 Feb 2023 09:36:20 +0000 (10:36 +0100)]
UBUNTU: Ubuntu-unstable-6.2.0-10.10

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Config] update annotations after rebase to v6.2
Andrea Righi [Mon, 20 Feb 2023 08:41:25 +0000 (09:41 +0100)]
UBUNTU: [Config] update annotations after rebase to v6.2

Drop CONFIG_DRM_USE_DYNAMIC_DEBUG that has been marked as broken by
commit: bb2ff6c27bc9 ("drm: Disable dynamic debug as broken")

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: link-to-tracker: update tracking bug
Andrea Righi [Mon, 20 Feb 2023 08:14:09 +0000 (09:14 +0100)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/2007818
Properties: no-test-build
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Rebase to v6.2
Andrea Righi [Mon, 20 Feb 2023 08:11:14 +0000 (09:11 +0100)]
UBUNTU: Rebase to v6.2

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Start new release
Andrea Righi [Mon, 20 Feb 2023 08:07:51 +0000 (09:07 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Ubuntu-unstable-6.2.0-9.9
Andrea Righi [Mon, 13 Feb 2023 08:32:18 +0000 (09:32 +0100)]
UBUNTU: Ubuntu-unstable-6.2.0-9.9

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Config] update annotations after rebase to v6.2-rc8
Andrea Righi [Mon, 13 Feb 2023 08:30:12 +0000 (09:30 +0100)]
UBUNTU: [Config] update annotations after rebase to v6.2-rc8

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: link-to-tracker: update tracking bug
Andrea Righi [Mon, 13 Feb 2023 07:57:56 +0000 (08:57 +0100)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/2007069
Properties: no-test-build
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Rebase to v6.2-rc8
Andrea Righi [Mon, 13 Feb 2023 08:31:02 +0000 (09:31 +0100)]
UBUNTU: Rebase to v6.2-rc8

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Start new release
Andrea Righi [Mon, 13 Feb 2023 07:55:20 +0000 (08:55 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: various code cleanups
Andrea Righi [Mon, 13 Feb 2023 07:33:41 +0000 (08:33 +0100)]
UBUNTU: [Packaging] annotations: various code cleanups

kconfig: Fix pylint violations

Fix the following:
R0205: Class 'Config' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
E1101: Instance of 'Config' has no '_parse' member (no-member)
W0613: Unused argument 'arch' (unused-argument)
W0613: Unused argument 'flavour' (unused-argument)
W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
R0201: Method could be a function (no-self-use)
E1101: Instance of 'Config' has no 'config' member (no-member)
W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
W0105: String statement has no effect (pointless-string-statement)
W0123: Use of eval (eval-used)
W0102: Dangerous default value [] as argument (dangerous-default-value)
R1723: Unnecessary "elif" after "break" (no-else-break)
R1705: Unnecessary "elif" after "return" (no-else-return)
R1704: Redefining argument with the local name 'arch' (redefined-argument-from-local)

Signed-off-by: Juerg Haefliger <juergh@proton.me>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Config] update annotations to split configs with/without notes
Andrea Righi [Sat, 11 Feb 2023 10:44:44 +0000 (11:44 +0100)]
UBUNTU: [Config] update annotations to split configs with/without notes

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoselftests/net: mv bpf/nat6to4.c to net folder
Hangbin Liu [Wed, 18 Jan 2023 02:09:27 +0000 (10:09 +0800)]
selftests/net: mv bpf/nat6to4.c to net folder

There are some issues with the bpf/nat6to4.c building.

1. It use TEST_CUSTOM_PROGS, which will add the nat6to4.o to
   kselftest-list file and run by common run_tests.
2. When building the test via `make -C tools/testing/selftests/
   TARGETS="net"`, the nat6to4.o will be build in selftests/net/bpf/
   folder. But in test udpgro_frglist.sh it refers to ../bpf/nat6to4.o.
   The correct path should be ./bpf/nat6to4.o.
3. If building the test via `make -C tools/testing/selftests/ TARGETS="net"
   install`. The nat6to4.o will be installed to kselftest_install/net/
   folder. Then the udpgro_frglist.sh should refer to ./nat6to4.o.

To fix the confusing test path, let's just move the nat6to4.c to net folder
and build it as TEST_GEN_FILES.

Fixes: edae34a3ed92 ("selftests net: add UDP GRO fraglist + bpf self-tests")
Tested-by: Björn Töpel <bjorn@kernel.org>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: Check validity of FLAVOUR_DEP
Juerg Haefliger [Tue, 7 Feb 2023 10:08:17 +0000 (11:08 +0100)]
UBUNTU: [Packaging] annotations: Check validity of FLAVOUR_DEP

FLAVOUR_DEP is used to map flavors from the main annotations file to
flavors from includes. Currently, there is no check that any of the
listed flavors exists or is valid so the resulting behavior is
(probably) undefined/unexpected. Add a sanity check to verify the
FLAVOUR_DEP flavors.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: Write out annotations with notes first
Juerg Haefliger [Tue, 7 Feb 2023 07:36:07 +0000 (08:36 +0100)]
UBUNTU: [Packaging] annotations: Write out annotations with notes first

When writing the annotations file, separate them  into two groups: With
and without a note. Write the group with notes first and separate the
other group with a visual marker.

The idea is that all configs that are set/modified manually should have
an annotation note and putting them at the top of the annotations file
should make it easier to figure out what the config of this kernel is
about.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: Fail on invalid lines
Juerg Haefliger [Tue, 7 Feb 2023 07:36:06 +0000 (08:36 +0100)]
UBUNTU: [Packaging] annotations: Fail on invalid lines

Currently, invalid lines are silently ignored, which is not good.
Fix this by raising an exception if the line can't be parsed. While at
it, remove one level of nesting by using if-continue.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: Handle tabs in annotations file
Juerg Haefliger [Tue, 7 Feb 2023 07:36:05 +0000 (08:36 +0100)]
UBUNTU: [Packaging] annotations: Handle tabs in annotations file

Handle tabs in the annotations file by replacing them with spaces.
While at make the parsing more robust by removing leading and trailing
whitespaces and ignoring empty lines.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: Clean up policy writes
Juerg Haefliger [Tue, 7 Feb 2023 07:36:04 +0000 (08:36 +0100)]
UBUNTU: [Packaging] annotations: Clean up policy writes

The logic to determine if policy lines need to be written to the output
file is a little convoluted. Basically, if there is no 'policy' key in
a config, there is nothing to do, so put that check at the beginning of
the loop.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: Fix linter errors
Juerg Haefliger [Tue, 7 Feb 2023 07:36:03 +0000 (08:36 +0100)]
UBUNTU: [Packaging] annotations: Fix linter errors

Fix the following flake8 errors:
  - E127 continuation line over-indented for visual indent
  - E722 do not use bare 'except'
  - E203 whitespace before ':'
  - E201 whitespace after '{'
  - E202 whitespace before '}'
  - E713 test for membership should be 'not in'

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: Preserve single-line annotation rules
Juerg Haefliger [Mon, 6 Feb 2023 07:14:48 +0000 (08:14 +0100)]
UBUNTU: [Packaging] annotations: Preserve single-line annotation rules

Currently, rules with notes are written out as separate lines, i. e.,
one line for the policy and one line for the note, followed by an
empty line. The parser now supports single line rules so preserve that
style when writting out the rules.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: Handle single-line annoation rules
Juerg Haefliger [Mon, 6 Feb 2023 07:14:47 +0000 (08:14 +0100)]
UBUNTU: [Packaging] annotations: Handle single-line annoation rules

The old annotations file allowed single-line rules such as:
CONFIG_FOO  policy<'amd64': 'n'> note<LP: #123456>

The new annotations parser doesn't support that, so add it.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] rsync no longer available on lunar
Andy Whitcroft [Fri, 3 Feb 2023 14:24:08 +0000 (14:24 +0000)]
UBUNTU: [Packaging] rsync no longer available on lunar

rsync is no longer available on i386.  In lunar we only produce
linux-libc-dev from the kernel package on i386.  We only use rsync when
building tools and when building documentation; we do neither on i386.
Architecture limit our dependency.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
[changed subject Config->Packaging, and lucid->lunar in body]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging]: annotations: fix _remove_entry() logic
Andrea Righi [Fri, 3 Feb 2023 10:53:32 +0000 (11:53 +0100)]
UBUNTU: [Packaging]: annotations: fix _remove_entry() logic

Drop unnecessary delete statements and fix the code to properly remove
the entry in _remove_entry().

Reported-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Debian] Use a python3 compatable kernel-testing repo
Francis Ginther [Thu, 2 Feb 2023 15:24:24 +0000 (09:24 -0600)]
UBUNTU: [Debian] Use a python3 compatable kernel-testing repo

BugLink: https://bugs.launchpad.net/bugs/2004429
Switch to using a python3 compatible branch for the kernel-testing
scripts used for running autopkgtest. This in turn uses a python3
compatible fork of autotest.

Remove the autopkgtest dependency on python2, replacing it with python3.
Also remove the dependency on bzr as it's unused.

Signed-off-by: Francis Ginther <francis.ginther@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: net: wwan: t7xx: Devlink documentation
M Chetan Kumar [Mon, 16 Jan 2023 09:15:04 +0000 (17:15 +0800)]
UBUNTU: SAUCE: net: wwan: t7xx: Devlink documentation

BugLink: https://bugs.launchpad.net/bugs/2002089
Document the t7xx devlink commands usage for fw flashing &
coredump collection.

Refer to t7xx.rst file for details.

Change-Id: I918f6583c776dc537ad13dfbd7cbe0b0c6b305ca
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: Devegowda Chandrashekar <chandrashekar.devegowda@intel.com>
(cherry picked from https://patchwork.kernel.org/project/netdevbpf/patch/20230105154316.198888-1-m.chetan.kumar@linux.intel.com/)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: net: wwan: t7xx: Enable devlink based fw flashing and coredump collection
M Chetan Kumar [Mon, 16 Jan 2023 09:15:03 +0000 (17:15 +0800)]
UBUNTU: SAUCE: net: wwan: t7xx: Enable devlink based fw flashing and coredump collection

BugLink: https://bugs.launchpad.net/bugs/2002089
Adds support for t7xx wwan device firmware flashing & coredump collection
using devlink.

1> Driver Registers with Devlink framework.
2> Implements devlink ops flash_update callback that programs modem fw.
3> Creates region & snapshot required for device coredump log collection.

On early detection of wwan device in fastboot mode driver sets up CLDMA0 HW
tx/rx queues for raw data transfer and then registers to devlink framework.
On user space application issuing command for firmware update the driver
sends fastboot flash command & firmware to program NAND.

In flashing procedure the fastboot command & response are exchanged between
driver and device. Once firmware flashing is success completion status is
reported to user space application.

Below is the devlink command usage for firmware flashing

$devlink dev flash pci/$BDF file ABC.img component ABC

Note: ABC.img is the firmware to be programmed to "ABC" partition.

In case of coredump collection when wwan device encounters an exception
it reboots & stays in fastboot mode for coredump collection by host driver.
On detecting exception state driver collects the core dump, creates the
devlink region & reports an event to user space application for dump
collection. The user space application invokes devlink region read command
for dump collection.

Below are the devlink commands used for coredump collection.

devlink region new pci/$BDF/mr_dump
devlink region read pci/$BDF/mr_dump snapshot $ID address $ADD length $LEN
devlink region del pci/$BDF/mr_dump snapshot $ID

Change-Id: I36c87dc3b7433439716023a4841820093ece3cdc
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: Devegowda Chandrashekar <chandrashekar.devegowda@intel.com>
Signed-off-by: Mishra Soumya Prakash <soumya.prakash.mishra@intel.com>
(cherry picked from https://patchwork.kernel.org/project/netdevbpf/patch/20230105154300.198873-1-m.chetan.kumar@linux.intel.com/)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: net: wwan: t7xx: PCIe reset rescan
M Chetan Kumar [Mon, 16 Jan 2023 09:15:02 +0000 (17:15 +0800)]
UBUNTU: SAUCE: net: wwan: t7xx: PCIe reset rescan

BugLink: https://bugs.launchpad.net/bugs/2002089
PCI rescan module implements "rescan work queue".
In firmware flashing or coredump collection procedure
WWAN device is programmed to boot in fastboot mode and
a work item is scheduled for removal & detection.

The WWAN device is reset using APCI call as part driver
removal flow. Work queue rescans pci bus at fixed interval
for device detection, later when device is detect work queue
exits.

Change-Id: I4bc254ae0eae76c41da75b1b76fcef36ec866e84
Signed-off-by: Haijun Liu <haijun.liu@mediatek.com>
Co-developed-by: Madhusmita Sahu <madhusmita.sahu@intel.com>
Signed-off-by: Madhusmita Sahu <madhusmita.sahu@intel.com>
Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: Devegowda Chandrashekar <chandrashekar.devegowda@intel.com>
(cherry picked from https://patchwork.kernel.org/project/netdevbpf/patch/20230105154245.198858-1-m.chetan.kumar@linux.intel.com/)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: net: wwan: t7xx: Infrastructure for early port configuration
M Chetan Kumar [Mon, 16 Jan 2023 09:15:01 +0000 (17:15 +0800)]
UBUNTU: SAUCE: net: wwan: t7xx: Infrastructure for early port configuration

BugLink: https://bugs.launchpad.net/bugs/2002089
To support cases such as FW update or Core dump, the t7xx
device is capable of signaling the host that a special port
needs to be created before the handshake phase.

This patch adds the infrastructure required to create the
early ports which also requires a different configuration of
CLDMA queues.

Change-Id: Ib4b9d5c0328be89f0290706390ee0293530d7b70
Signed-off-by: Haijun Liu <haijun.liu@mediatek.com>
Co-developed-by: Madhusmita Sahu <madhusmita.sahu@intel.com>
Signed-off-by: Madhusmita Sahu <madhusmita.sahu@intel.com>
Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
Signed-off-by: Devegowda Chandrashekar <chandrashekar.devegowda@intel.com>
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
(cherry picked from https://patchwork.kernel.org/project/netdevbpf/patch/20230105154229.198843-1-m.chetan.kumar@linux.intel.com/)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: net: wwan: t7xx: Add AP CLDMA
Haijun Liu [Mon, 16 Jan 2023 09:15:00 +0000 (17:15 +0800)]
UBUNTU: SAUCE: net: wwan: t7xx: Add AP CLDMA

BugLink: https://bugs.launchpad.net/bugs/2002089
The t7xx device contains two Cross Layer DMA (CLDMA) interfaces to
communicate with AP and Modem processors respectively. So far only
MD-CLDMA was being used, this patch enables AP-CLDMA.

Rename small Application Processor (sAP) to AP.

Change-Id: I37d4311f013ff19891ca3801ee048b08b27c4847
Signed-off-by: Haijun Liu <haijun.liu@mediatek.com>
Co-developed-by: Madhusmita Sahu <madhusmita.sahu@intel.com>
Signed-off-by: Madhusmita Sahu <madhusmita.sahu@intel.com>
Signed-off-by: Moises Veleta <moises.veleta@linux.intel.com>
Signed-off-by: Devegowda Chandrashekar <chandrashekar.devegowda@intel.com>
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
(cherry picked from https://patchwork.kernel.org/project/netdevbpf/patch/20230105154215.198828-1-m.chetan.kumar@linux.intel.com/)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: Revert "net: wwan: t7xx: Add AP CLDMA"
You-Sheng Yang (vicamo) [Mon, 16 Jan 2023 09:14:58 +0000 (17:14 +0800)]
UBUNTU: SAUCE: Revert "net: wwan: t7xx: Add AP CLDMA"

BugLink: https://bugs.launchpad.net/bugs/2002089
This reverts commit 7ef2cae799f1907442426ee0058e8dc4747f7f92.

Change-Id: Iea1b800ff6822818ebe9908fd391f4ca703c5bf8
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: SAUCE: shiftfs: fix -EOVERFLOW inside the container
Alexander Mikhalitsyn [Tue, 31 Jan 2023 16:11:48 +0000 (17:11 +0100)]
UBUNTU: SAUCE: shiftfs: fix -EOVERFLOW inside the container

BugLink: https://bugs.launchpad.net/bugs/1990849
We haven't supported idmapped layers with shiftfs and moreover, that makes
no sense. Once lower fs support idmapped mounts when shiftfs is not needed.

Starting from linux-image-5.15.0-48-generic users started seeing EOVERFLOW
errors from the userspace side on a trivial fs operations inside the containers.

This is caused by patches ("fs: tweak fsuidgid_has_mapping()"),
("fs: support mapped mounts of mapped filesystems"). These patches extends
and enables idmapped mounts support in Ubuntu kernel, but the problem is
that shiftfs was not properly ported.

See also:
("namei: prepare for idmapped mounts")
https://lore.kernel.org/all/20210121131959.646623-15-christian.brauner@ubuntu.com/
("overlayfs: do not mount on top of idmapped mounts")
https://lore.kernel.org/all/20210121131959.646623-29-christian.brauner@ubuntu.com/
as a reference.

This patch should be appied on top of kinetic/master-next and based on the
changes by Andrea Righi 4c934edc66 ("UBUNTU: SAUCE: shiftfs: always rely on init_user_ns")

This commit together with 4c934edc66 ("UBUNTU: SAUCE: shiftfs: always rely on init_user_ns")
have to be ported to the jammy tree too.

Fixes: d347e71d2c0 ("UBUNTU: [SAUCE] shiftfs: support kernel 5.15")
Reported-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] annotations: do not drop undefined configs in derivatives
Andrea Righi [Tue, 31 Jan 2023 13:45:15 +0000 (14:45 +0100)]
UBUNTU: [Packaging] annotations: do not drop undefined configs in derivatives

Prevent dropping configs that are undefined across all the supported
architectures in annotations that have includes, because we may want to
use them to override configs imported from other annotations.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Ubuntu-unstable-6.2.0-8.8
Andrea Righi [Tue, 31 Jan 2023 07:21:21 +0000 (08:21 +0100)]
UBUNTU: Ubuntu-unstable-6.2.0-8.8

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: link-to-tracker: update tracking bug
Andrea Righi [Tue, 31 Jan 2023 07:19:15 +0000 (08:19 +0100)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/2004229
Properties: no-test-build
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Start new release
Andrea Righi [Tue, 31 Jan 2023 06:50:34 +0000 (07:50 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: [Packaging] re-enable signing for ppc64el and s390x
Andrea Righi [Tue, 31 Jan 2023 06:31:43 +0000 (07:31 +0100)]
UBUNTU: [Packaging] re-enable signing for ppc64el and s390x

Re-enable signing on these architectures, so that we can test secure
boot on them.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Ubuntu-unstable-6.2.0-7.7
Andrea Righi [Mon, 30 Jan 2023 09:23:16 +0000 (10:23 +0100)]
UBUNTU: Ubuntu-unstable-6.2.0-7.7

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: link-to-tracker: update tracking bug
Andrea Righi [Mon, 30 Jan 2023 09:20:11 +0000 (10:20 +0100)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/2004142
Properties: no-test-build
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Start new release
Andrea Righi [Mon, 30 Jan 2023 09:18:32 +0000 (10:18 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
18 months agoUBUNTU: Ubuntu-unstable-6.2.0-6.6
Andrea Righi [Mon, 30 Jan 2023 08:20:26 +0000 (09:20 +0100)]
UBUNTU: Ubuntu-unstable-6.2.0-6.6

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>