Commit graph

492 commits

Author SHA1 Message Date
5861bc757f Revert "fs: create kiocb_{start,end}_write() helpers"
This reverts commit cf82fd7a6a.
2024-12-13 19:44:18 +01:00
Peter Zijlstra
88fde1823a sched,rt: Use cpumask_any*_distribute()
Replace a bunch of cpumask_any*() instances with
cpumask_any*_distribute(), by injecting this little bit of random in
cpu selection, we reduce the chance two competing balance operations
working off the same lowest_mask pick the same CPU.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Link: https://lkml.kernel.org/r/20201023102347.190759694@infradead.org
Signed-off-by: John Vincent <git@tenseventyseven.cf>
2024-12-03 21:47:07 +01:00
Park Ju Hyung
51cd5d4626 trace: add CONFIG_DISABLE_TRACE_PRINTK option
Poorly made kernel trees often use trace_printk() without
properly guarding them in a #ifdef macro.
Such usage of trace_printk() causes a warning at
boot and additional memory allocation.

This option serves to disable those all at once with ease.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
(cherry picked from commit 9ec68f89188e461721de418545e31f37800dfa02)
(cherry picked from commit 8fb7e59ccd6cda94e29af9e6e38a96eda458c9da)
(cherry picked from commit 515ff4ab9e2428b642fcd158af94c83e3059b33b)
(cherry picked from commit ac9a6d9d6a744a11c49e9d756bd0229c912b773d)
(cherry picked from commit e4f4c2c3e696ab4135e5e63b2acae6400476ac35)
Signed-off-by: SirRGB <sirrgb@proton.me>
2024-12-03 21:45:24 +01:00
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