Commit graph

489 commits

Author SHA1 Message Date
Mark Brown
9f69ce235f spi: Fix deadlock when adding SPI controllers on SPI buses
commit 6098475d4cb48d821bdf453c61118c56e26294f0 upstream.

Currently we have a global spi_add_lock which we take when adding new
devices so that we can check that we're not trying to reuse a chip
select that's already controlled.  This means that if the SPI device is
itself a SPI controller and triggers the instantiation of further SPI
devices we trigger a deadlock as we try to register and instantiate
those devices while in the process of doing so for the parent controller
and hence already holding the global spi_add_lock.  Since we only care
about concurrency within a single SPI bus move the lock to be per
controller, avoiding the deadlock.

This can be easily triggered in the case of spi-mux.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Hardik Gohil <hgohil@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-30 02:33:25 +01:00
Amir Goldstein
cf82fd7a6a fs: create kiocb_{start,end}_write() helpers
Commit ed0360bbab72b829437b67ebb2f9cfac19f59dfe upstream.

aio, io_uring, cachefiles and overlayfs, all open code an ugly variant
of file_{start,end}_write() to silence lockdep warnings.

Create helpers for this lockdep dance so we can use the helpers in all
the callers.

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Message-Id: <20230817141337.1025891-4-amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:24 +01:00
Ioana Ciornei
b1c86072e8 net: phy: export phy_error and phy_trigger_machine
[ Upstream commit 293e9a3d950dfebc76d9fa6931e6f91ef856b9ab ]

These functions are currently used by phy_interrupt() to either signal
an error condition or to trigger the link state machine. In an attempt
to actually support shared PHY IRQs, export these two functions so that
the actual PHY drivers can use them.

Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Andre Edich <andre.edich@microchip.com>
Cc: Antoine Tenart <atenart@kernel.org>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Divya Koppera <Divya.Koppera@microchip.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Marco Felsch <m.felsch@pengutronix.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Mathias Kresin <dev@kresin.me>
Cc: Maxim Kochetkov <fido_max@inbox.ru>
Cc: Michael Walle <michael@walle.cc>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Nisar Sayed <Nisar.Sayed@microchip.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Philippe Schenker <philippe.schenker@toradex.com>
Cc: Willy Liu <willy.liu@realtek.com>
Cc: Yuiko Oshino <yuiko.oshino@microchip.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 256748d5480b ("net: phy: ti: add PHY_RST_AFTER_CLK_EN flag")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Daniel Micay
7617e31b3c mm: add support for verifying page sanitization
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
2024-11-30 02:17:18 +01:00
Daniel Micay
4e3b773c8c add kmalloc/krealloc alloc_size attributes
Note that this is overly strict when combined with ksize users accessing
beyond the requested data size.

Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
2024-11-30 02:17:15 +01:00
Daniel Micay
78d3c27fff add vmalloc alloc_size attributes
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Thibaut Sautereau <thibaut.sautereau@ssi.gouv.fr>
Signed-off-by: Levente Polyak <levente@leventepolyak.net>
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
2024-11-30 02:17:12 +01:00
Daniel Micay
11c4ea478b add kvmalloc alloc_size attribute
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
2024-11-30 02:17:08 +01:00
Daniel Micay
4816ac7943 add percpu alloc_size attributes
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
2024-11-30 02:17:02 +01:00
Daniel Micay
689144b172 add alloc_pages_exact alloc_size attributes
Edited-by: Thibaut Sautereau <thibaut.sautereau@ssi.gouv.fr>
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
2024-11-30 02:16:54 +01:00
Daniel Micay
a124bf732b add __read_only for non-init related usage
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
2024-11-30 02:16:16 +01:00
Ksawlii
f368b1e13e Revert "netfilter: nf_tables: rise cap on SELinux secmark context"
This reverts commit 1673b96b70.
2024-11-24 00:23:56 +01:00
Ksawlii
73844bf19d Revert "netfilter: nf_tables: use timestamp to check for set element timeout"
This reverts commit 7d64835c13.
2024-11-24 00:23:55 +01:00
Ksawlii
c44e98a853 Revert "netfilter: nf_tables: allow clone callbacks to sleep"
This reverts commit b2a587e7a5.
2024-11-24 00:23:54 +01:00
Ksawlii
ce957c283b Revert "block: use "unsigned long" for blk_validate_block_size()."
This reverts commit 824dca8cf5.
2024-11-24 00:23:52 +01:00
Ksawlii
40f7c74cbc Revert "net: busy-poll: use ktime_get_ns() instead of local_clock()"
This reverts commit 97751f7856.
2024-11-24 00:23:49 +01:00
Ksawlii
7473e7c839 Revert "hwspinlock: Introduce hwspin_lock_bust()"
This reverts commit 5bfff48f58.
2024-11-24 00:23:48 +01:00
Ksawlii
254706192f Revert "fsnotify: clear PARENT_WATCHED flags lazily"
This reverts commit 887fdf24d2.
2024-11-24 00:23:48 +01:00
Ksawlii
b4445f415c Revert "i2c: Use IS_REACHABLE() for substituting empty ACPI functions"
This reverts commit 152ff7ffb6.
2024-11-24 00:23:46 +01:00
Ksawlii
181d28ae2b Revert "sunrpc: pass in the sv_stats struct through svc_create_pooled"
This reverts commit bdc4a7b40a.
2024-11-24 00:23:44 +01:00
Ksawlii
279ec1c17f Revert "sunrpc: remove ->pg_stats from svc_program"
This reverts commit 2f7108a6c4.
2024-11-24 00:23:44 +01:00
Ksawlii
7534e491aa Revert "cgroup: Make operations on the cgroup root_list RCU safe"
This reverts commit 6c357bd6a8.
2024-11-24 00:23:32 +01:00
Ksawlii
724a6d6e06 Revert "netfilter: nft_set_pipapo: walk over current view on netlink dump"
This reverts commit 2bbac316e0.
2024-11-24 00:23:32 +01:00
Ksawlii
efd33de913 Revert "inet: inet_defrag: prevent sk release while still in use"
This reverts commit d2e0105e54.
2024-11-24 00:23:32 +01:00
Ksawlii
d9a5f63b5f Revert "cgroup: Move rcu_head up near the top of cgroup_root"
This reverts commit 430691b79e.
2024-11-24 00:23:31 +01:00
Ksawlii
f45a13db54 Revert "fs: explicitly unregister per-superblock BDIs"
This reverts commit 716f0f8e49.
2024-11-24 00:23:31 +01:00
Ksawlii
fd797305e8 Revert "mount: warn only once about timestamp range expiration"
This reverts commit c9b4f8d73e.
2024-11-24 00:23:31 +01:00
Ksawlii
bd030fa7ad Revert "net: geneve: support IPv4/IPv6 as inner protocol"
This reverts commit 0315c150d1.
2024-11-24 00:23:29 +01:00
Ksawlii
05b6109631 Revert "geneve: Fix incorrect inner network header offset when innerprotoinherit is set"
This reverts commit 08dc6b0262.
2024-11-24 00:23:29 +01:00
Ksawlii
b4841d2300 Revert "device property: Add const qualifier to device_get_match_data() parameter"
This reverts commit 5020ab1059.
2024-11-24 00:23:27 +01:00
Ksawlii
36941dff69 Revert "i2c: Add i2c_get_match_data()"
This reverts commit a52f68ee65.
2024-11-24 00:23:27 +01:00
Ksawlii
9629f5d149 Revert "kthread: add kthread_work tracepoints"
This reverts commit 0944044e57.
2024-11-24 00:23:23 +01:00
Ksawlii
9e842bdf99 Revert "vdpa: Add eventfd for the vdpa callback"
This reverts commit aebec28879.
2024-11-24 00:23:19 +01:00
Ksawlii
e5961ab93c Revert "tcp: check skb is non-NULL in tcp_rto_delta_us()"
This reverts commit 24ac31b7d4.
2024-11-24 00:23:18 +01:00
Ksawlii
8efffd2d17 Revert "netfilter: uapi: NFTA_FLOWTABLE_HOOK is NLA_NESTED"
This reverts commit 95f1291ddd.
2024-11-24 00:23:12 +01:00
Ksawlii
874d1dc60d Revert "drm/printer: Allow NULL data in devcoredump printer"
This reverts commit f39aaded93.
2024-11-24 00:23:06 +01:00
Ksawlii
637bec6d7b Revert "media: uapi/linux/cec.h: cec_msg_set_reply_to: zero flags"
This reverts commit 343ee53332.
2024-11-24 00:23:02 +01:00
Ksawlii
bef5e7428f Revert "kallsyms: Make kallsyms_on_each_symbol generally available"
This reverts commit 9dc3580302.
2024-11-24 00:22:59 +01:00
Ksawlii
62030ec18e Revert "kallsyms: Make module_kallsyms_on_each_symbol generally available"
This reverts commit 7b296fe960.
2024-11-24 00:22:59 +01:00
Ksawlii
da9f8742cf Revert "PCI: Add function 0 DMA alias quirk for Glenfly Arise chip"
This reverts commit b63ccbac6d.
2024-11-24 00:22:58 +01:00
Ksawlii
0381b2073a Revert "NFSv4: Prevent NULL-pointer dereference in nfs42_complete_copies()"
This reverts commit 4bb48602f3.
2024-11-24 00:22:57 +01:00
Ksawlii
aa7000ca5b Revert "net/sched: accept TCA_STAB only for root qdisc"
This reverts commit 7ce031a5e7.
2024-11-24 00:22:56 +01:00
Ksawlii
41a84ba01c Revert "net: Fix an unsafe loop on the list"
This reverts commit eddd768153.
2024-11-24 00:22:55 +01:00
Ksawlii
567fb8d401 Revert "net: enetc: add missing static descriptor and inline keyword"
This reverts commit 28fbd87bfe.
2024-11-24 00:22:54 +01:00
Ksawlii
a91e7ad42f Revert "irqchip/gic-v4: Don't allow a VMOVP on a dying VPE"
This reverts commit 9b97db363b.
2024-11-24 00:22:51 +01:00
Christoph Hellwig
8600a68a5c mm: add remap_pfn_range_notrack
commit 74ffa5a3e68504dd289135b1cf0422c19ffb3f2e upstream.

Patch series "add remap_pfn_range_notrack instead of reinventing it in i915", v2.

i915 has some reason to want to avoid the track_pfn_remap overhead in
remap_pfn_range.  Add a function to the core VM to do just that rather
than reinventing the functionality poorly in the driver.

Note that the remap_io_sg path does get exercises when using Xorg on my
Thinkpad X1, so this should be considered lightly tested, I've not managed
to hit the remap_io_mapping path at all.

This patch (of 4):

Add a version of remap_pfn_range that does not call track_pfn_range.  This
will be used to fix horrible abuses of VM internals in the i915 driver.

Link: https://lkml.kernel.org/r/20210326055505.1424432-1-hch@lst.de
Link: https://lkml.kernel.org/r/20210326055505.1424432-2-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Harshvardhan Jha <harshvardhan.j.jha@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:22:05 +01:00
Marco Elver
a7e24c554f kasan: Fix Software Tag-Based KASAN with GCC
[ Upstream commit 894b00a3350c560990638bdf89bdf1f3d5491950 ]

Per [1], -fsanitize=kernel-hwaddress with GCC currently does not disable
instrumentation in functions with __attribute__((no_sanitize_address)).

However, __attribute__((no_sanitize("hwaddress"))) does correctly
disable instrumentation. Use it instead.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117196 [1]
Link: https://lore.kernel.org/r/000000000000f362e80620e27859@google.com
Link: https://lore.kernel.org/r/ZvFGwKfoC4yVjN_X@J2N7QTR9R3
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218854
Reported-by: syzbot+908886656a02769af987@syzkaller.appspotmail.com
Tested-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrew Pinski <pinskia@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Marco Elver <elver@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Fixes: 7b861a53e46b ("kasan: Bump required compiler version")
Link: https://lore.kernel.org/r/20241021120013.3209481-1-elver@google.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:04 +01:00
Miguel Ojeda
0bc623c228 compiler-gcc: remove attribute support check for __no_sanitize_address__
[ Upstream commit ae37a9a2c2d0960d643d782b426ea1aa9c05727a ]

The attribute was added in GCC 4.8, while the minimum GCC version
supported by the kernel is GCC 5.1.

Therefore, remove the check.

Link: https://godbolt.org/z/84v56vcn8
Link: https://lkml.kernel.org/r/20221021115956.9947-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dan Li <ashimida@linux.alibaba.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: Marco Elver <elver@google.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 894b00a3350c ("kasan: Fix Software Tag-Based KASAN with GCC")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:04 +01:00
Miguel Ojeda
030a0773ad compiler-gcc: be consistent with underscores use for no_sanitize
[ Upstream commit 6e2be1f2ebcea42ed6044432f72f32434e60b34d ]

Patch series "compiler-gcc: be consistent with underscores use for
`no_sanitize`".

This patch (of 5):

Other macros that define shorthands for attributes in e.g.
`compiler_attributes.h` and elsewhere use underscores.

Link: https://lkml.kernel.org/r/20221021115956.9947-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Cc: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dan Li <ashimida@linux.alibaba.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 894b00a3350c ("kasan: Fix Software Tag-Based KASAN with GCC")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:04 +01:00
Ido Schimmel
52ed1e7d8d ipv4: ip_tunnel: Fix suspicious RCU usage warning in ip_tunnel_init_flow()
[ Upstream commit ad4a3ca6a8e886f6491910a3ae5d53595e40597d ]

There are code paths from which the function is called without holding
the RCU read lock, resulting in a suspicious RCU usage warning [1].

Fix by using l3mdev_master_upper_ifindex_by_index() which will acquire
the RCU read lock before calling
l3mdev_master_upper_ifindex_by_index_rcu().

[1]
WARNING: suspicious RCU usage
6.12.0-rc3-custom-gac8f72681cf2 #141 Not tainted
-----------------------------
net/core/dev.c:876 RCU-list traversed in non-reader section!!

other info that might help us debug this:

rcu_scheduler_active = 2, debug_locks = 1
1 lock held by ip/361:
 #0: ffffffff86fc7cb0 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x377/0xf60

stack backtrace:
CPU: 3 UID: 0 PID: 361 Comm: ip Not tainted 6.12.0-rc3-custom-gac8f72681cf2 #141
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
 <TASK>
 dump_stack_lvl+0xba/0x110
 lockdep_rcu_suspicious.cold+0x4f/0xd6
 dev_get_by_index_rcu+0x1d3/0x210
 l3mdev_master_upper_ifindex_by_index_rcu+0x2b/0xf0
 ip_tunnel_bind_dev+0x72f/0xa00
 ip_tunnel_newlink+0x368/0x7a0
 ipgre_newlink+0x14c/0x170
 __rtnl_newlink+0x1173/0x19c0
 rtnl_newlink+0x6c/0xa0
 rtnetlink_rcv_msg+0x3cc/0xf60
 netlink_rcv_skb+0x171/0x450
 netlink_unicast+0x539/0x7f0
 netlink_sendmsg+0x8c1/0xd80
 ____sys_sendmsg+0x8f9/0xc20
 ___sys_sendmsg+0x197/0x1e0
 __sys_sendmsg+0x122/0x1f0
 do_syscall_64+0xbb/0x1d0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Fixes: db53cd3d88dc ("net: Handle l3mdev in ip_tunnel_init_flow")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20241022063822.462057-1-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:03 +01:00
Youghandhar Chintala
6deb375c78 mac80211: Add support to trigger sta disconnect on hardware restart
[ Upstream commit 7d352ccf1e9935b5222ca84e8baeb07a0c8f94b9 ]

Currently in case of target hardware restart, we just reconfig and
re-enable the security keys and enable the network queues to start
data traffic back from where it was interrupted.

Many ath10k wifi chipsets have sequence numbers for the data
packets assigned by firmware and the mac sequence number will
restart from zero after target hardware restart leading to mismatch
in the sequence number expected by the remote peer vs the sequence
number of the frame sent by the target firmware.

This mismatch in sequence number will cause out-of-order packets
on the remote peer and all the frames sent by the device are dropped
until we reach the sequence number which was sent before we restarted
the target hardware

In order to fix this, we trigger a sta disconnect, in case of target
hw restart. After this there will be a fresh connection and thereby
avoiding the dropping of frames by remote peer.

The right fix would be to pull the entire data path into the host
which is not feasible or would need lots of complex changes and
will still be inefficient.

Tested on ath10k using WCN3990, QCA6174

Signed-off-by: Youghandhar Chintala <youghand@codeaurora.org>
Link: https://lore.kernel.org/r/20220308115325.5246-2-youghand@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Stable-dep-of: 07a6e3b78a65 ("wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:03 +01:00