4.14.303-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 1/338 libtraceevent: Fix build with binutils 2.35
In reply to Greg Kroah-HartmanFrom: Ben Hutchings <[email protected]>
commit 39efdd94e314336f4acbac4c07e0f37bdc3bef71 upstream.
In binutils 2.35, 'nm -D' changed to show symbol versions along with symbol names, with the usual @@ separator. When generating libtraceevent-dynamic-list we need just the names, so strip off the version suffix if present.
--- tools/lib/traceevent/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/Makefile +1 -1
@@ -263,7 +263,7 @@ define do_generate_dynamic_list_file xargs echo "U w W" | tr 'w ' 'W\n' | sort -u | xargs echo`;\ if [ "$$symbol_type" = "U W" ];then \ (echo '{'; \ - $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\ + $(NM) -u -D $1 | awk 'NF>1 {sub("@.*", "", $$2); print "\t"$$2";"}' | sort -u;\ echo '};'; \ ) > $2; \ else \
Greg Kroah-Hartman
maintainerPATCH 10/338 ASoC: ops: Correct bounds check for second channel on SX controls
In reply to Greg Kroah-HartmanFrom: Charles Keepax <[email protected]>
commit f33bcc506050f89433a52a3052054d4ebd37b1c1 upstream.
Currently the check against the max value for the control is being applied after the value has had the minimum applied and been masked. But the max value simply indicates the number of volume levels on an SX control, and as such should just be applied on the raw value.
--- sound/soc/soc-ops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/soc-ops.c +3 -2
@@ -463,14 +463,15 @@ int snd_soc_put_volsw_sx(struct snd_kconreturn err;if (snd_soc_volsw_is_stereo (mc)) { - val_mask = mask << rshift; - val2 = (ucontrol->value.integer.value[1 ] + min) & mask; + val2 = ucontrol->value.integer.value[1 ];if (mc->platform_max && val2 > mc->platform_max)return -EINVAL ;if (val2 > max)return -EINVAL ; + val_mask = mask << rshift; + val2 = (val2 + min) & mask; val2 = val2 << rshift; err = snd_soc_component_update_bits(component, reg2, val_mask,
Greg Kroah-Hartman
maintainerPATCH 11/338 perf script python: Remove explicit shebang from tests/attr.c
In reply to Greg Kroah-HartmanFrom: Tony Jones <[email protected]>
commit d72eadbc1d2866fc047edd4535ffb0298fe240be upstream.
tests/attr.c invokes attr.py via an explicit invocation of Python ($PYTHON) so there is therefore no need for an explicit shebang.
Also most distros follow pep-0394 which recommends that /usr/bin/python refer only to v2 and so may not exist on the system (if PYTHON=python3).
--- tools/perf/tests/attr.py | 1 - 1 file changed, 1 deletion(-)
tools/perf/tests/attr.py +0 -1
@@ -1,4 +1,3 @@ -#! /usr/bin/env python # SPDX-License-Identifier: GPL-2.0 import os
Greg Kroah-Hartman
maintainerPATCH 2/338 once: add DO_ONCE_SLOW() for sleepable contexts
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit 62c07983bef9d3e78e71189441e1a470f0d1e653 upstream.
Christophe Leroy reported a ~80ms latency spike
happening at first TCP connect() time.
This is because __inet_hash_connect() uses get_random_once()
to populate a perturbation table which became quite big
after commit 4c2c8f03a5ab ("tcp: increase source port perturb table to 2^16")
get_random_once() uses DO_ONCE(), which block hard irqs for the duration of the operation.
This patch adds DO_ONCE_SLOW() which uses a mutex instead of a spinlock for operations where we prefer to stay in process context.
Then __inet_hash_connect() can use get_random_slow_once() to populate its perturbation table.
--- include/linux/once.h | 28 ++++++++++++++++++++++++++++ lib/once.c | 30 ++++++++++++++++++++++++++++++ net/ipv4/inet_hashtables.c | 4 ++-- 3 files changed, 60 insertions(+), 2 deletions(-)
include/linux/once.h +28 -0
@@ -5,10 +5,18 @@#include <linux/types.h> #include <linux/jump_label.h> +/* Helpers used from arbitrary contexts. +* Hard irqs are blocked, be cautious. +*/ bool __do_once_start (bool *done,unsigned long *flags);void __do_once_done (bool *done,struct static_key *once_key,unsigned long *flags); +/* Variant for process contexts only. */ +bool __do_once_slow_start (bool *done); +void __do_once_slow_done (bool *done,struct static_key *once_key, +struct module *mod); +/* Call a function exactly once. The idea of DO_ONCE() is to perform * a function call such as initialization of random seeds, etc, only * once, where DO_ONCE() can live in the fast-path. After @func has
@@ -52,9 +60,29 @@ void __do_once_done(bool *done, struct s ___ret; \ }) +/* Variant of DO_ONCE() for process/sleepable contexts. */ +#define DO_ONCE_SLOW (func, ...) \ + ({ \ + bool ___ret = false; \ + static bool ___done = false; \ + static struct static_key ___once_key = STATIC_KEY_INIT_TRUE; \ + if (static_key_true(&___once_key)) { \ + ___ret = __do_once_slow_start(&___done); \ + if (unlikely(___ret)) { \ + func(__VA_ARGS__); \ + __do_once_slow_done(&___done, &___once_key, \ + THIS_MODULE); \ + } \ + } \ + ___ret; \ + }) +#define get_random_once (buf, nbytes) \ DO_ONCE(get_random_bytes, (buf), (nbytes))#define get_random_once_wait (buf, nbytes) \ DO_ONCE(get_random_bytes_wait, (buf), (nbytes)) \ +#define get_random_slow_once (buf, nbytes) \ + DO_ONCE_SLOW(get_random_bytes, (buf), (nbytes)) +#endif /* _LINUX_ONCE_H */
lib/once.c +30 -0
@@ -61,3 +61,33 @@ void __do_once_done(bool *done, struct sonce_disable_jump (once_key); }EXPORT_SYMBOL (__do_once_done); + +static DEFINE_MUTEX (once_mutex); + +bool __do_once_slow_start (bool *done) +__acquires (once_mutex) +{ +mutex_lock (&once_mutex); +if (*done) { +mutex_unlock (&once_mutex); +/* Keep sparse happy by restoring an even lock count on +* this mutex. In case we return here, we don't call into +* __do_once_done but return early in the DO_ONCE_SLOW() macro. +*/ +__acquire (once_mutex); +return false; + } + +return true; +} +EXPORT_SYMBOL (__do_once_slow_start); + +void __do_once_slow_done (bool *done,struct static_key *once_key, +struct module *mod) +__releases (once_mutex) +{ + *done = true; +mutex_unlock (&once_mutex); +once_disable_jump (once_key); +} +EXPORT_SYMBOL (__do_once_slow_done);
net/ipv4/inet_hashtables.c +2 -2
@@ -638,8 +638,8 @@ int __inet_hash_connect(struct inet_timeif (likely (remaining >1 )) remaining &= ~1U ; -net_get_random_once (table_perturb, -INET_TABLE_PERTURB_SIZE *sizeof (*table_perturb)); +get_random_slow_once (table_perturb, +INET_TABLE_PERTURB_SIZE *sizeof (*table_perturb)); index = port_offset & (INET_TABLE_PERTURB_SIZE -1 ); offset =READ_ONCE (table_perturb[index]) + (port_offset >>32 );
Greg Kroah-Hartman
maintainerPATCH 3/338 mm/khugepaged: fix GUP-fast interaction by sending IPI
In reply to Greg Kroah-HartmanFrom: Jann Horn <[email protected]>
commit 2ba99c5e08812494bc57f319fb562f527d9bacd8 upstream.
Since commit 70cbc3cc78a99 ("mm: gup: fix the fast GUP race against THP collapse"), the lockless_pages_from_mm() fastpath rechecks the pmd_t to ensure that the page table was not removed by khugepaged in between.
However, lockless_pages_from_mm() still requires that the page table is not concurrently freed. Fix it by sending IPIs (if the architecture uses semi-RCU-style page table freeing) before freeing/reusing page tables.
[manual backport: two of the three places in khugepaged that can free ptes were refactored into a common helper between 5.15 and 6.0; TLB flushing was refactored between 5.4 and 5.10;
TLB flushing was refactored between 4.19 and 5.4;
pmd collapse for PTE-mapped THP was only added in 5.4; ugly hack for s390 in <=4.19 and arm]
--- include/asm-generic/tlb.h | 6 ++++++ mm/khugepaged.c | 15 +++++++++++++++ mm/memory.c | 5 +++++ 3 files changed, 26 insertions(+)
include/asm-generic/tlb.h +6 -0
@@ -60,6 +60,12 @@ struct mmu_table_batch {extern void tlb_table_flush (struct mmu_gather *tlb);extern void tlb_remove_table (struct mmu_gather *tlb,void *table); +void tlb_remove_table_sync_one (void ); + +#else + +static inline void tlb_remove_table_sync_one (void ) { } +#endif /*
mm/khugepaged.c +15 -0
@@ -23,6 +23,19 @@#include <asm/pgalloc.h> #include "internal.h" +/* gross hack for <=4.19 stable */ +#if defined(CONFIG_S390 ) || defined(CONFIG_ARM ) +static void tlb_remove_table_smp_sync (void *arg) +{ +/* Simply deliver the interrupt */ +} + +static void tlb_remove_table_sync_one (void ) +{ +smp_call_function (tlb_remove_table_smp_sync,NULL ,1 ); +} +#endif +enum scan_result {SCAN_FAIL ,SCAN_SUCCEED ,
@@ -1046,6 +1059,7 @@ static void collapse_huge_page(struct mm _pmd =pmdp_collapse_flush (vma, address, pmd);spin_unlock (pmd_ptl);mmu_notifier_invalidate_range_end (mm, mmun_start, mmun_end); +tlb_remove_table_sync_one ();spin_lock (pte_ptl); isolated =__collapse_huge_page_isolate (vma, address, pte);
@@ -1295,6 +1309,7 @@ static void retract_page_tables(struct a _pmd =pmdp_collapse_flush (vma, addr, pmd);spin_unlock (ptl);atomic_long_dec (&mm->nr_ptes); +tlb_remove_table_sync_one ();pte_free (mm,pmd_pgtable (_pmd)); }up_write (&mm->mmap_sem);
mm/memory.c +5 -0
@@ -373,6 +373,11 @@ static void tlb_remove_table_smp_sync(vo/* Simply deliver the interrupt */ } +void tlb_remove_table_sync_one (void ) +{ +smp_call_function (tlb_remove_table_smp_sync,NULL ,1 ); +} +static void tlb_remove_table_one (void *table) {/*
Greg Kroah-Hartman
maintainerPATCH 4/338 mm/khugepaged: invoke MMU notifiers in shmem/file collapse paths
In reply to Greg Kroah-HartmanFrom: Jann Horn <[email protected]>
commit f268f6cf875f3220afc77bdd0bf1bb136eb54db9 upstream.
Any codepath that zaps page table entries must invoke MMU notifiers to ensure that secondary MMUs (like KVM) don't keep accessing pages which aren't mapped anymore. Secondary MMUs don't hold their own references to pages that are mirrored over, so failing to notify them can lead to page use-after-free.
I'm marking this as addressing an issue introduced in commit f3f0e1d2150b ("khugepaged: add support of collapse for tmpfs/shmem pages"), but most of the security impact of this only came in commit 27e1f8273113 ("khugepaged:
enable collapse pmd for pte-mapped THP"), which actually omitted flushes for the removal of present PTEs, not just for the removal of empty page tables.
[manual backport: this code was refactored from two copies into a common helper between 5.15 and 6.0;
pmd collapse for PTE-mapped THP was only added in 5.4;
MMU notifier API changed between 4.19 and 5.4]
--- mm/khugepaged.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
mm/khugepaged.c +8 -1
@@ -1304,13 +1304,20 @@ static void retract_page_tables(struct a*/ if (down_write_trylock (&mm->mmap_sem)) {if (!khugepaged_test_exit (mm)) { -spinlock_t *ptl =pmd_lock (mm, pmd); +spinlock_t *ptl; +unsigned long end = addr +HPAGE_PMD_SIZE ; + +mmu_notifier_invalidate_range_start (mm, addr, + end); + ptl =pmd_lock (mm, pmd);/* assume page table is clear */ _pmd =pmdp_collapse_flush (vma, addr, pmd);spin_unlock (ptl);atomic_long_dec (&mm->nr_ptes);tlb_remove_table_sync_one ();pte_free (mm,pmd_pgtable (_pmd)); +mmu_notifier_invalidate_range_end (mm, addr, + end); }up_write (&mm->mmap_sem); }
Greg Kroah-Hartman
maintainerPATCH 5/338 block: unhash blkdev part inode when the part is deleted
In reply to Greg Kroah-HartmanFrom: Ming Lei <[email protected]>
v5.11 changes the blkdev lookup mechanism completely since commit 22ae8ce8b892 ("block: simplify bdev/disk lookup in blkdev_get"), and small part of the change is to unhash part bdev inode when deleting partition. Turns out this kind of change does fix one nasty issue in case of BLOCK_EXT_MAJOR:
1) when one partition is deleted & closed, disk_put_part() is always called before bdput(bdev), see blkdev_put(); so the part's devt can be freed & re-used before the inode is dropped
2) then new partition with same devt can be created just before the inode in 1) is dropped, then the old inode/bdev structurein 1) is re-used for this new partition, this way causes use-after-free and kernel panic.
It isn't possible to backport the whole big patchset of "merge struct block_device and struct hd_struct v4" for addressing this issue.
https://lore.kernel.org/linux-block/[email protected]/
So fixes it by unhashing part bdev in delete_partition(), and this way is actually aligned with v5.11+'s behavior.
Backported from the following 5.10.y commit:
5f2f77560591 ("block: unhash blkdev part inode when the part is deleted")
--- block/partition-generic.c | 6 ++++++ 1 file changed, 6 insertions(+)
block/partition-generic.c +6 -0
@@ -270,6 +270,7 @@ void delete_partition(struct gendisk *distruct disk_part_tbl *ptbl =rcu_dereference_protected (disk->part_tbl,1 );struct hd_struct *part; +struct block_device *bdev;if (partno >= ptbl->len)return ;
@@ -283,6 +284,11 @@ void delete_partition(struct gendisk *dikobject_put (part->holder_dir);device_del (part_to_dev (part)); + bdev =bdget (part_devt (part)); +if (bdev) { +remove_inode_hash (bdev->bd_inode); +bdput (bdev); + }hd_struct_kill (part); }
Greg Kroah-Hartman
maintainerPATCH 6/338 nfp: fix use-after-free in area_cache_get()
In reply to Greg Kroah-HartmanFrom: Jialiang Wang <[email protected]>
commit 02e1a114fdb71e59ee6770294166c30d437bf86a upstream.
area_cache_get() is used to distribute cache->area and set cache->id,
and if cache->id is not 0 and cache->area->kref refcount is 0, it will release the cache->area by nfp_cpp_area_release(). area_cache_get() set cache->id before cpp->op->area_init() and nfp_cpp_area_acquire().
But if area_init() or nfp_cpp_area_acquire() fails, the cache->id is
is already set but the refcount is not increased as expected. At this time, calling the nfp_cpp_area_release() will cause use-after-free.
To avoid the use-after-free, set cache->id after area_init() and
nfp_cpp_area_acquire() complete successfully.
Note: This vulnerability is triggerable by providing emulated device
equipped with specified configuration.
BUG: KASAN: use-after-free in nfp6000_area_init (drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c:760) Write of size 4 at addr ffff888005b7f4a0 by task swapper/0/1 Call Trace: <TASK> nfp6000_area_init (drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c:760) area_cache_get.constprop.8 (drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c:884) Allocated by task 1: nfp_cpp_area_alloc_with_name (drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c:303) nfp_cpp_area_cache_add (drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c:802) nfp6000_init (drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c:1230) nfp_cpp_from_operations (drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c:1215) nfp_pci_probe (drivers/net/ethernet/netronome/nfp/nfp_main.c:744) Freed by task 1: kfree (mm/slub.c:4562) area_cache_get.constprop.8 (drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c:873) nfp_cpp_read (drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c:924 drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c:973) nfp_cpp_readl (drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpplib.c:48)
--- drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c +2 -1
@@ -858,7 +858,6 @@ area_cache_get(struct nfp_cpp *cpp, u32 }/* Adjust the start address to be cache size aligned */ - cache->id = id; cache->addr = addr & ~(u64)(cache->size -1 );/* Re-init to the new ID and address */
@@ -878,6 +877,8 @@ area_cache_get(struct nfp_cpp *cpp, u32return NULL ; } + cache->id = id; + exit:/* Adjust offset */ *offset = addr - cache->addr;
Greg Kroah-Hartman
maintainerPATCH 7/338 ASoC: ops: Check bounds for second channel in snd_soc_put_volsw_sx()
In reply to Greg Kroah-HartmanFrom: Mark Brown <[email protected]>
[ Upstream commit 97eea946b93961fffd29448dcda7398d0d51c4b2 ]
The bounds checks in snd_soc_put_volsw_sx() are only being applied to the first channel, meaning it is possible to write out of bounds values to the second channel in stereo controls. Add appropriate checks.
--- sound/soc/soc-ops.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/soc/soc-ops.c +6 -0
@@ -465,6 +465,12 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,if (snd_soc_volsw_is_stereo (mc)) { val_mask = mask << rshift; val2 = (ucontrol->value.integer.value[1 ] + min) & mask; + +if (mc->platform_max && val2 > mc->platform_max) +return -EINVAL ; +if (val2 > max) +return -EINVAL ; + val2 = val2 << rshift; err = snd_soc_component_update_bits(component, reg2, val_mask,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 8/338 can: sja1000: fix size of OCR_MODE_MASK define
In reply to Greg Kroah-HartmanFrom: Heiko Schocher <[email protected]>
[ Upstream commit 26e8f6a75248247982458e8237b98c9fb2ffcf9d ]
bitfield mode in ocr register has only 2 bits not 3, so correct the OCR_MODE_MASK define.
--- include/linux/can/platform/sja1000.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/can/platform/sja1000.h +1 -1
@@ -14,7 +14,7 @@#define OCR_MODE_TEST 0x01#define OCR_MODE_NORMAL 0x02#define OCR_MODE_CLOCK 0x03 -#define OCR_MODE_MASK 0x07 +#define OCR_MODE_MASK 0x03#define OCR_TX0_INVERT 0x04#define OCR_TX0_PULLDOWN 0x08#define OCR_TX0_PULLUP 0x10
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 9/338 can: mcba_usb: Fix termination command argument
In reply to Greg Kroah-HartmanFrom: Yasushi SHOJI <[email protected]>
[ Upstream commit 1a8e3bd25f1e789c8154e11ea24dc3ec5a4c1da0 ]
Microchip USB Analyzer can activate the internal termination resistors by setting the "termination" option ON, or OFF to to deactivate them. As I've observed, both with my oscilloscope and captured USB packets below, you must send "0" to turn it ON, and "1" to turn it OFF.
Quoted 1 line
From the schematics in the user's guide, I can confirm that you must
drive the CAN_RES signal LOW "0" to activate the resistors.
Reverse the argument value of usb_msg.termination to fix this.
These are the two commands sequence, ON then OFF.
Quoted 7 lines
No. Time Source Destination Protocol Length Info 1 0.000000 host 1.3.1 USB 46 URB_BULK outFrame 1: 46 bytes on wire (368 bits), 46 bytes captured (368 bits) USB URB
Leftover Capture Data:a80000000000000000000000000000000000a8
Quoted 6 lines
No. Time Source Destination Protocol Length Info 2 4.372547 host 1.3.1 USB 46 URB_BULK outFrame 2: 46 bytes on wire (368 bits), 46 bytes captured (368 bits) USB URB
Leftover Capture Data:a80100000000000000000000000000000000a9
--- drivers/net/can/usb/mcba_usb.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/can/usb/mcba_usb.c +7 -3
@@ -58,6 +58,10 @@#define MCBA_VER_REQ_USB 1#define MCBA_VER_REQ_CAN 2 +/* Drive the CAN_RES signal LOW "0" to activate R24 and R25 */ +#define MCBA_VER_TERMINATION_ON 0 +#define MCBA_VER_TERMINATION_OFF 1 +#define MCBA_SIDL_EXID_MASK 0x8#define MCBA_DLC_MASK 0xf#define MCBA_DLC_RTR_MASK 0x40
@@ -480,7 +484,7 @@ static void mcba_usb_process_ka_usb(struct mcba_priv *priv, priv->usb_ka_first_pass = false; } -if (msg->termination_state) +if (msg->termination_state ==MCBA_VER_TERMINATION_ON ) priv->can.termination =MCBA_TERMINATION_ENABLED ;else priv->can.termination =MCBA_TERMINATION_DISABLED ;
@@ -800,9 +804,9 @@ static int mcba_set_termination(struct net_device *netdev, u16 term) };if (term ==MCBA_TERMINATION_ENABLED ) - usb_msg.termination =1 ; + usb_msg.termination =MCBA_VER_TERMINATION_ON ;else - usb_msg.termination =0 ; + usb_msg.termination =MCBA_VER_TERMINATION_OFF ;mcba_usb_xmit_cmd (priv, (struct mcba_usb_msg *)&usb_msg);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainercover 4.14.303-rc1 review
This is the start of the stable review cycle for the 4.14.303 release. There are 338 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 18 Jan 2023 15:47:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.303-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.14.303-rc1
Ferry Toth <[email protected]>
Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout"
Minsuk Kang <[email protected]>
nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame()
Roger Pau Monne <[email protected]>
hvc/xen: lock console list traversal
Ricardo Ribalda <[email protected]>
regulator: da9211: Use irq handler when ready
Eliav Farber <[email protected]>
EDAC/device: Fix period calculation in edac_device_reset_delay_period()
Peter Zijlstra <[email protected]>
x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
Gavrilov Ilia <[email protected]>
netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() function.
Herbert Xu <[email protected]>
ipv6: raw: Deduct extension header length in rawv6_push_pending_frames
Hans de Goede <[email protected]>
platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during probe
Clement Lecigne <[email protected]>
ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
Paolo Abeni <[email protected]>
net/ulp: prevent ULP without clone op from entering the LISTEN status
Heiko Carstens <[email protected]>
s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()
Adrian Hunter <[email protected]>
perf auxtrace: Fix address filter duplicate symbol selection
Jonathan Corbet <[email protected]>
docs: Fix the docs build with Sphinx 6.0
Frederick Lawler <[email protected]>
net: sched: disallow noqueue for qdisc classes
Biju Das <[email protected]>
ravb: Fix "failed to switch device to config mode" message during unbind
Isaac J. Manjarres <[email protected]>
driver core: Fix bus_type.match() error handling in __driver_attach()
Helge Deller <[email protected]>
parisc: Align parisc MADV_XXX constants with all other architectures
Linus Torvalds <[email protected]>
hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling
Arnd Bergmann <[email protected]>
hfs/hfsplus: use WARN_ON for sanity check
Jeff Layton <[email protected]>
nfsd: fix handling of readdir in v4root vs. mount upcall timeout
Rodrigo Branco <[email protected]>
x86/bugs: Flush IBP in ib_prctl_set()
Jan Kara <[email protected]>
udf: Fix extension of the last extent in the file
Zhengchao Shao <[email protected]>
caif: fix memory leak in cfctrl_linkup_request()
Szymon Heidrich <[email protected]>
usb: rndis_host: Secure rndis_query check against int overflow
Jamal Hadi Salim <[email protected]>
net: sched: atm: dont intepret cls results when asked to drop
Miaoqian Lin <[email protected]>
net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe
Jiguang Xiao <[email protected]>
net: amd-xgbe: add missed tasklet_kill
Miaoqian Lin <[email protected]>
nfc: Fix potential resource leaks
Daniil Tatianin <[email protected]>
qlcnic: prevent ->dcb use-after-free on qlcnic_dcb_enable() failure
Jakub Kicinski <[email protected]>
bpf: pull before calling skb_postpull_rcsum()
minoura makoto <[email protected]>
SUNRPC: ensure the matching upcall is in-flight upon downcall
Ye Bin <[email protected]>
ext4: allocate extended attribute value in vmalloc area
Jan Kara <[email protected]>
ext4: avoid unaccounted block allocation when expanding inode
Jan Kara <[email protected]>
ext4: initialize quota before expanding inode in setproject ioctl
Ye Bin <[email protected]>
ext4: fix inode leak in ext4_xattr_inode_create() on an error path
Jan Kara <[email protected]>
ext4: avoid BUG_ON when creating xattrs
Luís Henriques <[email protected]>
ext4: fix error code return to user-space in ext4_get_branch()
Ye Bin <[email protected]>
ext4: init quota for 'old.inode' in 'ext4_rename'
Baokun Li <[email protected]>
ext4: fix bug_on in __es_tree_search caused by bad boot loader inode
Gaosheng Cui <[email protected]>
ext4: fix undefined behavior in bit shift for ext4_check_flag_values
Baokun Li <[email protected]>
ext4: add inode table check in __ext4_get_inode_loc to aovid possible infinite loop
Zack Rusin <[email protected]>
drm/vmwgfx: Validate the box size for the snooped cursor
Simon Ser <[email protected]>
drm/connector: send hotplug uevent on connector cleanup
Wang Weiyang <[email protected]>
device_cgroup: Roll back to original exceptions after copy failure
Shang XiaoJing <[email protected]>
parisc: led: Fix potential null-ptr-deref in start_task()
Kim Phillips <[email protected]>
iommu/amd: Fix ivrs_acpihid cmdline parsing code
Corentin Labbe <[email protected]>
crypto: n2 - add missing hash statesize
Sascha Hauer <[email protected]>
PCI/sysfs: Fix double free in error path
Michael S. Tsirkin <[email protected]>
PCI: Fix pci_device_is_present() for VFs by checking PF
Huaxin Lu <[email protected]>
ima: Fix a potential NULL pointer access in ima_restore_measurement_list
Paulo Alcantara <[email protected]>
cifs: fix confusing debug message
Takashi Iwai <[email protected]>
media: dvb-core: Fix UAF due to refcount races at releasing
Keita Suzuki <[email protected]>
media: dvb-core: Fix double free in dvb_register_device()
Nick Desaulniers <[email protected]>
ARM: 9256/1: NWFPE: avoid compiler-generated __aeabi_uldivmod
Yang Jihong <[email protected]>
tracing: Fix infinite loop in tracing_read_pipe on overflowed print_trace_line
Ashok Raj <[email protected]>
x86/microcode/intel: Do not retry microcode reloading on the APs
Mike Snitzer <[email protected]>
dm cache: set needs_check flag after aborting metadata
Luo Meng <[email protected]>
dm cache: Fix UAF in destroy()
Luo Meng <[email protected]>
dm thin: Fix UAF in run_timer_softirq()
Zhihao Cheng <[email protected]>
dm thin: Use last transaction's pmd->root when commit failed
Mike Snitzer <[email protected]>
dm cache: Fix ABBA deadlock between shrink_slab and dm_cache_metadata_abort
Mickaël Salaün <[email protected]>
selftests: Use optional USERCFLAGS and USERLDFLAGS
Jason A. Donenfeld <[email protected]>
ARM: ux500: do not directly dereference __iomem
Steven Rostedt <[email protected]>
ktest.pl minconfig: Unset configs instead of just removing them
Jason A. Donenfeld <[email protected]>
media: stv0288: use explicitly signed char
Hanjun Guo <[email protected]>
tpm: tpm_tis: Add the missed acpi_put_table() to fix memory leak
Hanjun Guo <[email protected]>
tpm: tpm_crb: Add the missed acpi_put_table() to fix memory leak
Deren Wu <[email protected]>
mmc: vub300: fix warning - do not call blocking ops when !TASK_RUNNING
Mikulas Patocka <[email protected]>
md: fix a crash in mempool_free
Christian Brauner <[email protected]>
pnode: terminate at peers of source
Artem Egorkine <[email protected]>
ALSA: line6: fix stack overflow in line6_midi_transmit
Artem Egorkine <[email protected]>
ALSA: line6: correct midi status byte when receiving data from podxt
Aditya Garg <[email protected]>
hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount
Terry Junge <[email protected]>
HID: plantronics: Additional PIDs for double volume key presses quirk
Nathan Lynch <[email protected]>
powerpc/rtas: avoid scheduling in rtas_os_term()
Nathan Lynch <[email protected]>
powerpc/rtas: avoid device tree lookups in rtas_os_term()
Lin Ma <[email protected]>
media: dvbdev: fix refcnt bug
Rickard x Andersson <[email protected]>
gcov: add support for checksum field
Nuno Sá <[email protected]>
iio: adc: ad_sigma_delta: do not use internal iio_dev lock
Roberto Sassu <[email protected]>
reiserfs: Add missing calls to reiserfs_security_free()
Jason Gerecke <[email protected]>
HID: wacom: Ensure bootloader PID is usable in hidraw mode
Ferry Toth <[email protected]>
usb: dwc3: core: defer probe on ulpi_read_id timeout
John Stultz <[email protected]>
pstore: Make sure CONFIG_PSTORE_PMSG selects CONFIG_RT_MUTEXES
John Stultz <[email protected]>
pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion
Hans de Goede <[email protected]>
ASoC: rt5670: Remove unbalanced pm_runtime_put()
Wang Jingjin <[email protected]>
ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in rk_spdif_runtime_resume()
Marek Szyprowski <[email protected]>
ASoC: wm8994: Fix potential deadlock
Wang Jingjin <[email protected]>
ASoC: rockchip: pdm: Add missing clk_disable_unprepare() in rockchip_pdm_runtime_resume()
Wang Yufen <[email protected]>
ASoC: mediatek: mt8173-rt5650-rt5514: fix refcount leak in mt8173_rt5650_rt5514_dev_probe()
Zhang Xiaoxu <[email protected]>
orangefs: Fix kmemleak in orangefs_prepare_debugfs_help_string()
Nathan Chancellor <[email protected]>
drm/sti: Fix return type of sti_{dvo,hda,hdmi}_connector_mode_valid()
Nathan Chancellor <[email protected]>
drm/fsl-dcu: Fix return type of fsl_dcu_drm_connector_mode_valid()
Xiu Jianfeng <[email protected]>
clk: st: Fix memory leak in st_of_quadfs_setup()
Shigeru Yoshida <[email protected]>
media: si470x: Fix use-after-free in si470x_int_in_callback()
Kunihiko Hayashi <[email protected]>
mmc: f-sdh30: Add quirks for broken timeout clock capability
Ye Bin <[email protected]>
blk-mq: fix possible memleak when register 'hctx' failed
Mazin Al Haddad <[email protected]>
media: dvb-usb: fix memory leak in dvb_usb_adapter_init()
Lin Ma <[email protected]>
media: dvbdev: adopts refcnt to avoid UAF
Yan Lei <[email protected]>
media: dvb-frontends: fix leak of memory fw
Stanislav Fomichev <[email protected]>
ppp: associate skb with a device at tx
Schspa Shi <[email protected]>
mrp: introduce active flags to prevent UAF when applicant uninit
Jiang Li <[email protected]>
md/raid1: stop mdx_raid1 thread when raid1 array run failed
Ville Syrjälä <[email protected]>
drm/sti: Use drm_mode_copy()
Nathan Chancellor <[email protected]>
s390/lcs: Fix return type of lcs_start_xmit()
Nathan Chancellor <[email protected]>
s390/netiucv: Fix return type of netiucv_tx()
Nathan Chancellor <[email protected]>
s390/ctcm: Fix return type of ctc{mp,}m_tx()
Kees Cook <[email protected]>
igb: Do not free q_vector unless new one was allocated
Minsuk Kang <[email protected]>
wifi: brcmfmac: Fix potential shift-out-of-bounds in brcmf_fw_alloc_request()
Nathan Chancellor <[email protected]>
hamradio: baycom_epp: Fix return type of baycom_send_packet()
Nathan Chancellor <[email protected]>
net: ethernet: ti: Fix return type of netcp_ndo_start_xmit()
Stanislav Fomichev <[email protected]>
bpf: make sure skb->len != 0 when redirecting to a tunneling device
Zhang Yuchen <[email protected]>
ipmi: fix memleak when unload ipmi driver
Amadeusz Sławiński <[email protected]>
ASoC: codecs: rt298: Add quirk for KBL-R RVP platform
Shigeru Yoshida <[email protected]>
wifi: ar5523: Fix use-after-free on ar5523_cmd() timed out
Fedor Pchelkin <[email protected]>
wifi: ath9k: verify the expected usb_endpoints are present
ZhangPeng <[email protected]>
hfs: fix OOB Read in __hfs_brec_find
Zheng Yejian <[email protected]>
acct: fix potential integer overflow in encode_comp_t()
Ryusuke Konishi <[email protected]>
nilfs2: fix shift-out-of-bounds/overflow in nilfs_sb2_bad_offset()
Rafael J. Wysocki <[email protected]>
ACPICA: Fix error code path in acpi_ds_call_control_method()
Hoi Pok Wu <[email protected]>
fs: jfs: fix shift-out-of-bounds in dbDiscardAG
Shigeru Yoshida <[email protected]>
udf: Avoid double brelse() in udf_rename()
Dongliang Mu <[email protected]>
fs: jfs: fix shift-out-of-bounds in dbAllocAG
Liu Shixin <[email protected]>
binfmt_misc: fix shift-out-of-bounds in check_special_flags
Eric Dumazet <[email protected]>
net: stream: purge sk_error_queue in sk_stream_kill_queues()
Christophe JAILLET <[email protected]>
myri10ge: Fix an error handling path in myri10ge_probe()
Cong Wang <[email protected]>
net_sched: reject TCF_EM_SIMPLE case for complex ematch module
Subash Abhinov Kasiviswanathan <[email protected]>
skbuff: Account for tail adjustment during pull operations
Eelco Chaudron <[email protected]>
openvswitch: Fix flow lookup to use unmasked key
Li Zetao <[email protected]>
r6040: Fix kmemleak in probe and remove
Minsuk Kang <[email protected]>
nfc: pn533: Clear nfc_target before being used
Yang Yingliang <[email protected]>
mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
mISDN: hfcpci: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
mISDN: hfcsusb: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
Dan Aloni <[email protected]>
nfsd: under NFSv4.1, fix double svc_xprt_put on rpc_create failure
Gaosheng Cui <[email protected]>
rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
Miaoqian Lin <[email protected]>
selftests/powerpc: Fix resource leaks
Kajol Jain <[email protected]>
powerpc/hv-gpci: Fix hv_gpci event list
Yang Yingliang <[email protected]>
powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe()
Nicholas Piggin <[email protected]>
powerpc/perf: callchain validate kernel stack pointer bounds
Yang Yingliang <[email protected]>
powerpc/xive: add missing iounmap() in error path in xive_spapr_populate_irq_data()
Miaoqian Lin <[email protected]>
cxl: Fix refcount leak in cxl_calc_capp_routing
Christophe JAILLET <[email protected]>
powerpc/52xx: Fix a resource leak in an error handling path
Xie Shaowen <[email protected]>
macintosh/macio-adb: check the return value of ioremap()
Yang Yingliang <[email protected]>
macintosh: fix possible memory leak in macio_add_one_device()
Yuan Can <[email protected]>
iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe()
Yang Yingliang <[email protected]>
iommu/amd: Fix pci device refcount leak in ppr_notifier()
Stefan Eichenberger <[email protected]>
rtc: snvs: Allow a time difference on clock register read
Matt Redfearn <[email protected]>
include/uapi/linux/swab: Fix potentially missing __always_inline
Yuan Can <[email protected]>
HSI: omap_ssi_core: Fix error handling in ssi_init()
Zeng Heng <[email protected]>
power: supply: fix residue sysfs file in error handle route of __power_supply_register()
Yang Yingliang <[email protected]>
HSI: omap_ssi_core: fix possible memory leak in ssi_probe()
Yang Yingliang <[email protected]>
HSI: omap_ssi_core: fix unbalanced pm_runtime_disable()
Christophe JAILLET <[email protected]>
fbdev: uvesafb: Fixes an error handling path in uvesafb_probe()
Xiongfeng Wang <[email protected]>
fbdev: vermilion: decrease reference count in error path
Shang XiaoJing <[email protected]>
fbdev: via: Fix error in via_core_init()
Yang Yingliang <[email protected]>
fbdev: pm2fb: fix missing pci_disable_device()
Andy Shevchenko <[email protected]>
fbdev: ssd1307fb: Drop optional dependency
Jiasheng Jiang <[email protected]>
usb: storage: Add check for kcalloc
Zheyu Ma <[email protected]>
i2c: ismt: Fix an out-of-bounds bug in ismt_access()
Chen Zhongjin <[email protected]>
vme: Fix error not catched in fake_init()
YueHaibing <[email protected]>
staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()
Dan Carpenter <[email protected]>
staging: rtl8192u: Fix use after free in ieee80211_rx()
Hui Tang <[email protected]>
i2c: pxa-pci: fix missing pci_disable_device() on error in ce4100_i2c_probe
Yang Yingliang <[email protected]>
chardev: fix error handling in cdev_device_add()
Yang Yingliang <[email protected]>
mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
Zhengchao Shao <[email protected]>
drivers: mcb: fix resource leak in mcb_probe()
Yang Yingliang <[email protected]>
cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()
Yang Yingliang <[email protected]>
cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()
Zheng Wang <[email protected]>
misc: sgi-gru: fix use-after-free error in gru_set_context_option, gru_fault and gru_handle_user_call_os
ruanjinjie <[email protected]>
misc: tifm: fix possible memory leak in tifm_7xx1_switch_media()
Zhengchao Shao <[email protected]>
test_firmware: fix memory leak in test_firmware_init()
Yuan Can <[email protected]>
serial: sunsab: Fix error handling in sunsab_init()
Xiongfeng Wang <[email protected]>
serial: pch: Fix PCI device refcount leak in pch_request_dma()
Jiamei Xie <[email protected]>
serial: amba-pl011: avoid SBSA UART accessing DMACR register
Gaosheng Cui <[email protected]>
staging: vme_user: Fix possible UAF in tsi148_dma_list_add
Linus Walleij <[email protected]>
usb: fotg210-udc: Fix ages old endianness issues
Rafael Mendonca <[email protected]>
uio: uio_dmem_genirq: Fix deadlock between irq config and handling
Rafael Mendonca <[email protected]>
uio: uio_dmem_genirq: Fix missing unlock in irq configuration
Rafael Mendonca <[email protected]>
vfio: platform: Do not pass return buffer to ACPI _RST method
Yang Yingliang <[email protected]>
class: fix possible memory leak in __class_register()
Yang Yingliang <[email protected]>
drivers: dio: fix possible memory leak in dio_init()
Dragos Tatulea <[email protected]>
IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces
Xiongfeng Wang <[email protected]>
hwrng: geode - Fix PCI device refcount leak
Xiongfeng Wang <[email protected]>
hwrng: amd - Fix PCI device refcount leak
Gaosheng Cui <[email protected]>
crypto: img-hash - Fix variable dereferenced before check 'hdev->req'
Zhang Xiaoxu <[email protected]>
orangefs: Fix sysfs not cleanup when dev init failed
Wang Yufen <[email protected]>
RDMA/hfi1: Fix error return code in parse_platform_config()
Gaosheng Cui <[email protected]>
scsi: snic: Fix possible UAF in snic_tgt_create()
Chen Zhongjin <[email protected]>
scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
Shang XiaoJing <[email protected]>
scsi: ipr: Fix WARNING in ipr_init()
Yang Yingliang <[email protected]>
scsi: fcoe: Fix possible name leak when device_register() fails
Yang Yingliang <[email protected]>
scsi: hpsa: Fix possible memory leak in hpsa_add_sas_device()
Yang Yingliang <[email protected]>
scsi: hpsa: Fix error handling in hpsa_add_sas_host()
Zhang Xiaoxu <[email protected]>
RDMA/rxe: Fix NULL-ptr-deref in rxe_qp_do_cleanup() when socket create failed
Xiongfeng Wang <[email protected]>
RDMA/hfi: Decrease PCI device reference count in error path
Zeng Heng <[email protected]>
PCI: Check for alloc failure in pci_request_irq()
Gaosheng Cui <[email protected]>
apparmor: fix a memleak in multi_transaction_new()
Piergiorgio Beruto <[email protected]>
stmmac: fix potential division by 0
Yang Yingliang <[email protected]>
Bluetooth: RFCOMM: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: hci_core: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: hci_bcsp: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: hci_h5: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: hci_qca: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: btusb: don't call kfree_skb() under spin_lock_irqsave()
Eric Pilmore <[email protected]>
ntb_netdev: Use dev_kfree_skb_any() in interrupt context
Jerry Ray <[email protected]>
net: lan9303: Fix read error execution path
Tom Lendacky <[email protected]>
net: amd-xgbe: Check only the minimum speed for active/passive cables
Yang Yingliang <[email protected]>
net: amd: lance: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
hamradio: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
net: ethernet: dnet: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
net: emaclite: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
net: apple: bmac: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
net: apple: mace: don't call dev_kfree_skb() under spin_lock_irqsave()
Hangbin Liu <[email protected]>
net/tunnel: wait until all sk_user_data reader finish before releasing the sock
Li Zetao <[email protected]>
net: farsync: Fix kmemleak when rmmods farsync
Yang Yingliang <[email protected]>
ethernet: s2io: don't call dev_kfree_skb() under spin_lock_irqsave()
Yuan Can <[email protected]>
drivers: net: qlcnic: Fix potential memory leak in qlcnic_sriov_init()
Yongqiang Liu <[email protected]>
net: defxx: Fix missing err handling in dfx_init()
Artem Chernyshev <[email protected]>
net: vmw_vsock: vmci: Check memcpy_from_msg()
Yang Jihong <[email protected]>
blktrace: Fix output non-blktrace event when blk_classic option enabled
Wang Yufen <[email protected]>
wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Add __packed to struct rtl8723bu_c2h
Xiu Jianfeng <[email protected]>
clk: samsung: Fix memory leak in _samsung_clk_register_pll()
Jiasheng Jiang <[email protected]>
media: coda: Add check for kmalloc
Jiasheng Jiang <[email protected]>
media: coda: Add check for dcoda_iram_alloc
Liang He <[email protected]>
media: c8sectpfe: Add of_node_put() when breaking out of loop
Yang Yingliang <[email protected]>
mmc: mmci: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: wbsd: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: via-sdmmc: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: wmt-sdmmc: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: vub300: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: toshsd: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: rtsx_usb_sdmmc: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: mxcmmc: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: moxart: fix return value check of mmc_add_host()
Trond Myklebust <[email protected]>
NFSv4.x: Fail client initialisation if state manager thread can't run
Wang ShaoBo <[email protected]>
SUNRPC: Fix missing release socket in rpc_sockname()
Gaosheng Cui <[email protected]>
ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt
Liu Shixin <[email protected]>
media: saa7164: fix missing pci_disable_device()
Yang Yingliang <[email protected]>
regulator: core: fix module refcount leak in set_supply()
Zhengchao Shao <[email protected]>
wifi: mac80211: fix memory leak in ieee80211_if_add()
Dan Carpenter <[email protected]>
bonding: uninitialized variable in bond_miimon_inspect()
Zhang Qilong <[email protected]>
ASoC: pcm512x: Fix PM disable depth imbalance in pcm512x_probe
Xiongfeng Wang <[email protected]>
drm/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()
Xiongfeng Wang <[email protected]>
drm/radeon: Fix PCI device refcount leak in radeon_atrm_get_bios()
Liu Shixin <[email protected]>
ALSA: asihpi: fix missing pci_disable_device()
Trond Myklebust <[email protected]>
NFSv4: Fix a deadlock between nfs4_open_recover_helper() and delegreturn
Trond Myklebust <[email protected]>
NFSv4.2: Fix a memory stomp in decode_attr_security_label
Aakarsh Jain <[email protected]>
media: s5p-mfc: Add variant data for MFC v7 hardware for Exynos 3250 SoC
Baisong Zhong <[email protected]>
media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()
ZhangPeng <[email protected]>
pinctrl: pinconf-generic: add missing of_node_put()
Gautam Menghani <[email protected]>
media: imon: fix a race condition in send_packet()
Zheng Yongjun <[email protected]>
mtd: maps: pxa2xx-flash: fix memory leak in probe
Xiu Jianfeng <[email protected]>
clk: rockchip: Fix memory leak in rockchip_clk_register_pll()
Baisong Zhong <[email protected]>
ALSA: seq: fix undefined behavior in bit shift for SNDRV_SEQ_FILTER_USE_EVENT
Marcus Folkesson <[email protected]>
HID: hid-sensor-custom: set fixed size for custom attributes
Yuan Can <[email protected]>
media: platform: exynos4-is: Fix error handling in fimc_md_init()
Yang Yingliang <[email protected]>
media: solo6x10: fix possible memory leak in solo_sysfs_init()
Douglas Anderson <[email protected]>
Input: elants_i2c - properly handle the reset GPIO when power is off
Hui Tang <[email protected]>
mtd: lpddr2_nvm: Fix possible null-ptr-deref
Xiu Jianfeng <[email protected]>
wifi: ath10k: Fix return value in ath10k_pci_init()
Xiu Jianfeng <[email protected]>
ima: Fix misuse of dereference of pointer in template_desc_init_fields()
Yang Yingliang <[email protected]>
regulator: core: fix unbalanced of node refcount in regulator_dev_lookup()
Zeng Heng <[email protected]>
ASoC: pxa: fix null-pointer dereference in filter()
Hanjun Guo <[email protected]>
drm/radeon: Add the missed acpi_put_table() to fix memory leak
Vladimir Zapolskiy <[email protected]>
media: camss: Clean up received buffers on failed start of streaming
Zhang Xiaoxu <[email protected]>
mtd: Fix device name leak when register device failed in add_mtd_device()
Liu Shixin <[email protected]>
media: vivid: fix compose size exceed boundary
Jonathan Neuschäfer <[email protected]>
spi: Update reference to struct spi_controller
Ricardo Ribalda <[email protected]>
media: i2c: ad5820: Fix error path
Fedor Pchelkin <[email protected]>
wifi: ath9k: hif_usb: Fix use-after-free in ath9k_hif_usb_reg_in_cb()
Fedor Pchelkin <[email protected]>
wifi: ath9k: hif_usb: fix memory leak of urbs in ath9k_hif_usb_dealloc_tx_urbs()
Cai Xinchen <[email protected]>
rapidio: devices: fix missing put_device in mport_cdev_open
ZhangPeng <[email protected]>
hfs: Fix OOB Write in hfs_asc2mac
Zhang Qilong <[email protected]>
eventfd: change int to __u64 in eventfd_signal() ifndef CONFIG_EVENTFD
Wang Weiyang <[email protected]>
rapidio: fix possible UAF when kfifo_alloc() fails
Chen Zhongjin <[email protected]>
fs: sysv: Fix sysv_nblocks() returns wrong value
Anastasia Belova <[email protected]>
MIPS: BCM63xx: Add check for NULL for clk in clk_enable
Yu Liao <[email protected]>
platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()
Xiu Jianfeng <[email protected]>
x86/xen: Fix memory leak in xen_init_lock_cpu()
Oleg Nesterov <[email protected]>
uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix
Li Zetao <[email protected]>
ACPICA: Fix use-after-free in acpi_ut_copy_ipackage_to_ipackage()
Yang Yingliang <[email protected]>
rapidio: rio: fix possible name leak in rio_register_mport()
Yang Yingliang <[email protected]>
rapidio: fix possible name leaks when rio_add_device() fails
Akinobu Mita <[email protected]>
lib/notifier-error-inject: fix error when writing -errno to debugfs file
Akinobu Mita <[email protected]>
libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
Shang XiaoJing <[email protected]>
irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()
Yang Yingliang <[email protected]>
PNP: fix name memory leak in pnp_alloc_dev()
Yang Yingliang <[email protected]>
MIPS: vpe-cmp: fix possible memory leak while module exiting
Yang Yingliang <[email protected]>
MIPS: vpe-mt: fix possible memory leak while module exiting
Shang XiaoJing <[email protected]>
ocfs2: fix memory leak in ocfs2_stack_glue_init()
Barnabás Pőcze <[email protected]>
timerqueue: Use rb_entry_safe() in timerqueue_getnext()
Chen Zhongjin <[email protected]>
perf: Fix possible memleak in pmu_dev_alloc()
Ondrej Mosnacek <[email protected]>
fs: don't audit the capability check in simple_xattr_list()
xiongxin <[email protected]>
PM: hibernate: Fix mistake in kerneldoc comment
Al Viro <[email protected]>
alpha: fix syscall entry in !AUDUT_SYSCALL case
Ulf Hansson <[email protected]>
cpuidle: dt: Return the correct numbers of parsed idle states
Michael Kelley <[email protected]>
tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
Stephen Boyd <[email protected]>
pstore: Avoid kcore oops by vmap()ing with VM_IOREMAP
Doug Brown <[email protected]>
ARM: mmp: fix timer_read delay
Wang Yufen <[email protected]>
pstore/ram: Fix error return code in ramoops_probe()
Pali Rohár <[email protected]>
ARM: dts: turris-omnia: Add switch port 6 node
Pali Rohár <[email protected]>
ARM: dts: turris-omnia: Add ethernet aliases
Pali Rohár <[email protected]>
ARM: dts: armada-39x: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: armada-38x: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: armada-375: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: armada-xp: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: armada-370: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: dove: Fix assigned-addresses for every PCIe Root Port
AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mediatek: mt6797: Fix 26M oscillator unit name
Zhang Qilong <[email protected]>
soc: ti: smartreflex: Fix PM disable depth imbalance in omap_sr_probe
Kory Maincent <[email protected]>
arm: dts: spear600: Fix clcd interrupt
Chen Jiahao <[email protected]>
drivers: soc: ti: knav_qmss_queue: Mark knav_acc_firmwares as static
Luca Weiss <[email protected]>
ARM: dts: qcom: apq8064: fix coresight compatible
Ivaylo Dimitrov <[email protected]>
usb: musb: remove extra check in musb_gadget_vbus_draw
Rasmus Villemoes <[email protected]>
net: loopback: use NET_NAME_PREDICTABLE for name_assign_type
Sungwoo Kim <[email protected]>
Bluetooth: L2CAP: Fix u8 overflow
Tony Nguyen <[email protected]>
igb: Initialize mailbox message for VF reset
Bruno Thomsen <[email protected]>
USB: serial: cp210x: add Kamstrup RF sniffer PIDs
Duke Xin <[email protected]>
USB: serial: option: add Quectel EM05-G modem
Szymon Heidrich <[email protected]>
usb: gadget: uvc: Prevent buffer overflow in setup handler
Jan Kara <[email protected]>
udf: Fix extending file within last block
Jan Kara <[email protected]>
udf: Do not bother looking for prealloc extents if i_lenExtents matches i_size
Jan Kara <[email protected]>
udf: Fix preallocation discarding at indirect extent boundary
Jan Kara <[email protected]>
udf: Drop unused arguments of udf_delete_aext()
Jan Kara <[email protected]>
udf: Discard preallocation before extending file with a hole
Tony Jones <[email protected]>
perf script python: Remove explicit shebang from tests/attr.c
Charles Keepax <[email protected]>
ASoC: ops: Correct bounds check for second channel on SX controls
Yasushi SHOJI <[email protected]>
can: mcba_usb: Fix termination command argument
Heiko Schocher <[email protected]>
can: sja1000: fix size of OCR_MODE_MASK define
Mark Brown <[email protected]>
ASoC: ops: Check bounds for second channel in snd_soc_put_volsw_sx()
Jialiang Wang <[email protected]>
nfp: fix use-after-free in area_cache_get()
Ming Lei <[email protected]>
block: unhash blkdev part inode when the part is deleted
Jann Horn <[email protected]>
mm/khugepaged: invoke MMU notifiers in shmem/file collapse paths
Jann Horn <[email protected]>
mm/khugepaged: fix GUP-fast interaction by sending IPI
Eric Dumazet <[email protected]>
once: add DO_ONCE_SLOW() for sleepable contexts
Ben Hutchings <[email protected]>
libtraceevent: Fix build with binutils 2.35
-------------
Diffstat:
Documentation/driver-api/spi.rst | 4 +- Documentation/sphinx/load_config.py | 6 +- Makefile | 4 +- arch/alpha/kernel/entry.S | 4 +- arch/arm/boot/dts/armada-370.dtsi | 2 +- arch/arm/boot/dts/armada-375.dtsi | 2 +- arch/arm/boot/dts/armada-380.dtsi | 4 +- arch/arm/boot/dts/armada-385-turris-omnia.dts | 18 ++++- arch/arm/boot/dts/armada-385.dtsi | 6 +- arch/arm/boot/dts/armada-39x.dtsi | 6 +- arch/arm/boot/dts/armada-xp-mv78230.dtsi | 8 +-- arch/arm/boot/dts/armada-xp-mv78260.dtsi | 16 ++--- arch/arm/boot/dts/dove.dtsi | 2 +- arch/arm/boot/dts/qcom-apq8064.dtsi | 2 +- arch/arm/boot/dts/spear600.dtsi | 2 +- arch/arm/mach-mmp/time.c | 11 +-- arch/arm/nwfpe/Makefile | 6 ++ arch/arm64/boot/dts/mediatek/mt6797.dtsi | 2 +- arch/mips/bcm63xx/clk.c | 2 + arch/mips/kernel/vpe-cmp.c | 4 +- arch/mips/kernel/vpe-mt.c | 4 +- arch/parisc/include/uapi/asm/mman.h | 17 +++-- arch/parisc/kernel/sys_parisc.c | 27 +++++++ arch/parisc/kernel/syscall_table.S | 2 +- arch/powerpc/kernel/rtas.c | 20 ++++-- arch/powerpc/perf/callchain.c | 1 + arch/powerpc/perf/hv-gpci-requests.h | 4 ++ arch/powerpc/perf/hv-gpci.c | 33 ++++++++- arch/powerpc/perf/hv-gpci.h | 1 + arch/powerpc/perf/req-gen/perf.h | 20 ++++++ arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c | 1 + arch/powerpc/platforms/83xx/mpc832x_rdb.c | 2 +- arch/powerpc/sysdev/xive/spapr.c | 1 + arch/s390/include/asm/percpu.h | 2 +- arch/x86/boot/bioscall.S | 4 +- arch/x86/kernel/cpu/bugs.c | 2 + arch/x86/kernel/cpu/microcode/intel.c | 8 +-- arch/x86/kernel/uprobes.c | 4 +- arch/x86/xen/spinlock.c | 6 +- block/blk-mq-sysfs.c | 11 ++- block/partition-generic.c | 6 ++ drivers/acpi/acpica/dsmethod.c | 10 ++- drivers/acpi/acpica/utcopy.c | 7 -- drivers/base/class.c | 5 ++ drivers/base/dd.c | 8 ++- drivers/bluetooth/btusb.c | 6 +- drivers/bluetooth/hci_bcsp.c | 2 +- drivers/bluetooth/hci_h5.c | 2 +- drivers/bluetooth/hci_qca.c | 2 +- drivers/char/hw_random/amd-rng.c | 18 +++-- drivers/char/hw_random/geode-rng.c | 36 +++++++--- drivers/char/ipmi/ipmi_msghandler.c | 8 ++- drivers/char/tpm/tpm_crb.c | 31 +++++--- drivers/char/tpm/tpm_tis.c | 9 +-- drivers/clk/rockchip/clk-pll.c | 1 + drivers/clk/samsung/clk-pll.c | 1 + drivers/clk/st/clkgen-fsyn.c | 5 +- drivers/cpuidle/dt_idle_states.c | 2 +- drivers/crypto/img-hash.c | 8 ++- drivers/crypto/n2_core.c | 6 ++ drivers/dio/dio.c | 8 +++ drivers/edac/edac_device.c | 17 +++-- drivers/edac/edac_module.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1 + drivers/gpu/drm/drm_connector.c | 3 + drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 5 +- drivers/gpu/drm/radeon/radeon_bios.c | 19 +++-- drivers/gpu/drm/sti/sti_dvo.c | 7 +- drivers/gpu/drm/sti/sti_hda.c | 7 +- drivers/gpu/drm/sti/sti_hdmi.c | 7 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +- drivers/hid/hid-ids.h | 3 + drivers/hid/hid-plantronics.c | 9 +++ drivers/hid/hid-sensor-custom.c | 2 +- drivers/hid/wacom_sys.c | 8 +++ drivers/hid/wacom_wac.c | 4 ++ drivers/hid/wacom_wac.h | 1 + drivers/hsi/controllers/omap_ssi_core.c | 14 +++- drivers/i2c/busses/i2c-ismt.c | 3 + drivers/i2c/busses/i2c-pxa-pci.c | 10 +-- drivers/iio/adc/ad_sigma_delta.c | 8 +-- drivers/infiniband/hw/hfi1/affinity.c | 2 + drivers/infiniband/hw/hfi1/firmware.c | 6 ++ drivers/infiniband/sw/rxe/rxe_qp.c | 6 +- drivers/infiniband/ulp/ipoib/ipoib_netlink.c | 7 ++ drivers/input/touchscreen/elants_i2c.c | 9 +-- drivers/iommu/amd_iommu_init.c | 7 ++ drivers/iommu/amd_iommu_v2.c | 1 + drivers/iommu/fsl_pamu.c | 2 +- drivers/irqchip/irq-gic-pm.c | 2 +- drivers/isdn/hardware/mISDN/hfcmulti.c | 19 +++-- drivers/isdn/hardware/mISDN/hfcpci.c | 13 ++-- drivers/isdn/hardware/mISDN/hfcsusb.c | 12 ++-- drivers/macintosh/macio-adb.c | 4 ++ drivers/macintosh/macio_asic.c | 2 +- drivers/mcb/mcb-core.c | 4 +- drivers/mcb/mcb-parse.c | 2 +- drivers/md/dm-cache-metadata.c | 54 ++++++++++++-- drivers/md/dm-cache-target.c | 11 +-- drivers/md/dm-thin-metadata.c | 9 +++ drivers/md/dm-thin.c | 2 + drivers/md/md.c | 9 ++- drivers/md/raid1.c | 1 + drivers/media/dvb-core/dmxdev.c | 8 +++ drivers/media/dvb-core/dvb_ca_en50221.c | 2 +- drivers/media/dvb-core/dvb_frontend.c | 2 +- drivers/media/dvb-core/dvbdev.c | 33 +++++++-- drivers/media/dvb-core/dvbdev.h | 31 ++++---- drivers/media/dvb-frontends/bcm3510.c | 1 + drivers/media/dvb-frontends/stv0288.c | 5 +- drivers/media/i2c/ad5820.c | 10 +-- drivers/media/pci/saa7164/saa7164-core.c | 4 +- drivers/media/pci/solo6x10/solo6x10-core.c | 1 + drivers/media/platform/coda/coda-bit.c | 14 ++-- drivers/media/platform/exynos4-is/fimc-core.c | 2 +- drivers/media/platform/exynos4-is/media-dev.c | 6 +- .../media/platform/qcom/camss-8x16/camss-video.c | 3 +- drivers/media/platform/s5p-mfc/s5p_mfc.c | 17 ++++- .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 1 + drivers/media/platform/vivid/vivid-vid-cap.c | 1 + drivers/media/radio/si470x/radio-si470x-usb.c | 4 +- drivers/media/rc/imon.c | 6 +- drivers/media/usb/dvb-usb/az6027.c | 4 ++ drivers/media/usb/dvb-usb/dvb-usb-init.c | 4 +- drivers/misc/cxl/guest.c | 24 ++++--- drivers/misc/cxl/pci.c | 21 +++--- drivers/misc/sgi-gru/grufault.c | 13 +++- drivers/misc/sgi-gru/grumain.c | 22 ++++-- drivers/misc/sgi-gru/grutables.h | 2 +- drivers/misc/tifm_7xx1.c | 2 +- drivers/mmc/host/mmci.c | 4 +- drivers/mmc/host/moxart-mmc.c | 4 +- drivers/mmc/host/mxcmmc.c | 4 +- drivers/mmc/host/rtsx_usb_sdmmc.c | 11 ++- drivers/mmc/host/sdhci_f_sdh30.c | 3 + drivers/mmc/host/toshsd.c | 6 +- drivers/mmc/host/via-sdmmc.c | 4 +- drivers/mmc/host/vub300.c | 13 +++- drivers/mmc/host/wbsd.c | 12 +++- drivers/mmc/host/wmt-sdmmc.c | 6 +- drivers/mtd/lpddr/lpddr2_nvm.c | 2 + drivers/mtd/maps/pxa2xx-flash.c | 2 + drivers/mtd/mtdcore.c | 4 +- drivers/net/bonding/bond_main.c | 2 +- drivers/net/can/usb/mcba_usb.c | 10 ++- drivers/net/dsa/lan9303-core.c | 4 +- drivers/net/ethernet/amd/atarilance.c | 2 +- drivers/net/ethernet/amd/lance.c | 2 +- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 + drivers/net/ethernet/amd/xgbe/xgbe-i2c.c | 4 +- drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 4 +- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 14 +--- drivers/net/ethernet/apple/bmac.c | 2 +- drivers/net/ethernet/apple/mace.c | 2 +- drivers/net/ethernet/dnet.c | 4 +- drivers/net/ethernet/intel/igb/igb_main.c | 10 ++- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 1 + drivers/net/ethernet/neterion/s2io.c | 2 +- .../ethernet/netronome/nfp/nfpcore/nfp_cppcore.c | 3 +- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 8 ++- drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h | 10 +-- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 8 ++- .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 2 + drivers/net/ethernet/rdc/r6040.c | 5 +- drivers/net/ethernet/renesas/ravb_main.c | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 3 +- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h | 2 +- drivers/net/ethernet/ti/netcp_core.c | 2 +- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +- drivers/net/fddi/defxx.c | 22 ++++-- drivers/net/hamradio/baycom_epp.c | 2 +- drivers/net/hamradio/scc.c | 6 +- drivers/net/loopback.c | 2 +- drivers/net/ntb_netdev.c | 4 +- drivers/net/phy/xilinx_gmii2rgmii.c | 1 + drivers/net/ppp/ppp_generic.c | 2 + drivers/net/usb/rndis_host.c | 3 +- drivers/net/wan/farsync.c | 2 + drivers/net/wireless/ath/ar5523/ar5523.c | 6 ++ drivers/net/wireless/ath/ath10k/pci.c | 20 +++--- drivers/net/wireless/ath/ath9k/hif_usb.c | 46 +++++++----- .../broadcom/brcm80211/brcmfmac/firmware.c | 5 ++ .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 + drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +- drivers/nfc/pn533/pn533.c | 4 ++ drivers/nfc/pn533/usb.c | 44 +++++++++++- drivers/parisc/led.c | 3 + drivers/pci/irq.c | 2 + drivers/pci/pci-sysfs.c | 13 ++-- drivers/pci/pci.c | 2 + drivers/pinctrl/pinconf-generic.c | 4 +- drivers/platform/x86/mxm-wmi.c | 8 +-- drivers/platform/x86/sony-laptop.c | 21 ++++-- drivers/pnp/core.c | 4 +- drivers/power/avs/smartreflex.c | 1 + drivers/power/supply/power_supply_core.c | 2 +- drivers/rapidio/devices/rio_mport_cdev.c | 15 ++-- drivers/rapidio/rio-scan.c | 8 ++- drivers/rapidio/rio.c | 9 ++- drivers/regulator/core.c | 2 + drivers/regulator/da9211-regulator.c | 11 +-- drivers/rtc/rtc-snvs.c | 16 ++++- drivers/rtc/rtc-st-lpc.c | 1 + drivers/s390/net/ctcm_main.c | 11 +-- drivers/s390/net/lcs.c | 8 +-- drivers/s390/net/netiucv.c | 9 +-- drivers/scsi/fcoe/fcoe.c | 1 + drivers/scsi/fcoe/fcoe_sysfs.c | 19 ++--- drivers/scsi/hpsa.c | 7 +- drivers/scsi/ipr.c | 10 ++- drivers/scsi/snic/snic_disc.c | 3 + drivers/soc/ti/knav_qmss_queue.c | 2 +- drivers/soc/ux500/ux500-soc-id.c | 10 ++- drivers/staging/rtl8192e/rtllib_rx.c | 2 +- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 +- drivers/tty/hvc/hvc_xen.c | 46 +++++++----- drivers/tty/serial/amba-pl011.c | 3 + drivers/tty/serial/pch_uart.c | 4 ++ drivers/tty/serial/sunsab.c | 8 ++- drivers/uio/uio_dmem_genirq.c | 13 ++-- drivers/usb/common/ulpi.c | 2 +- drivers/usb/dwc3/core.c | 7 +- drivers/usb/gadget/function/f_uvc.c | 5 +- drivers/usb/gadget/udc/fotg210-udc.c | 12 ++-- drivers/usb/musb/musb_gadget.c | 2 - drivers/usb/serial/cp210x.c | 2 + drivers/usb/serial/option.c | 3 + drivers/usb/storage/alauda.c | 2 + drivers/vfio/platform/vfio_platform_common.c | 3 +- drivers/video/fbdev/Kconfig | 1 - drivers/video/fbdev/pm2fb.c | 9 ++- drivers/video/fbdev/uvesafb.c | 1 + drivers/video/fbdev/vermilion/vermilion.c | 4 +- drivers/video/fbdev/via/via-core.c | 9 ++- drivers/vme/bridges/vme_fake.c | 2 + drivers/vme/bridges/vme_tsi148.c | 1 + fs/binfmt_misc.c | 8 +-- fs/char_dev.c | 2 +- fs/cifs/connect.c | 4 +- fs/ext4/ext4.h | 2 +- fs/ext4/indirect.c | 9 ++- fs/ext4/inode.c | 18 ++++- fs/ext4/ioctl.c | 10 +-- fs/ext4/namei.c | 3 + fs/ext4/xattr.c | 15 ++-- fs/hfs/inode.c | 13 ++-- fs/hfs/trans.c | 2 +- fs/hfsplus/hfsplus_fs.h | 2 + fs/hfsplus/inode.c | 16 ++--- fs/hfsplus/options.c | 4 ++ fs/jfs/jfs_dmap.c | 27 +++++-- fs/libfs.c | 22 +++++- fs/nfs/nfs4proc.c | 19 +++-- fs/nfs/nfs4state.c | 2 + fs/nfs/nfs4xdr.c | 10 ++- fs/nfsd/nfs4callback.c | 4 +- fs/nfsd/nfs4xdr.c | 11 +++ fs/nilfs2/the_nilfs.c | 31 ++++++-- fs/ocfs2/stackglue.c | 8 ++- fs/orangefs/orangefs-debugfs.c | 3 + fs/orangefs/orangefs-mod.c | 8 +-- fs/pnode.c | 2 +- fs/pstore/Kconfig | 1 + fs/pstore/pmsg.c | 7 +- fs/pstore/ram.c | 2 + fs/pstore/ram_core.c | 6 +- fs/reiserfs/namei.c | 4 ++ fs/reiserfs/xattr_security.c | 2 +- fs/sysv/itree.c | 2 +- fs/udf/balloc.c | 5 +- fs/udf/inode.c | 84 ++++++++++------------ fs/udf/namei.c | 8 +-- fs/udf/truncate.c | 48 ++++--------- fs/udf/udfdecl.h | 3 +- fs/xattr.c | 2 +- include/asm-generic/tlb.h | 6 ++ include/linux/can/platform/sja1000.h | 2 +- include/linux/eventfd.h | 2 +- include/linux/fs.h | 12 +++- include/linux/once.h | 28 ++++++++ include/linux/sunrpc/rpc_pipe_fs.h | 5 ++ include/linux/timerqueue.h | 2 +- include/net/mrp.h | 1 + include/uapi/linux/swab.h | 2 +- include/uapi/sound/asequencer.h | 8 +-- kernel/acct.c | 2 + kernel/events/core.c | 8 ++- kernel/gcov/gcc_4_7.c | 5 ++ kernel/power/snapshot.c | 4 +- kernel/trace/blktrace.c | 3 +- kernel/trace/trace.c | 15 +++- lib/notifier-error-inject.c | 2 +- lib/once.c | 30 ++++++++ lib/test_firmware.c | 1 + mm/khugepaged.c | 24 ++++++- mm/memory.c | 5 ++ net/802/mrp.c | 18 +++-- net/bluetooth/hci_core.c | 2 +- net/bluetooth/l2cap_core.c | 3 +- net/bluetooth/rfcomm/core.c | 2 +- net/caif/cfctrl.c | 6 +- net/core/filter.c | 11 ++- net/core/skbuff.c | 3 + net/core/stream.c | 6 ++ net/ipv4/inet_connection_sock.c | 16 ++++- net/ipv4/inet_hashtables.c | 4 +- net/ipv4/udp_tunnel.c | 1 + net/ipv6/raw.c | 4 ++ net/mac80211/iface.c | 1 + net/netfilter/ipset/ip_set_bitmap_ip.c | 4 +- net/nfc/netlink.c | 52 ++++++++++---- net/openvswitch/datapath.c | 25 ++++--- net/sched/ematch.c | 2 + net/sched/sch_api.c | 10 ++- net/sched/sch_atm.c | 5 +- net/sunrpc/auth_gss/auth_gss.c | 19 ++++- net/sunrpc/clnt.c | 2 +- net/vmw_vsock/vmci_transport.c | 6 +- security/apparmor/apparmorfs.c | 4 +- security/device_cgroup.c | 33 +++++++-- security/integrity/ima/ima_template.c | 9 ++- sound/core/control_compat.c | 4 ++ sound/drivers/mts64.c | 3 + sound/pci/asihpi/hpioctl.c | 2 +- sound/soc/codecs/pcm512x.c | 8 +-- sound/soc/codecs/rt298.c | 7 ++ sound/soc/codecs/rt5670.c | 2 - sound/soc/codecs/wm8994.c | 5 ++ sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 7 +- sound/soc/pxa/mmp-pcm.c | 2 +- sound/soc/rockchip/rockchip_pdm.c | 1 + sound/soc/rockchip/rockchip_spdif.c | 1 + sound/soc/soc-ops.c | 9 ++- sound/usb/line6/driver.c | 3 +- sound/usb/line6/midi.c | 6 +- sound/usb/line6/midibuf.c | 25 ++++--- sound/usb/line6/midibuf.h | 5 +- sound/usb/line6/pod.c | 3 +- tools/arch/parisc/include/uapi/asm/mman.h | 12 ++-- tools/lib/traceevent/Makefile | 2 +- tools/perf/bench/bench.h | 12 ---- tools/perf/tests/attr.py | 1 - tools/perf/util/auxtrace.c | 2 +- tools/testing/ktest/ktest.pl | 3 +- tools/testing/selftests/lib.mk | 5 ++ .../selftests/powerpc/dscr/dscr_sysfs_test.c | 5 +- 347 files changed, 1914 insertions(+), 796 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 13/338 udf: Drop unused arguments of udf_delete_aext()
From: Jan Kara <[email protected]>
commit 6c1e4d06a3808dc67dbce2d631f4c12574567dd5 upstream.
udf_delete_aext() uses its last two arguments only as local variables. Drop them.
--- fs/udf/balloc.c | 5 ++--- fs/udf/inode.c | 8 ++++---- fs/udf/udfdecl.h | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-)
fs/udf/balloc.c +2 -3
@@ -531,8 +531,7 @@ static int udf_table_prealloc_blocks(strudf_write_aext (table, &epos, &eloc, (etype <<30 ) | elen,1 ); }else -udf_delete_aext (table, epos, eloc, - (etype <<30 ) | elen); +udf_delete_aext (table, epos); }else { alloc_count =0 ; }
@@ -627,7 +626,7 @@ static int udf_table_new_block(struct suif (goal_elen)udf_write_aext (table, &goal_epos, &goal_eloc, goal_elen,1 );else -udf_delete_aext (table, goal_epos, goal_eloc, goal_elen); +udf_delete_aext (table, goal_epos);brelse (goal_epos.bh);udf_add_free_space (sb, partition,-1 );
fs/udf/inode.c +4 -4
@@ -1169,8 +1169,7 @@ static void udf_update_extents(struct inif (startnum > endnum) {for (i =0 ; i < (startnum - endnum); i++) -udf_delete_aext (inode, *epos, laarr[i].extLocation, - laarr[i].extLength); +udf_delete_aext (inode, *epos); }else if (startnum < endnum) {for (i =0 ; i < (endnum - startnum); i++) { udf_insert_aext(inode, *epos, laarr[i].extLocation,
@@ -2202,14 +2201,15 @@ static int8_t udf_insert_aext(struct inoreturn (nelen >>30 ); } -int8_t udf_delete_aext (struct inode *inode,struct extent_position epos, -struct kernel_lb_addr eloc,uint32_t elen) +int8_t udf_delete_aext (struct inode *inode,struct extent_position epos) {struct extent_position oepos;int adsize;int8_t etype;struct allocExtDesc *aed;struct udf_inode_info *iinfo; +struct kernel_lb_addr eloc; +uint32_t elen;if (epos.bh) {get_bh (epos.bh);
fs/udf/udfdecl.h +1 -2
@@ -161,8 +161,7 @@ extern int udf_add_aext(struct inode *, struct kernel_lb_addr *, uint32_t, int);extern void udf_write_aext (struct inode *,struct extent_position *,struct kernel_lb_addr *,uint32_t ,int ); -extern int8_t udf_delete_aext (struct inode *,struct extent_position , -struct kernel_lb_addr ,uint32_t ); +extern int8_t udf_delete_aext (struct inode *,struct extent_position );extern int8_t udf_next_aext (struct inode *,struct extent_position *,struct kernel_lb_addr *,uint32_t *,int ); extern int8_t udf_current_aext(struct inode *, struct extent_position *,
Greg Kroah-Hartman
maintainerPATCH 22/338 net: loopback: use NET_NAME_PREDICTABLE for name_assign_type
In reply to Greg Kroah-HartmanFrom: Rasmus Villemoes <[email protected]>
[ Upstream commit 31d929de5a112ee1b977a89c57de74710894bbbf ]
When the name_assign_type attribute was introduced (commit 685343fc3ba6, "net: add name_assign_type netdev attribute"), the loopback device was explicitly mentioned as one which would make use of NET_NAME_PREDICTABLE:
The name_assign_type attribute gives hints where the interface name of a given net-device comes from. These values are currently defined:
...
NET_NAME_PREDICTABLE:
The ifname has been assigned by the kernel in a predictable way that is guaranteed to avoid reuse and always be the same for a given device. Examples include statically created devices like the loopback device [...]
Switch to that so that reading /sys/class/net/lo/name_assign_type produces something sensible instead of returning -EINVAL.
--- drivers/net/loopback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/loopback.c +1 -1
@@ -206,7 +206,7 @@ static __net_init int loopback_net_init(struct net *net)int err; err = -ENOMEM ; - dev =alloc_netdev (0 ,"lo" ,NET_NAME_UNKNOWN , loopback_setup); + dev =alloc_netdev (0 ,"lo" ,NET_NAME_PREDICTABLE , loopback_setup);if (!dev) goto out;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 23/338 usb: musb: remove extra check in musb_gadget_vbus_draw
In reply to Greg Kroah-HartmanFrom: Ivaylo Dimitrov <[email protected]>
[ Upstream commit ecec4b20d29c3d6922dafe7d2555254a454272d2 ]
The checks for musb->xceiv and musb->xceiv->set_power duplicate those in usb_phy_set_power(), so there is no need of them. Moreover, not calling usb_phy_set_power() results in usb_phy_set_charger_current() not being called, so current USB config max current is not propagated through USB charger framework and charger drivers may try to draw more current than allowed or possible.
Fix that by removing those extra checks and calling usb_phy_set_power() directly.
Tested on Motorola Droid4 and Nokia N900
--- drivers/usb/musb/musb_gadget.c | 2 -- 1 file changed, 2 deletions(-)
drivers/usb/musb/musb_gadget.c +0 -2
@@ -1661,8 +1661,6 @@ static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) {struct musb *musb =gadget_to_musb (gadget); -if (!musb->xceiv->set_power) -return -EOPNOTSUPP ;return usb_phy_set_power (musb->xceiv, mA); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 24/338 ARM: dts: qcom: apq8064: fix coresight compatible
In reply to Greg Kroah-HartmanFrom: Luca Weiss <[email protected]>
[ Upstream commit a42b1ee868361f1cb0492f1bdaefb43e0751e468 ]
There's a typo missing the arm, prefix of arm,coresight-etb10. Fix it to make devicetree validation happier.
--- arch/arm/boot/dts/qcom-apq8064.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-apq8064.dtsi +1 -1
@@ -1534,7 +1534,7 @@ wifi { }; etb@1a01000 { - compatible = "coresight-etb10", "arm,primecell"; + compatible = "arm,coresight-etb10", "arm,primecell"; reg = <0x1a01000 0x1000>; clocks = <&rpmcc RPM_QDSS_CLK>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 25/338 drivers: soc: ti: knav_qmss_queue: Mark knav_acc_firmwares as static
In reply to Greg Kroah-HartmanFrom: Chen Jiahao <[email protected]>
[ Upstream commit adf85adc2a7199b41e7a4da083bd17274a3d6969 ]
There is a sparse warning shown below:
drivers/soc/ti/knav_qmss_queue.c:70:12: warning: symbol 'knav_acc_firmwares' was not declared. Should it be static?
Since 'knav_acc_firmwares' is only called within knav_qmss_queue.c, mark it as static to fix the warning.
--- drivers/soc/ti/knav_qmss_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/ti/knav_qmss_queue.c +1 -1
@@ -63,7 +63,7 @@ static DEFINE_MUTEX(knav_dev_lock);* Newest followed by older ones. Search is done from start of the array * until a firmware file is found. */ -const char *knav_acc_firmwares[] = {"ks2_qmss_pdsp_acc48.bin" }; +static const char *const knav_acc_firmwares[] = {"ks2_qmss_pdsp_acc48.bin" };/** * knav_queue_notify: qmss queue notfier call
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 26/338 arm: dts: spear600: Fix clcd interrupt
In reply to Greg Kroah-HartmanFrom: Kory Maincent <[email protected]>
[ Upstream commit 0336e2ce34e7a89832b6c214f924eb7bc58940be ]
Interrupt 12 of the Interrupt controller belongs to the SMI controller, the right one for the display controller is the interrupt 13.
--- arch/arm/boot/dts/spear600.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/spear600.dtsi +1 -1
@@ -53,7 +53,7 @@ clcd: clcd@fc200000 { compatible = "arm,pl110", "arm,primecell"; reg = <0xfc200000 0x1000>; interrupt-parent = <&vic1>; - interrupts = <12>; + interrupts = <13>; status = "disabled"; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 27/338 soc: ti: smartreflex: Fix PM disable depth imbalance in omap_sr_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 69460e68eb662064ab4188d4e129ff31c1f23ed9 ]
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context.
--- drivers/power/avs/smartreflex.c | 1 + 1 file changed, 1 insertion(+)
drivers/power/avs/smartreflex.c +1 -0
@@ -971,6 +971,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) err_debugfs:debugfs_remove_recursive (sr_info->dbg_dir); err_list_del: +pm_runtime_disable (&pdev->dev);list_del (&sr_info->node);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 28/338 arm64: dts: mediatek: mt6797: Fix 26M oscillator unit name
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 5f535cc583759c9c60d4cc9b8d221762e2d75387 ]
Update its unit name to oscillator-26m and remove the unneeded unit address to fix a unit_address_vs_reg warning.
--- arch/arm64/boot/dts/mediatek/mt6797.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt6797.dtsi +1 -1
@@ -101,7 +101,7 @@ cpu9: cpu@201 { }; }; - clk26m: oscillator@0 { + clk26m: oscillator-26m { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <26000000>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 29/338 ARM: dts: dove: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit dcc7d8c72b64a479b8017e4332d99179deb8802d ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/dove.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/dove.dtsi +1 -1
@@ -129,7 +129,7 @@ pcie0: pcie@1 { pcie1: pcie@2 { device_type = "pci"; status = "disabled"; - assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x80000 0 0x2000>; reg = <0x1000 0 0 0 0>; clocks = <&gate_clk 5>; marvell,pcie-port = <1>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 30/338 ARM: dts: armada-370: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit d9208b0fa2e803d16b28d91bf1d46b7ee9ea13c6 ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-370.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-370.dtsi +1 -1
@@ -111,7 +111,7 @@ pcie0: pcie@1,0 { pcie2: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x80000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 31/338 ARM: dts: armada-xp: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit eab276787f456cbea89fabea110fe0728673d308 ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-xp-mv78230.dtsi | 8 ++++---- arch/arm/boot/dts/armada-xp-mv78260.dtsi | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-)
arch/arm/boot/dts/armada-xp-mv78230.dtsi +4 -4
@@ -134,7 +134,7 @@ pcie1: pcie@1,0 { pcie2: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -152,7 +152,7 @@ pcie2: pcie@2,0 { pcie3: pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x48000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -170,7 +170,7 @@ pcie3: pcie@3,0 { pcie4: pcie@4,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>; + assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>; reg = <0x2000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -188,7 +188,7 @@ pcie4: pcie@4,0 { pcie5: pcie@5,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; + assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; reg = <0x2800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
arch/arm/boot/dts/armada-xp-mv78260.dtsi +8 -8
@@ -149,7 +149,7 @@ pcie1: pcie@1,0 { pcie2: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -167,7 +167,7 @@ pcie2: pcie@2,0 { pcie3: pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x48000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -185,7 +185,7 @@ pcie3: pcie@3,0 { pcie4: pcie@4,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>; + assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>; reg = <0x2000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -203,7 +203,7 @@ pcie4: pcie@4,0 { pcie5: pcie@5,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; + assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; reg = <0x2800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -221,7 +221,7 @@ pcie5: pcie@5,0 { pcie6: pcie@6,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x84000 0 0x2000>; + assigned-addresses = <0x82003000 0 0x84000 0 0x2000>; reg = <0x3000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -239,7 +239,7 @@ pcie6: pcie@6,0 { pcie7: pcie@7,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x88000 0 0x2000>; + assigned-addresses = <0x82003800 0 0x88000 0 0x2000>; reg = <0x3800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -257,7 +257,7 @@ pcie7: pcie@7,0 { pcie8: pcie@8,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x8c000 0 0x2000>; + assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>; reg = <0x4000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -275,7 +275,7 @@ pcie8: pcie@8,0 { pcie9: pcie@9,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x42000 0 0x2000>; + assigned-addresses = <0x82004800 0 0x42000 0 0x2000>; reg = <0x4800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 14/338 udf: Fix preallocation discarding at indirect extent boundary
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit cfe4c1b25dd6d2f056afc00b7c98bcb3dd0b1fc3 upstream.
When preallocation extent is the first one in the extent block, the code would corrupt extent tree header instead. Fix the problem and use udf_delete_aext() for deleting extent to avoid some code duplication.
--- fs/udf/truncate.c | 45 +++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-)
fs/udf/truncate.c +13 -32
@@ -120,60 +120,41 @@ void udf_truncate_tail_extent(struct inovoid udf_discard_prealloc (struct inode *inode) { -struct extent_position epos = {NULL ,0 , {0 ,0 } }; +struct extent_position epos = {}; +struct extent_position prev_epos = {};struct kernel_lb_addr eloc;uint32_t elen;uint64_t lbcount =0 ;int8_t etype =-1 , netype; -int adsize;struct udf_inode_info *iinfo =UDF_I (inode);if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_IN_ICB || inode->i_size == iinfo->i_lenExtents)return ; -if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_SHORT ) - adsize =sizeof (struct short_ad ); -else if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_LONG ) - adsize =sizeof (struct long_ad ); -else - adsize =0 ; - epos.block = iinfo->i_location;/* Find the last extent in the file */ -while ((netype =udf_next_aext (inode, &epos, &eloc, &elen,1 )) !=-1 ) { - etype = netype; +while ((netype =udf_next_aext (inode, &epos, &eloc, &elen,0 )) !=-1 ) { +brelse (prev_epos.bh); + prev_epos = epos; +if (prev_epos.bh) +get_bh (prev_epos.bh); + + etype =udf_next_aext (inode, &epos, &eloc, &elen,1 ); lbcount += elen; }if (etype == (EXT_NOT_RECORDED_ALLOCATED >>30 )) { - epos.offset -= adsize; lbcount -= elen; -extent_trunc (inode, &epos, &eloc, etype, elen,0 ); -if (!epos.bh) { - iinfo->i_lenAlloc = - epos.offset - -udf_file_entry_alloc_offset (inode); -mark_inode_dirty (inode); - }else { -struct allocExtDesc *aed = - (struct allocExtDesc *)(epos.bh->b_data); - aed->lengthAllocDescs = -cpu_to_le32 (epos.offset - -sizeof (struct allocExtDesc )); -if (!UDF_QUERY_FLAG (inode->i_sb,UDF_FLAG_STRICT ) || -UDF_SB (inode->i_sb)->s_udfrev >=0x0201 ) -udf_update_tag (epos.bh->b_data, epos.offset); -else -udf_update_tag (epos.bh->b_data, -sizeof (struct allocExtDesc )); -mark_buffer_dirty_inode (epos.bh, inode); - } +udf_delete_aext (inode, prev_epos); +udf_free_blocks (inode->i_sb, inode, &eloc,0 , +DIV_ROUND_UP (elen,1 << inode->i_blkbits)); }/* This inode entry is in-memory only and thus we don't have to mark * the inode dirty */ iinfo->i_lenExtents = lbcount;brelse (epos.bh); +brelse (prev_epos.bh); } static void udf_update_alloc_ext_desc(struct inode *inode,
Greg Kroah-Hartman
maintainerPATCH 32/338 ARM: dts: armada-375: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 823956d2436f70ced74c0fe8ab99facd8abfc060 ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-375.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-375.dtsi +1 -1
@@ -621,7 +621,7 @@ pcie0: pcie@1,0 { pcie1: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 33/338 ARM: dts: armada-38x: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 44f47b7a8fa4678ce4c38ea74837e4996b9df6d6 ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-380.dtsi | 4 ++-- arch/arm/boot/dts/armada-385.dtsi | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/armada-380.dtsi +2 -2
@@ -116,7 +116,7 @@ pcie@1,0 { /* x1 port */ pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x40000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -135,7 +135,7 @@ pcie@2,0 { /* x1 port */ pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x44000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
arch/arm/boot/dts/armada-385.dtsi +3 -3
@@ -121,7 +121,7 @@ pcie1: pcie@1,0 { /* x1 port */ pcie2: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x40000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -140,7 +140,7 @@ pcie2: pcie@2,0 { /* x1 port */ pcie3: pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x44000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -162,7 +162,7 @@ pcie3: pcie@3,0 { */ pcie4: pcie@4,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; + assigned-addresses = <0x82002000 0 0x48000 0 0x2000>; reg = <0x2000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 34/338 ARM: dts: armada-39x: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 69236d2391b4d7324b11c3252921571577892e7b ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-39x.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/armada-39x.dtsi +3 -3
@@ -493,7 +493,7 @@ pcie@1,0 { /* x1 port */ pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x40000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -512,7 +512,7 @@ pcie@2,0 { /* x1 port */ pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x44000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -534,7 +534,7 @@ pcie@3,0 { */ pcie@4,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; + assigned-addresses = <0x82002000 0 0x48000 0 0x2000>; reg = <0x2000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 35/338 ARM: dts: turris-omnia: Add ethernet aliases
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit f1f3e530c59a7e8c5f06172f4c28b945a6b4bfb8 ]
This allows bootloader to correctly pass MAC addresses used by bootloader to individual interfaces into kernel device tree.
--- arch/arm/boot/dts/armada-385-turris-omnia.dts | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/armada-385-turris-omnia.dts +6 -0
@@ -55,6 +55,12 @@ chosen { stdout-path = &uart0; }; + aliases { + ethernet0 = ð0; + ethernet1 = ð1; + ethernet2 = ð2; + }; + memory { device_type = "memory"; reg = <0x00000000 0x40000000>; /* 1024 MB */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 36/338 ARM: dts: turris-omnia: Add switch port 6 node
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit f87db2005f73876602211af0ee156817019b6bda ]
Switch port 6 is connected to eth0, so add appropriate device tree node for it.
--- arch/arm/boot/dts/armada-385-turris-omnia.dts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm/boot/dts/armada-385-turris-omnia.dts +11 -1
@@ -330,7 +330,17 @@ fixed-link { }; }; - /* port 6 is connected to eth0 */ + ports@6 { + reg = <6>; + label = "cpu"; + ethernet = <ð0>; + phy-mode = "rgmii-id"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; }; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 37/338 pstore/ram: Fix error return code in ramoops_probe()
In reply to Greg Kroah-HartmanFrom: Wang Yufen <[email protected]>
[ Upstream commit e1fce564900f8734edf15b87f028c57e14f6e28d ]
In the if (dev_of_node(dev) && !pdata) path, the "err" may be assigned a value of 0, so the error return code -EINVAL may be incorrectly set to 0. To fix set valid return code before calling to goto.
--- fs/pstore/ram.c | 2 ++ 1 file changed, 2 insertions(+)
fs/pstore/ram.c +2 -0
@@ -749,6 +749,7 @@ static int ramoops_probe(struct platform_device *pdev)/* Make sure we didn't get bogus platform data pointer. */ if (!pdata) {pr_err ("NULL platform data\n" ); + err = -EINVAL ; goto fail_out; }
@@ -756,6 +757,7 @@ static int ramoops_probe(struct platform_device *pdev) !pdata->ftrace_size && !pdata->pmsg_size)) {pr_err ("The memory size and the record/console size must be " "non-zero\n" ); + err = -EINVAL ; goto fail_out; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 38/338 ARM: mmp: fix timer_read delay
In reply to Greg Kroah-HartmanFrom: Doug Brown <[email protected]>
[ Upstream commit e348b4014c31041e13ff370669ba3348c4d385e3 ]
timer_read() was using an empty 100-iteration loop to wait for the TMR_CVWR register to capture the latest timer counter value. The delay wasn't long enough. This resulted in CPU idle time being extremely underreported on PXA168 with CONFIG_NO_HZ_IDLE=y.
Switch to the approach used in the vendor kernel, which implements the capture delay by reading TMR_CVWR a few times instead.
--- arch/arm/mach-mmp/time.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
arch/arm/mach-mmp/time.c +7 -4
@@ -52,18 +52,21 @@static void __iomem *mmp_timer_base =TIMERS_VIRT_BASE ;/* -* FIXME: the timer needs some delay to stablize the counter capture +* Read the timer through the CVWR register. Delay is required after requesting +* a read. The CR register cannot be directly read due to metastability issues +* documented in the PXA168 software manual. */ static inline uint32_t timer_read (void ) { -int delay =100 ; +uint32_t val; +int delay =3 ;__raw_writel (1 , mmp_timer_base +TMR_CVWR (1 ));while (delay--) -cpu_relax (); + val =__raw_readl (mmp_timer_base +TMR_CVWR (1 )); -return __raw_readl (mmp_timer_base +TMR_CVWR (1 )); +return val; } static u64 notrace mmp_read_sched_clock(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 39/338 pstore: Avoid kcore oops by vmap()ing with VM_IOREMAP
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit e6b842741b4f39007215fd7e545cb55aa3d358a2 ]
An oops can be induced by running 'cat /proc/kcore > /dev/null' on devices using pstore with the ram backend because kmap_atomic() assumes lowmem pages are accessible with __va().
Unable to handle kernel paging request at virtual address ffffff807ff2b000 Mem abort info: ESR = 0x96000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x06: level 2 translation fault Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000081d87000 [ffffff807ff2b000] pgd=180000017fe18003, p4d=180000017fe18003, pud=180000017fe18003, pmd=0000000000000000 Internal error: Oops: 96000006 [#1] PREEMPT SMP Modules linked in: dm_integrity CPU: 7 PID: 21179 Comm: perf Not tainted 5.15.67-10882-ge4eb2eb988cd #1 baa443fb8e8477896a370b31a821eb2009f9bfba Hardware name: Google Lazor (rev3 - 8) (DT) pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __memcpy+0x110/0x260 lr : vread+0x194/0x294 sp : ffffffc013ee39d0 x29: ffffffc013ee39f0 x28: 0000000000001000 x27: ffffff807ff2b000 x26: 0000000000001000 x25: ffffffc0085a2000 x24: ffffff802d4b3000 x23: ffffff80f8a60000 x22: ffffff802d4b3000 x21: ffffffc0085a2000 x20: ffffff8080b7bc68 x19: 0000000000001000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: ffffffd3073f2e60 x14: ffffffffad588000 x13: 0000000000000000 x12: 0000000000000001 x11: 00000000000001a2 x10: 00680000fff2bf0b x9 : 03fffffff807ff2b x8 : 0000000000000001 x7 : 0000000000000000 x6 : 0000000000000000 x5 : ffffff802d4b4000 x4 : ffffff807ff2c000 x3 : ffffffc013ee3a78 x2 : 0000000000001000 x1 : ffffff807ff2b000 x0 : ffffff802d4b3000 Call trace: __memcpy+0x110/0x260 read_kcore+0x584/0x778 proc_reg_read+0xb4/0xe4
During early boot, memblock reserves the pages for the ramoops reserved memory node in DT that would otherwise be part of the direct lowmem mapping. Pstore's ram backend reuses those reserved pages to change the memory type (writeback or non-cached) by passing the pages to vmap() (see pfn_to_page() usage in persistent_ram_vmap() for more details) with specific flags. When read_kcore() starts iterating over the vmalloc region, it runs over the virtual address that vmap() returned for ramoops. In aligned_vread() the virtual address is passed to vmalloc_to_page() which returns the page struct for the reserved lowmem area. That lowmem page is passed to kmap_atomic(), which effectively calls page_to_virt() that assumes a lowmem page struct must be directly accessible with __va() and friends. These pages are mapped via vmap() though, and the lowmem mapping was never made, so accessing them via the lowmem virtual address oopses like above.
Let's side-step this problem by passing VM_IOREMAP to vmap(). This will tell vread() to not include the ramoops region in the kcore. Instead the area will look like a bunch of zeros. The alternative is to teach kmap() about vmalloc areas that intersect with lowmem. Presumably such a change isn't a one-liner, and there isn't much interest in inspecting the ramoops region in kcore files anyway, so the most expedient route is taken for now.
--- fs/pstore/ram_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/pstore/ram_core.c +5 -1
@@ -418,7 +418,11 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size,phys_addr_t addr = page_start + i *PAGE_SIZE ; pages[i] =pfn_to_page (addr >>PAGE_SHIFT ); } - vaddr =vmap (pages, page_count,VM_MAP , prot); +/* +* VM_IOREMAP used here to bypass this region during vread() +* and kmap_atomic() (i.e. kcore) to avoid __va() failures. +*/ + vaddr =vmap (pages, page_count,VM_MAP |VM_IOREMAP , prot);kfree (pages);/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 40/338 tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
In reply to Greg Kroah-HartmanFrom: Michael Kelley <[email protected]>
[ Upstream commit f5264068071964b56dc02c9dab3d11574aaca6ff ]
The error message in __crb_relinquish_locality() mentions requestAccess instead of Relinquish. Fix it.
--- drivers/char/tpm/tpm_crb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_crb.c +1 -1
@@ -257,7 +257,7 @@ static int __crb_relinquish_locality(struct device *dev,iowrite32 (CRB_LOC_CTRL_RELINQUISH , &priv->regs_h->loc_ctrl);if (!crb_wait_for_reg_32 (&priv->regs_h->loc_state, mask, value,TPM2_TIMEOUT_C )) { -dev_warn (dev,"TPM_LOC_STATE_x.requestAccess timed out\n" ); +dev_warn (dev,"TPM_LOC_STATE_x.Relinquish timed out\n" );return -ETIME ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 41/338 cpuidle: dt: Return the correct numbers of parsed idle states
In reply to Greg Kroah-HartmanFrom: Ulf Hansson <[email protected]>
[ Upstream commit ee3c2c8ad6ba6785f14a60e4081d7c82e88162a2 ]
While we correctly skips to initialize an idle state from a disabled idle state node in DT, the returned value from dt_init_idle_driver() don't get adjusted accordingly. Instead the number of found idle state nodes are returned, while the callers are expecting the number of successfully initialized idle states from DT.
This leads to cpuidle drivers unnecessarily continues to initialize their idle state specific data. Moreover, in the case when all idle states have been disabled in DT, we would end up registering a cpuidle driver, rather than relying on the default arch specific idle call.
--- drivers/cpuidle/dt_idle_states.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/dt_idle_states.c +1 -1
@@ -224,6 +224,6 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,* also be 0 on platforms with missing DT idle states or legacy DT * configuration predating the DT idle states bindings. */ -return i; +return state_idx - start_idx; }EXPORT_SYMBOL_GPL (dt_init_idle_driver);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 15/338 udf: Do not bother looking for prealloc extents if i_lenExtents matches i_size
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 6ad53f0f71c52871202a7bf096feb2c59db33fc5 upstream.
If rounded block-rounded i_lenExtents matches block rounded i_size, there are no preallocation extents. Do not bother walking extent linked list.
--- fs/udf/truncate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/udf/truncate.c +2 -1
@@ -127,9 +127,10 @@ void udf_discard_prealloc(struct inode *uint64_t lbcount =0 ;int8_t etype =-1 , netype;struct udf_inode_info *iinfo =UDF_I (inode); +int bsize =1 << inode->i_blkbits;if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_IN_ICB || - inode->i_size == iinfo->i_lenExtents) +ALIGN (inode->i_size, bsize) ==ALIGN (iinfo->i_lenExtents, bsize))return ; epos.block = iinfo->i_location;
Greg Kroah-Hartman
maintainerPATCH 42/338 alpha: fix syscall entry in !AUDUT_SYSCALL case
In reply to Greg Kroah-HartmanFrom: Al Viro <[email protected]>
[ Upstream commit f7b2431a6d22f7a91c567708e071dfcd6d66db14 ]
We only want to take the slow path if SYSCALL_TRACE or SYSCALL_AUDIT is set; on !AUDIT_SYSCALL configs the current tree hits it whenever _any_ thread flag (including NEED_RESCHED, NOTIFY_SIGNAL, etc.) happens to be set.
--- arch/alpha/kernel/entry.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/alpha/kernel/entry.S +3 -1
@@ -469,8 +469,10 @@ entSys: #ifdef CONFIG_AUDITSYSCALL lda $6, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT and $3, $6, $3 -#endif bne $3, strace +#else + blbs $3, strace /* check for SYSCALL_TRACE in disguise */ +#endif beq $4, 1f ldq $27, 0($5) 1: jsr $26, ($27), alpha_ni_syscall
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 43/338 PM: hibernate: Fix mistake in kerneldoc comment
In reply to Greg Kroah-HartmanFrom: xiongxin <[email protected]>
[ Upstream commit 6e5d7300cbe7c3541bc31f16db3e9266e6027b4b ]
The actual maximum image size formula in hibernate_preallocate_memory() is as follows:
max_size = (count - (size + PAGES_FOR_IO)) / 2
- 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE);
but the one in the kerneldoc comment of the function is different and incorrect.
--- kernel/power/snapshot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/power/snapshot.c +2 -2
@@ -1679,8 +1679,8 @@ static unsigned long minimum_image_size(unsigned long saveable)* /sys/power/reserved_size, respectively). To make this happen, we compute the * total number of available page frames and allocate at least * -* ([page frames total] + PAGES_FOR_IO + [metadata pages]) / 2 -* + 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE) +* ([page frames total] - PAGES_FOR_IO - [metadata pages]) / 2 +* - 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE) * * of them, which corresponds to the maximum size of a hibernation image. *
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 44/338 fs: dont audit the capability check in simple_xattr_list()
In reply to Greg Kroah-HartmanFrom: Ondrej Mosnacek <[email protected]>
[ Upstream commit e7eda157c4071cd1e69f4b1687b0fbe1ae5e6f46 ]
The check being unconditional may lead to unwanted denials reported by LSMs when a process has the capability granted by DAC, but denied by an LSM. In the case of SELinux such denials are a problem, since they can't be effectively filtered out via the policy and when not silenced, they produce noise that may hide a true problem or an attack.
Checking for the capability only if any trusted xattr is actually present wouldn't really address the issue, since calling listxattr(2) on such node on its own doesn't indicate an explicit attempt to see the trusted xattrs. Additionally, it could potentially leak the presence of trusted xattrs to an unprivileged user if they can check for the denials (e.g. through dmesg).
Therefore, it's best (and simplest) to keep the check unconditional and instead use ns_capable_noaudit() that will silence any associated LSM denials.
--- fs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xattr.c +1 -1
@@ -1015,7 +1015,7 @@ static int xattr_list_one(char **buffer, ssize_t *remaining_size,ssize_t simple_xattr_list (struct inode *inode,struct simple_xattrs *xattrs,char *buffer,size_t size) { -bool trusted =capable (CAP_SYS_ADMIN ); +bool trusted =ns_capable_noaudit (&init_user_ns,CAP_SYS_ADMIN );struct simple_xattr *xattr;ssize_t remaining_size = size;int err =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 16/338 udf: Fix extending file within last block
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 1f3868f06855c97a4954c99b36f3fc9eb8f60326 upstream.
When extending file within last block it can happen that the extent is already rounded to the blocksize and thus contains the offset we want to grow up to. In such case we would mistakenly expand the last extent and make it one block longer than it should be, exposing unallocated block in a file and causing data corruption. Fix the problem by properly detecting this case and bailing out.
--- fs/udf/inode.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-)
fs/udf/inode.c +17 -15
@@ -585,13 +585,17 @@ out:static void udf_do_extend_final_block (struct inode *inode,struct extent_position *last_pos,struct kernel_long_ad *last_ext, -uint32_t final_block_len) +uint32_t new_elen) { -struct super_block *sb = inode->i_sb;uint32_t added_bytes; - added_bytes = final_block_len - - (last_ext->extLength & (sb->s_blocksize -1 )); +/* +* Extent already large enough? It may be already rounded up to block +* size... +*/ +if (new_elen <= (last_ext->extLength &UDF_EXTENT_LENGTH_MASK )) +return ; + added_bytes = (last_ext->extLength &UDF_EXTENT_LENGTH_MASK ) - new_elen; last_ext->extLength += added_bytes;UDF_I (inode)->i_lenExtents += added_bytes;
@@ -608,12 +612,12 @@ static int udf_extend_file(struct inodeint8_t etype;struct super_block *sb = inode->i_sb;sector_t first_block = newsize >> sb->s_blocksize_bits, offset; -unsigned long partial_final_block; +loff_t new_elen;int adsize;struct udf_inode_info *iinfo =UDF_I (inode);struct kernel_long_ad extent;int err =0 ; -int within_final_block; +bool within_last_ext;if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_SHORT ) adsize =sizeof (struct short_ad );
@@ -629,9 +633,9 @@ static int udf_extend_file(struct inodeudf_discard_prealloc (inode); etype =inode_bmap (inode, first_block, &epos, &eloc, &elen, &offset); - within_final_block = (etype !=-1 ); + within_last_ext = (etype !=-1 );/* We don't expect extents past EOF... */ -WARN_ON_ONCE (etype !=-1 && +WARN_ON_ONCE (within_last_ext && elen > ((loff_t )offset +1 ) << inode->i_blkbits); if ((!epos.bh && epos.offset == udf_file_entry_alloc_offset(inode)) ||
@@ -648,19 +652,17 @@ static int udf_extend_file(struct inode extent.extLength |= etype <<30 ; } - partial_final_block = newsize & (sb->s_blocksize -1 ); + new_elen = ((loff_t )offset << inode->i_blkbits) | + (newsize & (sb->s_blocksize -1 ));/* File has extent covering the new size (could happen when extending * inside a block)? */ -if (within_final_block) { +if (within_last_ext) {/* Extending file within the last file block */ -udf_do_extend_final_block (inode, &epos, &extent, - partial_final_block); +udf_do_extend_final_block (inode, &epos, &extent, new_elen); }else { -loff_t add = ((loff_t )offset << sb->s_blocksize_bits) | - partial_final_block; - err =udf_do_extend_file (inode, &epos, &extent, add); + err =udf_do_extend_file (inode, &epos, &extent, new_elen); }if (err <0 )
Greg Kroah-Hartman
maintainerPATCH 17/338 usb: gadget: uvc: Prevent buffer overflow in setup handler
In reply to Greg Kroah-HartmanFrom: Szymon Heidrich <[email protected]>
commit 4c92670b16727365699fe4b19ed32013bab2c107 upstream.
Setup function uvc_function_setup permits control transfer requests with up to 64 bytes of payload (UVC_MAX_REQUEST_SIZE), data stage handler for OUT transfer uses memcpy to copy req->actual bytes to uvc_event->data.data array of size 60. This may result in an overflow of 4 bytes.
--- drivers/usb/gadget/function/f_uvc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_uvc.c +3 -2
@@ -220,8 +220,9 @@ uvc_function_ep0_complete(struct usb_epmemset (&v4l2_event,0 ,sizeof (v4l2_event)); v4l2_event.type =UVC_EVENT_DATA ; - uvc_event->data.length = req->actual; -memcpy (&uvc_event->data.data, req->buf, req->actual); + uvc_event->data.length = min_t(unsigned int, req->actual, +sizeof (uvc_event->data.data)); +memcpy (&uvc_event->data.data, req->buf, uvc_event->data.length);v4l2_event_queue (&uvc->vdev, &v4l2_event); } }
Greg Kroah-Hartman
maintainerPATCH 18/338 USB: serial: option: add Quectel EM05-G modem
In reply to Greg Kroah-HartmanFrom: Duke Xin <[email protected]>
commit f0052d7a1edb3d8921b4e154aa8c46c4845b3714 upstream.
The EM05-G modem has 2 USB configurations that are configurable via the AT command AT+QCFG="usbnet",[ 0 | 2 ] which make the modem enumerate with the following interfaces, respectively:
"RMNET" : AT + DIAG + NMEA + Modem + QMI
"MBIM" : MBIM + AT + DIAG + NMEA + Modem
The detailed description of the USB configuration for each mode as follows:
RMNET Mode
--------------
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 21 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0311 Rev= 3.18 S: Manufacturer=Quectel S: Product=Quectel EM05-G C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
MBIM Mode
--------------
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 16 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0311 Rev= 3.18 S: Manufacturer=Quectel S: Product=Quectel EM05-G C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=89(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/usb/serial/option.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/serial/option.c +3 -0
@@ -258,6 +258,7 @@ static void option_instat_callback(struc#define QUECTEL_PRODUCT_EP06 0x0306#define QUECTEL_PRODUCT_EM05G 0x030a#define QUECTEL_PRODUCT_EM060K 0x030b +#define QUECTEL_PRODUCT_EM05G_SG 0x0311#define QUECTEL_PRODUCT_EM12 0x0512#define QUECTEL_PRODUCT_RM500Q 0x0800#define QUECTEL_PRODUCT_RM520N 0x0801
@@ -1163,6 +1164,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff), .driver_info = RSVD(6) | ZLP }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_SG, 0xff), + .driver_info = RSVD(6) | ZLP }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) },
Greg Kroah-Hartman
maintainerPATCH 19/338 USB: serial: cp210x: add Kamstrup RF sniffer PIDs
In reply to Greg Kroah-HartmanFrom: Bruno Thomsen <[email protected]>
commit e88906b169ebcb8046e8f0ad76edd09ab41cfdfe upstream.
The RF sniffers are based on cp210x where the RF frontends are based on a different USB stack.
RF sniffers can analyze packets meta data including power level and perform packet injection.
Can be used to perform RF frontend self-test when connected to a concentrator, ex. arch/arm/boot/dts/imx7d-flex-concentrator.dts
--- drivers/usb/serial/cp210x.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/cp210x.c +2 -0
@@ -199,6 +199,8 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */ { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */ + { USB_DEVICE(0x17A8, 0x0011) }, /* Kamstrup 444 MHz RF sniffer */ + { USB_DEVICE(0x17A8, 0x0013) }, /* Kamstrup 870 MHz RF sniffer */ { USB_DEVICE(0x17A8, 0x0101) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Int Ant) */ { USB_DEVICE(0x17A8, 0x0102) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Ext Ant) */ { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
Greg Kroah-Hartman
maintainerPATCH 20/338 igb: Initialize mailbox message for VF reset
In reply to Greg Kroah-HartmanFrom: Tony Nguyen <[email protected]>
commit de5dc44370fbd6b46bd7f1a1e00369be54a041c8 upstream.
When a MAC address is not assigned to the VF, that portion of the message sent to the VF is not set. The memory, however, is allocated from the stack meaning that information may be leaked to the VM. Initialize the message buffer to 0 so that no information is passed to the VM in this case.
--- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
@@ -6422,7 +6422,7 @@ static void igb_vf_reset_msg(struct igb_ {struct e1000_hw *hw = &adapter->hw;unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses; -u32 reg, msgbuf[3 ]; +u32 reg, msgbuf[3 ] = {};u8 *addr = (u8 *)(&msgbuf[1 ]);/* process all the same items cleared in a function level reset */
Greg Kroah-Hartman
maintainerPATCH 21/338 Bluetooth: L2CAP: Fix u8 overflow
In reply to Greg Kroah-HartmanFrom: Sungwoo Kim <[email protected]>
[ Upstream commit bcd70260ef56e0aee8a4fc6cd214a419900b0765 ]
By keep sending L2CAP_CONF_REQ packets, chan->num_conf_rsp increases multiple times and eventually it will wrap around the maximum number (i.e., 255).
This patch prevents this by adding a boundary check with L2CAP_MAX_CONF_RSP
Btmon log:
Bluetooth monitor ver 5.64
= Note: Linux version 6.1.0-rc2 (x86_64) 0.264594
= Note: Bluetooth subsystem version 2.22 0.264636
@ MGMT Open: btmon (privileged) version 1.22 {0x0001} 0.272191
= New Index: 00:00:00:00:00:00 (Primary,Virtual,hci0) [hci0] 13.877604
@ RAW Open: 9496 (privileged) version 2.22 {0x0002} 13.890741
= Open Index: 00:00:00:00:00:00 [hci0] 13.900426
(...)
Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 1033 #32 [hci0] 14.273106
invalid packet size (12 != 1033)
08 00 01 00 02 01 04 00 01 10 ff ff ............Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 1547 #33 [hci0] 14.273561
invalid packet size (14 != 1547)
0a 00 01 00 04 01 06 00 40 00 00 00 00 00 ........@.....Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 2061 #34 [hci0] 14.274390
invalid packet size (16 != 2061)
0c 00 01 00 04 01 08 00 40 00 00 00 00 00 00 04 ........@.......Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 2061 #35 [hci0] 14.274932
invalid packet size (16 != 2061)
0c 00 01 00 04 01 08 00 40 00 00 00 07 00 03 00 ........@.......= bluetoothd: Bluetooth daemon 5.43 14.401828
Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 1033 #36 [hci0] 14.275753
invalid packet size (12 != 1033)
08 00 01 00 04 01 04 00 40 00 00 00 ........@...--- net/bluetooth/l2cap_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/bluetooth/l2cap_core.c +2 -1
@@ -4193,7 +4193,8 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, chan->ident = cmd->ident;l2cap_send_cmd (conn, cmd->ident,L2CAP_CONF_RSP , len, rsp); - chan->num_conf_rsp++; +if (chan->num_conf_rsp <L2CAP_CONF_MAX_CONF_RSP ) + chan->num_conf_rsp++;/* Reset config buffer. */ chan->conf_len =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 12/338 udf: Discard preallocation before extending file with a hole
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 16d0556568148bdcaa45d077cac9f8f7077cf70a upstream.
When extending file with a hole, we tried to preserve existing preallocation for the file. However that is not very useful and complicates code because the previous extent may need to be rounded to block boundary as well (which we forgot to do thus causing data corruption for sequence like:
xfs_io -f -c "pwrite 0x75e63 11008" -c "truncate 0x7b24b" \
-c "truncate 0xabaa3" -c "pwrite 0xac70b 22954" \
-c "pwrite 0x93a43 11358" -c "pwrite 0xb8e65 52211" file
with 512-byte block size. Just discard preallocation before extending file to simplify things and also fix this data corruption.
--- fs/udf/inode.c | 46 ++++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 28 deletions(-)
fs/udf/inode.c +18 -28
@@ -434,6 +434,12 @@ static int udf_get_block(struct inode *i iinfo->i_next_alloc_goal++; } +/* +* Block beyond EOF and prealloc extents? Just discard preallocation +* as it is not useful and complicates things. +*/ +if (((loff_t )block) << inode->i_blkbits > iinfo->i_lenExtents) +udf_discard_prealloc (inode);udf_clear_extent_cache (inode); phys =inode_getblk (inode, block, &err, &new);if (!phys)
@@ -483,8 +489,6 @@ static int udf_do_extend_file(struct inouint32_t add;int count =0 , fake = !(last_ext->extLength &UDF_EXTENT_LENGTH_MASK );struct super_block *sb = inode->i_sb; -struct kernel_lb_addr prealloc_loc = {}; -int prealloc_len =0 ;struct udf_inode_info *iinfo;int err;
@@ -505,19 +509,6 @@ static int udf_do_extend_file(struct ino ~(sb->s_blocksize -1 ); } -/* Last extent are just preallocated blocks? */ -if ((last_ext->extLength &UDF_EXTENT_FLAG_MASK ) == -EXT_NOT_RECORDED_ALLOCATED ) { -/* Save the extent so that we can reattach it to the end */ - prealloc_loc = last_ext->extLocation; - prealloc_len = last_ext->extLength; -/* Mark the extent as a hole */ - last_ext->extLength =EXT_NOT_RECORDED_NOT_ALLOCATED | - (last_ext->extLength &UDF_EXTENT_LENGTH_MASK ); - last_ext->extLocation.logicalBlockNum =0 ; - last_ext->extLocation.partitionReferenceNum =0 ; - } -/* Can we merge with the previous extent? */ if ((last_ext->extLength &UDF_EXTENT_FLAG_MASK ) ==EXT_NOT_RECORDED_NOT_ALLOCATED ) {
@@ -545,7 +536,7 @@ static int udf_do_extend_file(struct ino* more extents, we may need to enter possible following * empty indirect extent. */ -if (new_block_bytes || prealloc_len) +if (new_block_bytes)udf_next_aext (inode, last_pos, &tmploc, &tmplen,0 ); }
@@ -579,17 +570,6 @@ static int udf_do_extend_file(struct ino } out: -/* Do we have some preallocated blocks saved? */ -if (prealloc_len) { - err =udf_add_aext (inode, last_pos, &prealloc_loc, - prealloc_len,1 ); -if (err) -return err; - last_ext->extLocation = prealloc_loc; - last_ext->extLength = prealloc_len; - count++; - } -/* last_pos should point to the last written extent... */ if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_SHORT ) last_pos->offset -=sizeof (struct short_ad );
@@ -642,8 +622,17 @@ static int udf_extend_file(struct inodeelse BUG (); +/* +* When creating hole in file, just don't bother with preserving +* preallocation. It likely won't be very useful anyway. +*/ +udf_discard_prealloc (inode); + etype =inode_bmap (inode, first_block, &epos, &eloc, &elen, &offset); within_final_block = (etype !=-1 ); +/* We don't expect extents past EOF... */ +WARN_ON_ONCE (etype !=-1 && + elen > ((loff_t )offset +1 ) << inode->i_blkbits);if ((!epos.bh && epos.offset ==udf_file_entry_alloc_offset (inode)) || (epos.bh && epos.offset ==sizeof (struct allocExtDesc ))) {
@@ -772,10 +761,11 @@ static sector_t inode_getblk(struct inod goto out_free; } -/* Are we beyond EOF? */ +/* Are we beyond EOF and preallocated extent? */ if (etype ==-1 ) {int ret;loff_t hole_len; + isBeyondEOF = true;if (count) {if (c)
Greg Kroah-Hartman
maintainerPATCH 46/338 timerqueue: Use rb_entry_safe() in timerqueue_getnext()
In reply to Greg Kroah-HartmanFrom: Barnabás Pőcze <[email protected]>
[ Upstream commit 2f117484329b233455ee278f2d9b0a4356835060 ]
When timerqueue_getnext() is called on an empty timer queue, it will use rb_entry() on a NULL pointer, which is invalid. Fix that by using rb_entry_safe() which handles NULL pointers.
This has not caused any issues so far because the offset of the rb_node member in timerqueue_node is 0, so rb_entry() is essentially a no-op.
--- include/linux/timerqueue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/timerqueue.h +1 -1
@@ -35,7 +35,7 @@ struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head) {struct rb_node *leftmost =rb_first_cached (&head->rb_root); - return rb_entry(leftmost, struct timerqueue_node, node); + return rb_entry_safe(leftmost, struct timerqueue_node, node); }static inline void timerqueue_init (struct timerqueue_node *node)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 55/338 rapidio: rio: fix possible name leak in rio_register_mport()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit e92a216d16bde65d21a3227e0fb2aa0794576525 ]
If device_register() returns error, the name allocated by dev_set_name() need be freed. It should use put_device() to give up the reference in the error path, so that the name can be freed in kobject_cleanup(), and list_del() is called to delete the port from rio_mports.
--- drivers/rapidio/rio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/rapidio/rio.c +7 -2
@@ -2272,11 +2272,16 @@ int rio_register_mport(struct rio_mport *port)atomic_set (&port->state,RIO_DEVICE_RUNNING ); res =device_register (&port->dev); -if (res) +if (res) {dev_err (&port->dev,"RIO: mport%d registration failed ERR=%d\n" , port->id, res); -else +mutex_lock (&rio_mport_list_lock); +list_del (&port->node); +mutex_unlock (&rio_mport_list_lock); +put_device (&port->dev); + }else {dev_dbg (&port->dev,"RIO: registered mport%d\n" , port->id); + }return res; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 56/338 ACPICA: Fix use-after-free in acpi_ut_copy_ipackage_to_ipackage()
In reply to Greg Kroah-HartmanFrom: Li Zetao <[email protected]>
[ Upstream commit 470188b09e92d83c5a997f25f0e8fb8cd2bc3469 ]
There is an use-after-free reported by KASAN:
BUG: KASAN: use-after-free in acpi_ut_remove_reference+0x3b/0x82 Read of size 1 at addr ffff888112afc460 by task modprobe/2111 CPU: 0 PID: 2111 Comm: modprobe Not tainted 6.1.0-rc7-dirty Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), Call Trace: <TASK> kasan_report+0xae/0xe0 acpi_ut_remove_reference+0x3b/0x82 acpi_ut_copy_iobject_to_iobject+0x3be/0x3d5 acpi_ds_store_object_to_local+0x15d/0x3a0 acpi_ex_store+0x78d/0x7fd acpi_ex_opcode_1A_1T_1R+0xbe4/0xf9b acpi_ps_parse_aml+0x217/0x8d5 ... </TASK>
The root cause of the problem is that the acpi_operand_object is freed when acpi_ut_walk_package_tree() fails in acpi_ut_copy_ipackage_to_ipackage(), lead to repeated release in acpi_ut_copy_iobject_to_iobject(). The problem was introduced by "8aa5e56eeb61" commit, this commit is to fix memory leak in acpi_ut_copy_iobject_to_iobject(), repeatedly adding remove operation, lead to "acpi_operand_object" used after free.
Fix it by removing acpi_ut_remove_reference() in acpi_ut_copy_ipackage_to_ipackage(). acpi_ut_copy_ipackage_to_ipackage() is called to copy an internal package object into another internal package object, when it fails, the memory of acpi_operand_object should be freed by the caller.
--- drivers/acpi/acpica/utcopy.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/acpi/acpica/utcopy.c +0 -7
@@ -950,13 +950,6 @@ acpi_ut_copy_ipackage_to_ipackage(union acpi_operand_object *source_obj, status =acpi_ut_walk_package_tree (source_obj, dest_obj, acpi_ut_copy_ielement_to_ielement, walk_state); -if (ACPI_FAILURE (status)) { - -/* On failure, delete the destination package object */ - -acpi_ut_remove_reference (dest_obj); - } -return_ACPI_STATUS (status); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 57/338 uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix
In reply to Greg Kroah-HartmanFrom: Oleg Nesterov <[email protected]>
[ Upstream commit cefa72129e45313655d53a065b8055aaeb01a0c9 ]
Intel ICC -hotpatch inserts 2-byte "0x66 0x90" NOP at the start of each function to reserve extra space for hot-patching, and currently it is not possible to probe these functions because branch_setup_xol_ops() wrongly rejects NOP with REP prefix as it treats them like word-sized branch instructions.
--- arch/x86/kernel/uprobes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/uprobes.c +3 -1
@@ -718,8 +718,9 @@ static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)switch (opc1) {case 0xeb :/* jmp 8 */ case 0xe9 :/* jmp 32 */ -case 0x90 :/* prefix* + nop; same as jmp with .offs = 0 */ break ; +case 0x90 :/* prefix* + nop; same as jmp with .offs = 0 */ + goto setup;case 0xe8 :/* call relative */ branch_clear_offset (auprobe, insn);
@@ -748,6 +749,7 @@ static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)return -ENOTSUPP ; } +setup: auprobe->branch.opc1 = opc1; auprobe->branch.ilen = insn->length; auprobe->branch.offs = insn->immediate.value;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 58/338 x86/xen: Fix memory leak in xen_init_lock_cpu()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit ca84ce153d887b1dc8b118029976cc9faf2a9b40 ]
In xen_init_lock_cpu(), the @name has allocated new string by kasprintf(), if bind_ipi_to_irqhandler() fails, it should be freed, otherwise may lead to a memory leak issue, fix it.
--- arch/x86/xen/spinlock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/xen/spinlock.c +3 -3
@@ -81,6 +81,7 @@ void xen_init_lock_cpu(int cpu) cpu, per_cpu(lock_kicker_irq, cpu)); name =kasprintf (GFP_KERNEL ,"spinlock%d" , cpu); +per_cpu (irq_name, cpu) = name; irq = bind_ipi_to_irqhandler(XEN_SPIN_UNLOCK_VECTOR, cpu, dummy_handler,
@@ -91,7 +92,6 @@ void xen_init_lock_cpu(int cpu)if (irq >=0 ) {disable_irq (irq);/* make sure it's never delivered */ per_cpu (lock_kicker_irq, cpu) = irq; -per_cpu (irq_name, cpu) = name; }printk ("cpu %d spinlock event irq %d\n" , cpu, irq);
@@ -104,6 +104,8 @@ void xen_uninit_lock_cpu(int cpu)if (!xen_pvspin)return ; +kfree (per_cpu (irq_name, cpu)); +per_cpu (irq_name, cpu) =NULL ;/* * When booting the kernel with 'mitigations=auto,nosmt', the secondary * CPUs are not activated, and lock_kicker_irq is not initialized.
@@ -114,8 +116,6 @@ void xen_uninit_lock_cpu(int cpu)unbind_from_irqhandler (irq,NULL );per_cpu (lock_kicker_irq, cpu) =-1 ; -kfree (per_cpu (irq_name, cpu)); -per_cpu (irq_name, cpu) =NULL ; }PV_CALLEE_SAVE_REGS_THUNK (xen_vcpu_stolen);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 59/338 platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()
In reply to Greg Kroah-HartmanFrom: Yu Liao <[email protected]>
[ Upstream commit 727cc0147f5066e359aca65cc6cc5e6d64cc15d8 ]
The ACPI buffer memory (out.pointer) returned by wmi_evaluate_method() is not freed after the call, so it leads to memory leak.
The method results in ACPI buffer is not used, so just pass NULL to wmi_evaluate_method() which fixes the memory leak.
--- drivers/platform/x86/mxm-wmi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/platform/x86/mxm-wmi.c +2 -6
@@ -48,13 +48,11 @@ int mxm_wmi_call_mxds(int adapter) .xarg = 1, };struct acpi_buffer input = { (acpi_size )sizeof (args), &args }; -struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER ,NULL };acpi_status status;printk ("calling mux switch %d\n" , adapter); - status =wmi_evaluate_method (MXM_WMMX_GUID ,0x0 , adapter, &input, - &output); + status =wmi_evaluate_method (MXM_WMMX_GUID ,0x0 , adapter, &input,NULL );if (ACPI_FAILURE (status))return status;
@@ -73,13 +71,11 @@ int mxm_wmi_call_mxmx(int adapter) .xarg = 1, };struct acpi_buffer input = { (acpi_size )sizeof (args), &args }; -struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER ,NULL };acpi_status status;printk ("calling mux switch %d\n" , adapter); - status =wmi_evaluate_method (MXM_WMMX_GUID ,0x0 , adapter, &input, - &output); + status =wmi_evaluate_method (MXM_WMMX_GUID ,0x0 , adapter, &input,NULL );if (ACPI_FAILURE (status))return status;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 60/338 MIPS: BCM63xx: Add check for NULL for clk in clk_enable
In reply to Greg Kroah-HartmanFrom: Anastasia Belova <[email protected]>
[ Upstream commit ee9ef11bd2a59c2fefaa0959e5efcdf040d7c654 ]
Check clk for NULL before calling clk_enable_unlocked where clk is dereferenced. There is such check in other implementations of clk_enable.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- arch/mips/bcm63xx/clk.c | 2 ++ 1 file changed, 2 insertions(+)
arch/mips/bcm63xx/clk.c +2 -0
@@ -317,6 +317,8 @@ static struct clk clk_periph = {*/ int clk_enable (struct clk *clk) { +if (!clk) +return 0 ;mutex_lock (&clocks_mutex);clk_enable_unlocked (clk);mutex_unlock (&clocks_mutex);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 61/338 fs: sysv: Fix sysv_nblocks() returns wrong value
In reply to Greg Kroah-HartmanFrom: Chen Zhongjin <[email protected]>
[ Upstream commit e0c49bd2b4d3cd1751491eb2d940bce968ac65e9 ]
sysv_nblocks() returns 'blocks' rather than 'res', which only counting the number of triple-indirect blocks and causing sysv_getattr() gets a wrong result.
[AV: this is actually a sysv counterpart of minixfs fix - 0fcd426de9d0 "[PATCH] minix block usage counting fix" in historical tree; mea culpa, should've thought to check fs/sysv back then...]
--- fs/sysv/itree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/sysv/itree.c +1 -1
@@ -438,7 +438,7 @@ static unsigned sysv_nblocks(struct super_block *s, loff_t size) res += blocks; direct =1 ; } -return blocks; +return res; } int sysv_getattr(const struct path *path, struct kstat *stat,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 62/338 rapidio: fix possible UAF when kfifo_alloc() fails
In reply to Greg Kroah-HartmanFrom: Wang Weiyang <[email protected]>
[ Upstream commit 02d7d89f816951e0862147d751b1150d67aaebdd ]
If kfifo_alloc() fails in mport_cdev_open(), goto err_fifo and just free priv. But priv is still in the chdev->file_list, then list traversal may cause UAF. This fixes the following smatch warning:
drivers/rapidio/devices/rio_mport_cdev.c:1930 mport_cdev_open() warn: '&priv->list' not removed from list
--- drivers/rapidio/devices/rio_mport_cdev.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/rapidio/devices/rio_mport_cdev.c +3 -4
@@ -1963,10 +1963,6 @@ static int mport_cdev_open(struct inode *inode, struct file *filp) priv->md = chdev; -mutex_lock (&chdev->file_mutex); -list_add_tail (&priv->list, &chdev->file_list); -mutex_unlock (&chdev->file_mutex); -INIT_LIST_HEAD (&priv->db_filters);INIT_LIST_HEAD (&priv->pw_filters);spin_lock_init (&priv->fifo_lock);
@@ -1986,6 +1982,9 @@ static int mport_cdev_open(struct inode *inode, struct file *filp)spin_lock_init (&priv->req_lock);mutex_init (&priv->dma_lock);#endif +mutex_lock (&chdev->file_mutex); +list_add_tail (&priv->list, &chdev->file_list); +mutex_unlock (&chdev->file_mutex); filp->private_data = priv; goto out;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 63/338 eventfd: change int to __u64 in eventfd_signal() ifndef CONFIG_EVENTFD
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit fd4e60bf0ef8eb9edcfa12dda39e8b6ee9060492 ]
Commit ee62c6b2dc93 ("eventfd: change int to __u64 in eventfd_signal()") forgot to change int to __u64 in the CONFIG_EVENTFD=n stub function.
--- include/linux/eventfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/eventfd.h +1 -1
@@ -57,7 +57,7 @@ static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd)return ERR_PTR (-ENOSYS ); } -static inline int eventfd_signal (struct eventfd_ctx *ctx,int n) +static inline int eventfd_signal (struct eventfd_ctx *ctx,__u64 n) {return -ENOSYS ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 64/338 hfs: Fix OOB Write in hfs_asc2mac
In reply to Greg Kroah-HartmanFrom: ZhangPeng <[email protected]>
[ Upstream commit c53ed55cb275344086e32a7080a6b19cb183650b ]
Syzbot reported a OOB Write bug:
loop0: detected capacity change from 0 to 64
==================================================================
BUG: KASAN: slab-out-of-bounds in hfs_asc2mac+0x467/0x9a0 fs/hfs/trans.c:133 Write of size 1 at addr ffff88801848314e by task syz-executor391/3632 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x1f0 mm/kasan/report.c:395 kasan_report+0xcd/0x100 mm/kasan/report.c:495 hfs_asc2mac+0x467/0x9a0 fs/hfs/trans.c:133 hfs_cat_build_key+0x92/0x170 fs/hfs/catalog.c:28 hfs_lookup+0x1ab/0x2c0 fs/hfs/dir.c:31 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x10e6/0x2df0 fs/namei.c:3710 do_filp_open+0x264/0x4f0 fs/namei.c:3740
If in->len is much larger than HFS_NAMELEN(31) which is the maximum length of an HFS filename, a OOB write could occur in hfs_asc2mac(). In that case, when the dst reaches the boundary, the srclen is still greater than 0, which causes a OOB write.
Fix this by adding a check on dstlen in while() before writing to dst address.
--- fs/hfs/trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfs/trans.c +1 -1
@@ -109,7 +109,7 @@ void hfs_asc2mac(struct super_block *sb, struct hfs_name *out, const struct qstrif (nls_io) {wchar_t ch; -while (srclen >0 ) { +while (srclen >0 && dstlen >0 ) { size = nls_io->char2uni (src, srclen, &ch);if (size <0 ) { ch ='?' ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 47/338 ocfs2: fix memory leak in ocfs2_stack_glue_init()
In reply to Greg Kroah-HartmanFrom: Shang XiaoJing <[email protected]>
[ Upstream commit 13b6269dd022aaa69ca8d1df374ab327504121cf ]
ocfs2_table_header should be free in ocfs2_stack_glue_init() if ocfs2_sysfs_init() failed, otherwise kmemleak will report memleak.
BUG: memory leak
unreferenced object 0xffff88810eeb5800 (size 128):
comm "modprobe", pid 4507, jiffies 4296182506 (age 55.888s)
hex dump (first 32 bytes):
c0 40 14 a0 ff ff ff ff 00 00 00 00 01 00 00 00 .@..............
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<000000001e59e1cd>] __register_sysctl_table+0xca/0xef0
[<00000000c04f70f7>] 0xffffffffa0050037
[<000000001bd12912>] do_one_initcall+0xdb/0x480
[<0000000064f766c9>] do_init_module+0x1cf/0x680
[<000000002ba52db0>] load_module+0x6441/0x6f20
[<000000009772580d>] __do_sys_finit_module+0x12f/0x1c0
[<00000000380c1f22>] do_syscall_64+0x3f/0x90
[<000000004cf473bc>] entry_SYSCALL_64_after_hwframe+0x63/0xcd--- fs/ocfs2/stackglue.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
fs/ocfs2/stackglue.c +7 -1
@@ -715,6 +715,8 @@ static struct ctl_table_header *ocfs2_table_header;static int __init ocfs2_stack_glue_init (void ) { +int ret; +strcpy (cluster_stack_name,OCFS2_STACK_PLUGIN_O2CB ); ocfs2_table_header =register_sysctl_table (ocfs2_root_table);
@@ -724,7 +726,11 @@ static int __init ocfs2_stack_glue_init(void)return -ENOMEM ;/* or something. */ } -return ocfs2_sysfs_init (); + ret =ocfs2_sysfs_init (); +if (ret) +unregister_sysctl_table (ocfs2_table_header); + +return ret; } static void __exit ocfs2_stack_glue_exit(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 65/338 rapidio: devices: fix missing put_device in mport_cdev_open
In reply to Greg Kroah-HartmanFrom: Cai Xinchen <[email protected]>
[ Upstream commit d5b6e6eba3af11cb2a2791fa36a2524990fcde1a ]
When kfifo_alloc fails, the refcount of chdev->dev is left incremental. We should use put_device(&chdev->dev) to decrease the ref count of chdev->dev to avoid refcount leak.
--- drivers/rapidio/devices/rio_mport_cdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/rapidio/devices/rio_mport_cdev.c +1 -0
@@ -1971,6 +1971,7 @@ static int mport_cdev_open(struct inode *inode, struct file *filp)sizeof (struct rio_event ) *MPORT_EVENT_DEPTH , GFP_KERNEL);if (ret <0 ) { +put_device (&chdev->dev);dev_err (&chdev->dev,DRV_NAME ": kfifo_alloc failed\n" ); ret = -ENOMEM ; goto err_fifo;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 66/338 wifi: ath9k: hif_usb: fix memory leak of urbs in ath9k_hif_usb_dealloc_tx_urbs()
In reply to Greg Kroah-HartmanFrom: Fedor Pchelkin <[email protected]>
[ Upstream commit c2a94de38c74e86f49124ac14f093d6a5c377a90 ]
Syzkaller reports a long-known leak of urbs inath9k_hif_usb_dealloc_tx_urbs().
The cause of the leak is that usb_get_urb() is called but usb_free_urb() (or usb_put_urb()) is not called inside usb_kill_urb() as urb->dev or urb->ep fields have not been initialized and usb_kill_urb() returns immediately.
The patch removes trying to kill urbs located in hif_dev->tx.tx_buf because hif_dev->tx.tx_buf is not supposed to contain urbs which are in pending state (the pending urbs are stored in hif_dev->tx.tx_pending). The tx.tx_lock is acquired so there should not be any changes in the list.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- drivers/net/wireless/ath/ath9k/hif_usb.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/wireless/ath/ath9k/hif_usb.c +0 -4
@@ -779,14 +779,10 @@ static void ath9k_hif_usb_dealloc_tx_urbs(struct hif_device_usb *hif_dev)spin_lock_irqsave (&hif_dev->tx.tx_lock, flags);list_for_each_entry_safe (tx_buf, tx_buf_tmp, &hif_dev->tx.tx_buf, list) { -usb_get_urb (tx_buf->urb); -spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags); -usb_kill_urb (tx_buf->urb);list_del (&tx_buf->list);usb_free_urb (tx_buf->urb);kfree (tx_buf->buf);kfree (tx_buf); -spin_lock_irqsave (&hif_dev->tx.tx_lock, flags); }spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 67/338 wifi: ath9k: hif_usb: Fix use-after-free in ath9k_hif_usb_reg_in_cb()
In reply to Greg Kroah-HartmanFrom: Fedor Pchelkin <[email protected]>
[ Upstream commit dd95f2239fc846795fc926787c3ae0ca701c9840 ]
It is possible that skb is freed in ath9k_htc_rx_msg(), then usb_submit_urb() fails and we try to free skb again. It causes use-after-free bug. Moreover, if alloc_skb() fails, urb->context becomes NULL but rx_buf is not freed and there can be a memory leak.
The patch removes unnecessary nskb and makes skb processing more clear: it is supposed that ath9k_htc_rx_msg() either frees old skb or passes its managing to another callback function.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- drivers/net/wireless/ath/ath9k/hif_usb.c | 28 +++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/net/wireless/ath/ath9k/hif_usb.c +15 -13
@@ -707,14 +707,13 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)struct rx_buf *rx_buf = (struct rx_buf *)urb->context;struct hif_device_usb *hif_dev = rx_buf->hif_dev;struct sk_buff *skb = rx_buf->skb; -struct sk_buff *nskb;int ret;if (!skb)return ;if (!hif_dev) - goto free; + goto free_skb;switch (urb->status) {case 0 :
@@ -723,7 +722,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)case -ECONNRESET :case -ENODEV :case -ESHUTDOWN : - goto free; + goto free_skb;default :skb_reset_tail_pointer (skb);skb_trim (skb,0 );
@@ -734,25 +733,27 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)if (likely (urb->actual_length !=0 )) {skb_put (skb, urb->actual_length); -/* Process the command first */ +/* +* Process the command first. +* skb is either freed here or passed to be +* managed to another callback function. +*/ ath9k_htc_rx_msg (hif_dev->htc_handle, skb, skb->len,USB_REG_IN_PIPE ); - - nskb =alloc_skb (MAX_REG_IN_BUF_SIZE ,GFP_ATOMIC ); -if (!nskb) { + skb =alloc_skb (MAX_REG_IN_BUF_SIZE ,GFP_ATOMIC ); +if (!skb) {dev_err (&hif_dev->udev->dev,"ath9k_htc: REG_IN memory allocation failure\n" ); - urb->context =NULL ; -return ; + goto free_rx_buf; } - rx_buf->skb = nskb; + rx_buf->skb = skb;usb_fill_int_urb (urb, hif_dev->udev,usb_rcvintpipe (hif_dev->udev,USB_REG_IN_PIPE ), - nskb->data,MAX_REG_IN_BUF_SIZE , + skb->data,MAX_REG_IN_BUF_SIZE , ath9k_hif_usb_reg_in_cb, rx_buf,1 ); }
@@ -761,12 +762,13 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) ret =usb_submit_urb (urb,GFP_ATOMIC );if (ret) {usb_unanchor_urb (urb); - goto free; + goto free_skb; }return ; -free: +free_skb:kfree_skb (skb); +free_rx_buf:kfree (rx_buf); urb->context =NULL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 68/338 media: i2c: ad5820: Fix error path
In reply to Greg Kroah-HartmanFrom: Ricardo Ribalda <[email protected]>
[ Upstream commit 9fce241660f37d9e95e93c0ae6fba8cfefa5797b ]
Error path seems to be swaped. Fix the order and provide some meaningful names.
--- drivers/media/i2c/ad5820.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/media/i2c/ad5820.c +5 -5
@@ -321,18 +321,18 @@ static int ad5820_probe(struct i2c_client *client, ret =media_entity_pads_init (&coil->subdev.entity,0 ,NULL );if (ret <0 ) - goto cleanup2; + goto clean_mutex; ret =v4l2_async_register_subdev (&coil->subdev);if (ret <0 ) - goto cleanup; + goto clean_entity;return ret; -cleanup2: -mutex_destroy (&coil->power_lock); -cleanup: +clean_entity:media_entity_cleanup (&coil->subdev.entity); +clean_mutex: +mutex_destroy (&coil->power_lock);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 69/338 spi: Update reference to struct spi_controller
In reply to Greg Kroah-HartmanFrom: Jonathan Neuschäfer <[email protected]>
[ Upstream commit bf585ccee22faf469d82727cf375868105b362f7 ]
struct spi_master has been renamed to struct spi_controller. Update the reference in spi.rst to make it clickable again.
--- Documentation/driver-api/spi.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/driver-api/spi.rst +2 -2
@@ -25,8 +25,8 @@ hardware, which may be as simple as a set of GPIO pins or as complex as a pair of FIFOs connected to dual DMA engines on the other side of the SPI shift register (maximizing throughput). Such drivers bridge between whatever bus they sit on (often the platform bus) and SPI, and expose -the SPI side of their device as a :c:type:`struct spi_master -<spi_master>`. SPI devices are children of that master, +the SPI side of their device as a :c:type:`struct spi_controller +<spi_controller>`. SPI devices are children of that master, represented as a :c:type:`struct spi_device <spi_device>` and manufactured from :c:type:`struct spi_board_info <spi_board_info>` descriptors which are usually provided by
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 70/338 media: vivid: fix compose size exceed boundary
In reply to Greg Kroah-HartmanFrom: Liu Shixin <[email protected]>
[ Upstream commit 94a7ad9283464b75b12516c5512541d467cefcf8 ]
syzkaller found a bug:
BUG: unable to handle page fault for address: ffffc9000a3b1000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 100000067 P4D 100000067 PUD 10015f067 PMD 1121ca067 PTE 0 Oops: 0002 [#1] PREEMPT SMP CPU: 0 PID: 23489 Comm: vivid-000-vid-c Not tainted 6.1.0-rc1+ #512 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:memcpy_erms+0x6/0x10 [...] Call Trace: <TASK> ? tpg_fill_plane_buffer+0x856/0x15b0 vivid_fillbuff+0x8ac/0x1110 vivid_thread_vid_cap_tick+0x361/0xc90 vivid_thread_vid_cap+0x21a/0x3a0 kthread+0x143/0x180 ret_from_fork+0x1f/0x30 </TASK>
This is because we forget to check boundary after adjust compose->height int V4L2_SEL_TGT_CROP case. Add v4l2_rect_map_inside() to fix this problem for this case.
--- drivers/media/platform/vivid/vivid-vid-cap.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/platform/vivid/vivid-vid-cap.c +1 -0
@@ -938,6 +938,7 @@ int vivid_vid_cap_s_selection(struct file *file, void *fh, struct v4l2_selectionif (dev->has_compose_cap) {v4l2_rect_set_min_size (compose, &min_rect);v4l2_rect_set_max_size (compose, &max_rect); +v4l2_rect_map_inside (compose, &fmt); } dev->fmt_cap_rect = fmt;tpg_s_buf_height (&dev->tpg, fmt.height);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 71/338 mtd: Fix device name leak when register device failed in add_mtd_device()
In reply to Greg Kroah-HartmanFrom: Zhang Xiaoxu <[email protected]>
[ Upstream commit 895d68a39481a75c680aa421546931fb11942fa6 ]
There is a kmemleak when register device failed:
unreferenced object 0xffff888101aab550 (size 8):
comm "insmod", pid 3922, jiffies 4295277753 (age 925.408s)
hex dump (first 8 bytes):
6d 74 64 30 00 88 ff ff mtd0....
backtrace:
[<00000000bde26724>] __kmalloc_node_track_caller+0x4e/0x150
[<000000003c32b416>] kvasprintf+0xb0/0x130
[<000000001f7a8f15>] kobject_set_name_vargs+0x2f/0xb0
[<000000006e781163>] dev_set_name+0xab/0xe0
[<00000000e30d0c78>] add_mtd_device+0x4bb/0x700
[<00000000f3d34de7>] mtd_device_parse_register+0x2ac/0x3f0
[<00000000c0d88488>] 0xffffffffa0238457
[<00000000b40d0922>] 0xffffffffa02a008f
[<0000000023d17b9d>] do_one_initcall+0x87/0x2a0
[<00000000770f6ca6>] do_init_module+0xdf/0x320
[<000000007b6768fe>] load_module+0x2f98/0x3330
[<00000000346bed5a>] __do_sys_finit_module+0x113/0x1b0
[<00000000674c2290>] do_syscall_64+0x35/0x80
[<000000004c6a8d97>] entry_SYSCALL_64_after_hwframe+0x46/0xb0If register device failed, should call put_device() to give up the reference.
--- drivers/mtd/mtdcore.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/mtdcore.c +3 -1
@@ -552,8 +552,10 @@ int add_mtd_device(struct mtd_info *mtd)dev_set_drvdata (&mtd->dev, mtd);of_node_get (mtd_get_of_node (mtd)); error =device_register (&mtd->dev); -if (error) +if (error) { +put_device (&mtd->dev); goto fail_added; + }if (!IS_ERR_OR_NULL (dfs_dir_mtd)) { mtd->dbg.dfs_dir =debugfs_create_dir (dev_name (&mtd->dev), dfs_dir_mtd);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 72/338 media: camss: Clean up received buffers on failed start of streaming
In reply to Greg Kroah-HartmanFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit c8f3582345e6a69da65ab588f7c4c2d1685b0e80 ]
It is required to return the received buffers, if streaming can not be started. For instance media_pipeline_start() may fail with EPIPE, if a link validation between entities is not passed, and in such a case a user gets a kernel warning:
WARNING: CPU: 1 PID: 520 at drivers/media/common/videobuf2/videobuf2-core.c:1592 vb2_start_streaming+0xec/0x160 <snip> Call trace: vb2_start_streaming+0xec/0x160 vb2_core_streamon+0x9c/0x1a0 vb2_ioctl_streamon+0x68/0xbc v4l_streamon+0x30/0x3c __video_do_ioctl+0x184/0x3e0 video_usercopy+0x37c/0x7b0 video_ioctl2+0x24/0x40 v4l2_ioctl+0x4c/0x70
The fix is to correct the error path in video_start_streaming() of camss.
--- drivers/media/platform/qcom/camss-8x16/camss-video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/platform/qcom/camss-8x16/camss-video.c +2 -1
@@ -353,7 +353,7 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count) ret =media_pipeline_start (&vdev->entity, &video->pipe);if (ret <0 ) -return ret; + goto flush_buffers; ret =video_check_format (video);if (ret <0 )
@@ -382,6 +382,7 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count) error:media_pipeline_stop (&vdev->entity); +flush_buffers: video->ops->flush_buffers (video,VB2_BUF_STATE_QUEUED );return ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 73/338 drm/radeon: Add the missed acpi_put_table() to fix memory leak
In reply to Greg Kroah-HartmanFrom: Hanjun Guo <[email protected]>
[ Upstream commit 10276a20be1115e1f76c189330da2992df980eee ]
When the radeon driver reads the bios information from ACPI table in radeon_acpi_vfct_bios(), it misses to call acpi_put_table() to release the ACPI memory after the init, so add acpi_put_table() properly to fix the memory leak.
v2: fix text formatting (Alex)
--- drivers/gpu/drm/radeon/radeon_bios.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/radeon_bios.c +11 -7
@@ -600,13 +600,14 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)acpi_size tbl_size;UEFI_ACPI_VFCT *vfct;unsigned offset; +bool r = false;if (!ACPI_SUCCESS (acpi_get_table ("VFCT" ,1 , &hdr)))return false; tbl_size = hdr->length;if (tbl_size <sizeof (UEFI_ACPI_VFCT )) {DRM_ERROR ("ACPI VFCT table present but broken (too short #1)\n" ); -return false; + goto out; } vfct = (UEFI_ACPI_VFCT *)hdr;
@@ -619,13 +620,13 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) offset +=sizeof (VFCT_IMAGE_HEADER );if (offset > tbl_size) {DRM_ERROR ("ACPI VFCT image header truncated\n" ); -return false; + goto out; } offset += vhdr->ImageLength;if (offset > tbl_size) {DRM_ERROR ("ACPI VFCT image truncated\n" ); -return false; + goto out; } if (vhdr->ImageLength &&
@@ -637,15 +638,18 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) rdev->bios =kmemdup (&vbios->VbiosContent, vhdr->ImageLength,GFP_KERNEL ); +if (rdev->bios) + r = true; -if (!rdev->bios) -return false; - return true; + goto out; } }DRM_ERROR ("ACPI VFCT table present but broken (too short #2)\n" ); -return false; + +out: +acpi_put_table (hdr); +return r; }#else static inline bool radeon_acpi_vfct_bios (struct radeon_device *rdev)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 74/338 ASoC: pxa: fix null-pointer dereference in filter()
In reply to Greg Kroah-HartmanFrom: Zeng Heng <[email protected]>
[ Upstream commit ec7bf231aaa1bdbcb69d23bc50c753c80fb22429 ]
kasprintf() would return NULL pointer when kmalloc() fail to allocate. Need to check the return pointer before calling strcmp().
--- sound/soc/pxa/mmp-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/pxa/mmp-pcm.c +1 -1
@@ -88,7 +88,7 @@ static bool filter(struct dma_chan *chan, void *param) devname =kasprintf (GFP_KERNEL ,"%s.%d" , dma_data->dma_res->name, dma_data->ssp_id); -if ((strcmp (dev_name (chan->device->dev), devname) ==0 ) && +if (devname && (strcmp (dev_name (chan->device->dev), devname) ==0 ) && (chan->chan_id == dma_data->dma_res->start)) { found = true; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 48/338 MIPS: vpe-mt: fix possible memory leak while module exiting
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 5822e8cc84ee37338ab0bdc3124f6eec04dc232d ]
Afer commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically, it need be freed when module exiting, call put_device() to give up reference, so that it can be freed in kobject_cleanup() when the refcount hit to 0. The vpe_device is static, so remove kfree() from vpe_device_release().
--- arch/mips/kernel/vpe-mt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/vpe-mt.c +2 -2
@@ -313,7 +313,6 @@ ATTRIBUTE_GROUPS(vpe);static void vpe_device_release (struct device *cd) { -kfree (cd); }static struct class vpe_class = {
@@ -497,6 +496,7 @@ int __init vpe_module_init(void)device_del (&vpe_device); out_class: +put_device (&vpe_device);class_unregister (&vpe_class); out_chrdev:
@@ -509,7 +509,7 @@ void __exit vpe_module_exit(void) {struct vpe *v, *n; -device_del (&vpe_device); +device_unregister (&vpe_device);class_unregister (&vpe_class);unregister_chrdev (major,VPE_MODULE_NAME );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 75/338 regulator: core: fix unbalanced of node refcount in regulator_dev_lookup()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit f2b41b748c19962b82709d9f23c6b2b0ce9d2f91 ]
I got the the following report:
OF: ERROR: memory leak, expected refcount 1 instead of 2, of_node_get()/of_node_put() unbalanced - destroy cset entry:
attach overlay node /i2c/pmic@62/regulators/exten
In of_get_regulator(), the node is returned from of_parse_phandle() with refcount incremented, after using it, of_node_put() need be called.
--- drivers/regulator/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/regulator/core.c +1 -0
@@ -1478,6 +1478,7 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev, node =of_get_regulator (dev, supply);if (node) { r =of_find_regulator_by_node (node); +of_node_put (node);if (r)return r;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 49/338 MIPS: vpe-cmp: fix possible memory leak while module exiting
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit c5ed1fe0801f0c66b0fbce2785239a5664629057 ]
dev_set_name() allocates memory for name, it need be freed when module exiting, call put_device() to give up reference, so that it can be freed in kobject_cleanup() when the refcount hit to 0. The vpe_device is static, so remove kfree() from vpe_device_release().
--- arch/mips/kernel/vpe-cmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/vpe-cmp.c +2 -2
@@ -75,7 +75,6 @@ ATTRIBUTE_GROUPS(vpe);static void vpe_device_release (struct device *cd) { -kfree (cd); }static struct class vpe_class = {
@@ -157,6 +156,7 @@ int __init vpe_module_init(void)device_del (&vpe_device); out_class: +put_device (&vpe_device);class_unregister (&vpe_class); out_chrdev:
@@ -169,7 +169,7 @@ void __exit vpe_module_exit(void) {struct vpe *v, *n; -device_del (&vpe_device); +device_unregister (&vpe_device);class_unregister (&vpe_class);unregister_chrdev (major,VPE_MODULE_NAME );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 50/338 PNP: fix name memory leak in pnp_alloc_dev()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 110d7b0325c55ff3620073ba4201845f59e22ebf ]
After commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically, move dev_set_name() after pnp_add_id() to avoid memory leak.
--- drivers/pnp/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pnp/core.c +2 -2
@@ -160,14 +160,14 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, dev->dev.coherent_dma_mask = dev->dma_mask; dev->dev.release = &pnp_release_device; -dev_set_name (&dev->dev,"%02x:%02x" , dev->protocol->number, dev->number); - dev_id =pnp_add_id (dev, pnpid);if (!dev_id) {kfree (dev);return NULL ; } +dev_set_name (&dev->dev,"%02x:%02x" , dev->protocol->number, dev->number); +return dev; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 51/338 irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()
In reply to Greg Kroah-HartmanFrom: Shang XiaoJing <[email protected]>
[ Upstream commit f9ee20c85b3a3ba0afd3672630ec4f93d339f015 ]
gic_probe() calls pm_runtime_get_sync() and added fail path as rpm_put to put usage_counter. However, pm_runtime_get_sync() will increment usage_counter even it failed. Fix it by replacing it with pm_runtime_resume_and_get() to keep usage counter balanced.
--- drivers/irqchip/irq-gic-pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-pm.c +1 -1
@@ -112,7 +112,7 @@ static int gic_probe(struct platform_device *pdev)pm_runtime_enable (dev); - ret =pm_runtime_get_sync (dev); + ret =pm_runtime_resume_and_get (dev);if (ret <0 ) goto rpm_disable;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 52/338 libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
In reply to Greg Kroah-HartmanFrom: Akinobu Mita <[email protected]>
[ Upstream commit 2e41f274f9aa71cdcc69dc1f26a3f9304a651804 ]
Patch series "fix error when writing negative value to simple attribute files".
The simple attribute files do not accept a negative value since the commit 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()"), but some attribute files want to accept a negative value.
This patch (of 3):
The simple attribute files do not accept a negative value since the commit 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()"), so we have to use a 64-bit value to write a negative value.
This adds DEFINE_SIMPLE_ATTRIBUTE_SIGNED for a signed value.
--- fs/libfs.c | 22 +++++++++++++++++++--- include/linux/fs.h | 12 ++++++++++-- 2 files changed, 29 insertions(+), 5 deletions(-)
fs/libfs.c +19 -3
@@ -864,8 +864,8 @@ ssize_t simple_attr_read(struct file *file, char __user *buf,EXPORT_SYMBOL_GPL (simple_attr_read);/* interpret the buffer as a number to call the set function with */ -ssize_t simple_attr_write (struct file *file,const char __user *buf, -size_t len,loff_t *ppos) +static ssize_t simple_attr_write_xsigned (struct file *file,const char __user *buf, +size_t len,loff_t *ppos,bool is_signed) {struct simple_attr *attr;unsigned long long val;
@@ -886,7 +886,10 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf, goto out; attr->set_buf[size] ='\0' ; - ret =kstrtoull (attr->set_buf,0 , &val); +if (is_signed) + ret =kstrtoll (attr->set_buf,0 , &val); +else + ret =kstrtoull (attr->set_buf,0 , &val);if (ret) goto out; ret = attr->set (attr->data, val);
@@ -896,8 +899,21 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,mutex_unlock (&attr->mutex);return ret; } + +ssize_t simple_attr_write (struct file *file,const char __user *buf, +size_t len,loff_t *ppos) +{ +return simple_attr_write_xsigned (file, buf, len, ppos, false); +}EXPORT_SYMBOL_GPL (simple_attr_write); +ssize_t simple_attr_write_signed (struct file *file,const char __user *buf, +size_t len,loff_t *ppos) +{ +return simple_attr_write_xsigned (file, buf, len, ppos, true); +} +EXPORT_SYMBOL_GPL (simple_attr_write_signed); +/** * generic_fh_to_dentry - generic helper for the fh_to_dentry export operation * @sb: filesystem to do the file handle conversion on
include/linux/fs.h +10 -2
@@ -3280,7 +3280,7 @@ void simple_transaction_set(struct file *file, size_t n);* All attributes contain a text representation of a numeric value * that are accessed with the get() and set() functions. */ -#define DEFINE_SIMPLE_ATTRIBUTE (__fops, __get, __set, __fmt) \ +#define DEFINE_SIMPLE_ATTRIBUTE_XSIGNED (__fops, __get, __set, __fmt, __is_signed) \ static int __fops ## _open(struct inode *inode, struct file *file) \ { \ __simple_attr_check_format(__fmt, 0ull); \
@@ -3291,10 +3291,16 @@ static const struct file_operations __fops = { \ .open = __fops ## _open, \ .release = simple_attr_release, \ .read = simple_attr_read, \ - .write = simple_attr_write, \ + .write = (__is_signed) ? simple_attr_write_signed : simple_attr_write, \ .llseek = generic_file_llseek, \ } +#define DEFINE_SIMPLE_ATTRIBUTE (__fops, __get, __set, __fmt) \ + DEFINE_SIMPLE_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, false) + +#define DEFINE_SIMPLE_ATTRIBUTE_SIGNED (__fops, __get, __set, __fmt) \ + DEFINE_SIMPLE_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, true) + static inline __printf(1, 2) void __simple_attr_check_format(const char *fmt, ...) {
@@ -3309,6 +3315,8 @@ ssize_t simple_attr_read(struct file *file, char __user *buf, size_t len, loff_t *ppos);ssize_t simple_attr_write (struct file *file,const char __user *buf,size_t len,loff_t *ppos); +ssize_t simple_attr_write_signed (struct file *file,const char __user *buf, +size_t len,loff_t *ppos);struct ctl_table ; int proc_nr_files(struct ctl_table *table, int write,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 53/338 lib/notifier-error-inject: fix error when writing -errno to debugfs file
In reply to Greg Kroah-HartmanFrom: Akinobu Mita <[email protected]>
[ Upstream commit f883c3edd2c432a2931ec8773c70a570115a50fe ]
The simple attribute files do not accept a negative value since the commit 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()").
This restores the previous behaviour by using newly introduced DEFINE_SIMPLE_ATTRIBUTE_SIGNED instead of DEFINE_SIMPLE_ATTRIBUTE.
--- lib/notifier-error-inject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/notifier-error-inject.c +1 -1
@@ -14,7 +14,7 @@ static int debugfs_errno_get(void *data, u64 *val)return 0 ; } -DEFINE_SIMPLE_ATTRIBUTE (fops_errno, debugfs_errno_get, debugfs_errno_set, +DEFINE_SIMPLE_ATTRIBUTE_SIGNED (fops_errno, debugfs_errno_get, debugfs_errno_set,"%lld\n" ); static struct dentry *debugfs_create_errno(const char *name, umode_t mode,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 54/338 rapidio: fix possible name leaks when rio_add_device() fails
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit f9574cd48679926e2a569e1957a5a1bcc8a719ac ]
Patch series "rapidio: fix three possible memory leaks".
This patchset fixes three name leaks in error handling.
- patch #1 fixes two name leaks while rio_add_device() fails.
- patch #2 fixes a name leak while rio_register_mport() fails.
This patch (of 2):
If rio_add_device() returns error, the name allocated by dev_set_name() need be freed. It should use put_device() to give up the reference in the error path, so that the name can be freed in kobject_cleanup(), and the 'rdev' can be freed in rio_release_dev().
--- drivers/rapidio/devices/rio_mport_cdev.c | 7 +++++-- drivers/rapidio/rio-scan.c | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/rapidio/devices/rio_mport_cdev.c +5 -2
@@ -1863,8 +1863,11 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,rio_init_dbell_res (&rdev->riores[RIO_DOORBELL_RESOURCE ],0 ,0xffff ); err =rio_add_device (rdev); -if (err) - goto cleanup; +if (err) { +put_device (&rdev->dev); +return err; + } +rio_dev_get (rdev);return 0 ;
drivers/rapidio/rio-scan.c +6 -2
@@ -460,8 +460,12 @@ static struct rio_dev *rio_setup_device(struct rio_net *net, 0, 0xffff); ret =rio_add_device (rdev); -if (ret) - goto cleanup; +if (ret) { +if (rswitch) +kfree (rswitch->route_table); +put_device (&rdev->dev); +return NULL ; + }rio_dev_get (rdev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 45/338 perf: Fix possible memleak in pmu_dev_alloc()
In reply to Greg Kroah-HartmanFrom: Chen Zhongjin <[email protected]>
[ Upstream commit e8d7a90c08ce963c592fb49845f2ccc606a2ac21 ]
In pmu_dev_alloc(), when dev_set_name() failed, it will goto free_dev and call put_device(pmu->dev) to release it.
However pmu->dev->release is assigned after this, which makes warning and memleak.
Call dev_set_name() after pmu->dev->release = pmu_dev_release to fix it.
Device '(null)' does not have a release() function...
WARNING: CPU: 2 PID: 441 at drivers/base/core.c:2332 device_release+0x1b9/0x240
...
Call Trace:
<TASK>
kobject_put+0x17f/0x460
put_device+0x20/0x30
pmu_dev_alloc+0x152/0x400
perf_pmu_register+0x96b/0xee0
...
kmemleak: 1 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
unreferenced object 0xffff888014759000 (size 2048):
comm "modprobe", pid 441, jiffies 4294931444 (age 38.332s)
backtrace:
[<0000000005aed3b4>] kmalloc_trace+0x27/0x110
[<000000006b38f9b8>] pmu_dev_alloc+0x50/0x400
[<00000000735f17be>] perf_pmu_register+0x96b/0xee0
[<00000000e38477f1>] 0xffffffffc0ad8603
[<000000004e162216>] do_one_initcall+0xd0/0x4e0
...--- kernel/events/core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
kernel/events/core.c +5 -3
@@ -9180,13 +9180,15 @@ static int pmu_dev_alloc(struct pmu *pmu) pmu->dev->groups = pmu->attr_groups;device_initialize (pmu->dev); - ret =dev_set_name (pmu->dev,"%s" , pmu->name); -if (ret) - goto free_dev;dev_set_drvdata (pmu->dev, pmu); pmu->dev->bus = &pmu_bus; pmu->dev->release = pmu_dev_release; + + ret =dev_set_name (pmu->dev,"%s" , pmu->name); +if (ret) + goto free_dev; + ret =device_add (pmu->dev);if (ret) goto free_dev;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 77/338 wifi: ath10k: Fix return value in ath10k_pci_init()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit 2af7749047d8d6ad43feff69f555a13a6a6c2831 ]
This driver is attempting to register to support two different buses. if either of these is successful then ath10k_pci_init() should return 0 so that hardware attached to the successful bus can be probed and supported. only if both of these are unsuccessful should ath10k_pci_init() return an errno.
--- drivers/net/wireless/ath/ath10k/pci.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +12 -8
@@ -3443,18 +3443,22 @@ static struct pci_driver ath10k_pci_driver = {static int __init ath10k_pci_init (void ) { -int ret; +int ret1, ret2; - ret =pci_register_driver (&ath10k_pci_driver); -if (ret) + ret1 =pci_register_driver (&ath10k_pci_driver); +if (ret1)printk (KERN_ERR "failed to register ath10k pci driver: %d\n" , - ret); + ret1); - ret =ath10k_ahb_init (); -if (ret) -printk (KERN_ERR "ahb init failed: %d\n" , ret); + ret2 =ath10k_ahb_init (); +if (ret2) +printk (KERN_ERR "ahb init failed: %d\n" , ret2); -return ret; +if (ret1 && ret2) +return ret1; + +/* registered to at least one bus */ +return 0 ; }module_init (ath10k_pci_init);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 86/338 media: imon: fix a race condition in send_packet()
In reply to Greg Kroah-HartmanFrom: Gautam Menghani <[email protected]>
[ Upstream commit 813ceef062b53d68f296aa3cb944b21a091fabdb ]
The function send_packet() has a race condition as follows:
func send_packet()
{
// do work
call usb_submit_urb()
mutex_unlock()
wait_for_event_interruptible() <-- lock gone
mutex_lock()
}
func vfd_write()
{
mutex_lock()
call send_packet() <- prev call is not completed mutex_unlock()
}
When the mutex is unlocked and the function send_packet() waits for the call to complete, vfd_write() can start another call, which leads to the "URB submitted while active" warning in usb_submit_urb(). Fix this by removing the mutex_unlock() call in send_packet() and using mutex_lock_interruptible().
--- drivers/media/rc/imon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/rc/imon.c +3 -3
@@ -637,15 +637,14 @@ static int send_packet(struct imon_context *ictx)pr_err_ratelimited ("error submitting urb(%d)\n" , retval); }else {/* Wait for transmission to complete (or abort) */ -mutex_unlock (&ictx->lock); retval =wait_for_completion_interruptible ( &ictx->tx.finished);if (retval) {usb_kill_urb (ictx->tx_urb);pr_err_ratelimited ("task interrupted\n" ); } -mutex_lock (&ictx->lock); + ictx->tx.busy = false; retval = ictx->tx.status;if (retval)pr_err_ratelimited ("packet tx failed (%d)\n" , retval);
@@ -952,7 +951,8 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,return -ENODEV ; } -mutex_lock (&ictx->lock); +if (mutex_lock_interruptible (&ictx->lock)) +return -ERESTARTSYS ;if (!ictx->dev_present_intf0) {pr_err_ratelimited ("no iMON device present\n" );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 87/338 pinctrl: pinconf-generic: add missing of_node_put()
In reply to Greg Kroah-HartmanFrom: ZhangPeng <[email protected]>
[ Upstream commit 5ead93289815a075d43c415e35c8beafafb801c9 ]
of_node_put() needs to be called when jumping out of the loop, since for_each_available_child_of_node() will increase the refcount of node.
--- drivers/pinctrl/pinconf-generic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pinctrl/pinconf-generic.c +3 -1
@@ -388,8 +388,10 @@ int pinconf_generic_dt_node_to_map(struct pinctrl_dev *pctldev,for_each_available_child_of_node (np_config, np) { ret =pinconf_generic_dt_subnode_to_map (pctldev, np, map, &reserved_maps, num_maps, type); -if (ret <0 ) +if (ret <0 ) { +of_node_put (np); goto exit; + } }return 0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 88/338 media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()
In reply to Greg Kroah-HartmanFrom: Baisong Zhong <[email protected]>
[ Upstream commit 0ed554fd769a19ea8464bb83e9ac201002ef74ad ]
Wei Chen reports a kernel bug as blew:
general protection fault, probably for non-canonical address KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] ... Call Trace: <TASK> __i2c_transfer+0x77e/0x1930 drivers/i2c/i2c-core-base.c:2109 i2c_transfer+0x1d5/0x3d0 drivers/i2c/i2c-core-base.c:2170 i2cdev_ioctl_rdwr+0x393/0x660 drivers/i2c/i2c-dev.c:297 i2cdev_ioctl+0x75d/0x9f0 drivers/i2c/i2c-dev.c:458 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd834a8bded
In az6027_i2c_xfer(), if msg[i].addr is 0x99, a null-ptr-deref will caused when accessing msg[i].buf. For msg[i].len is 0 and msg[i].buf is null.
Fix this by checking msg[i].len in az6027_i2c_xfer().
--- drivers/media/usb/dvb-usb/az6027.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/media/usb/dvb-usb/az6027.c +4 -0
@@ -978,6 +978,10 @@ static int az6027_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int nif (msg[i].addr ==0x99 ) { req =0xBE ; index =0 ; +if (msg[i].len <1 ) { + i = -EOPNOTSUPP ; +break ; + } value = msg[i].buf[0 ] &0x00ff ; length =1 ;az6027_usb_out_op (d, req, value, index, data, length);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 89/338 media: s5p-mfc: Add variant data for MFC v7 hardware for Exynos 3250 SoC
In reply to Greg Kroah-HartmanFrom: Aakarsh Jain <[email protected]>
[ Upstream commit f50ebe10f5d8092c37e2bd430c78e03bf38b1e20 ]
Commit 5441e9dafdfc6dc40 ("[media] s5p-mfc: Core support for MFC v7") which adds mfc v7 support for Exynos3250 and use the same compatible string as used by Exynos5240 but both the IPs are a bit different in terms of IP clock.
Add variant driver data based on the new compatible string "samsung,exynos3250-mfc" for Exynos3250 SoC.
--- drivers/media/platform/s5p-mfc/s5p_mfc.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/media/platform/s5p-mfc/s5p_mfc.c +15 -2
@@ -1582,8 +1582,18 @@ static struct s5p_mfc_variant mfc_drvdata_v7 = { .port_num = MFC_NUM_PORTS_V7, .buf_size = &buf_size_v7, .fw_name[0] = "s5p-mfc-v7.fw", - .clk_names = {"mfc", "sclk_mfc"}, - .num_clocks = 2, + .clk_names = {"mfc"}, + .num_clocks = 1, +}; + +static struct s5p_mfc_variant mfc_drvdata_v7_3250 = { + .version =MFC_VERSION_V7 , + .version_bit =MFC_V7_BIT , + .port_num =MFC_NUM_PORTS_V7 , + .buf_size = &buf_size_v7, + .fw_name[0 ] ="s5p-mfc-v7.fw" , + .clk_names = {"mfc" ,"sclk_mfc" }, + .num_clocks =2 , }; static struct s5p_mfc_buf_size_v6 mfc_buf_size_v8 = {
@@ -1630,6 +1640,9 @@ static const struct of_device_id exynos_mfc_match[] = { }, { .compatible = "samsung,mfc-v7", .data = &mfc_drvdata_v7, + }, { + .compatible = "samsung,exynos3250-mfc", + .data = &mfc_drvdata_v7_3250, }, { .compatible = "samsung,mfc-v8", .data = &mfc_drvdata_v8,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 90/338 NFSv4.2: Fix a memory stomp in decode_attr_security_label
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
[ Upstream commit 43c1031f7110967c240cb6e922adcfc4b8899183 ]
We must not change the value of label->len if it is zero, since that indicates we stored a label.
--- fs/nfs/nfs4xdr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
fs/nfs/nfs4xdr.c +4 -6
@@ -4255,12 +4255,10 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,if (unlikely (!p)) goto out_overflow;if (len <NFS4_MAXLABELLEN ) { -if (label) { -if (label->len) { -if (label->len < len) -return -ERANGE ; -memcpy (label->label, p, len); - } +if (label && label->len) { +if (label->len < len) +return -ERANGE ; +memcpy (label->label, p, len); label->len = len; label->pi = pi; label->lfs = lfs;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 91/338 NFSv4: Fix a deadlock between nfs4_open_recover_helper() and delegreturn
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
[ Upstream commit 51069e4aef6257b0454057359faed0ab0c9af083 ]
If we're asked to recover open state while a delegation return is outstanding, then the state manager thread cannot use a cached open, so if the server returns a delegation, we can end up deadlocked behind the pending delegreturn.
To avoid this problem, let's just ask the server not to give us a delegation unless we're explicitly reclaiming one.
--- fs/nfs/nfs4proc.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
fs/nfs/nfs4proc.c +12 -7
@@ -1832,18 +1832,18 @@ static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context }static int nfs4_open_recover_helper (struct nfs4_opendata *opendata, -fmode_t fmode) +fmode_t fmode) {struct nfs4_state *newstate; +struct nfs_server *server =NFS_SB (opendata->dentry->d_sb); +int openflags = opendata->o_arg.open_flags;int ret;if (!nfs4_mode_match_open_stateid (opendata->state, fmode))return 0 ; - opendata->o_arg.open_flags =0 ; opendata->o_arg.fmode = fmode; - opendata->o_arg.share_access =nfs4_map_atomic_open_share ( -NFS_SB (opendata->dentry->d_sb), - fmode,0 ); + opendata->o_arg.share_access = +nfs4_map_atomic_open_share (server, fmode, openflags);memset (&opendata->o_res,0 ,sizeof (opendata->o_res));memset (&opendata->c_res,0 ,sizeof (opendata->c_res));nfs4_init_opendata_res (opendata);
@@ -2418,10 +2418,15 @@ static int _nfs4_open_expired(struct nfs_open_context *ctx, struct nfs4_state *sstruct nfs4_opendata *opendata;int ret; - opendata =nfs4_open_recoverdata_alloc (ctx, state, -NFS4_OPEN_CLAIM_FH ); + opendata =nfs4_open_recoverdata_alloc (ctx, state,NFS4_OPEN_CLAIM_FH );if (IS_ERR (opendata))return PTR_ERR (opendata); +/* +* We're not recovering a delegation, so ask for no delegation. +* Otherwise the recovery thread could deadlock with an outstanding +* delegation return. +*/ + opendata->o_arg.open_flags =O_DIRECT ; ret =nfs4_open_recover (opendata, state);if (ret == -ESTALE )d_drop (ctx->dentry);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 92/338 ALSA: asihpi: fix missing pci_disable_device()
In reply to Greg Kroah-HartmanFrom: Liu Shixin <[email protected]>
[ Upstream commit 9d86515c3d4c0564a0c31a2df87d735353a1971e ]
pci_disable_device() need be called while module exiting, switch to use pcim_enable(), pci_disable_device() will be called in pcim_release().
--- sound/pci/asihpi/hpioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/asihpi/hpioctl.c +1 -1
@@ -359,7 +359,7 @@ int asihpi_adapter_probe(struct pci_dev *pci_dev, pci_dev->device, pci_dev->subsystem_vendor, pci_dev->subsystem_device, pci_dev->devfn); -if (pci_enable_device (pci_dev) <0 ) { +if (pcim_enable_device (pci_dev) <0 ) {dev_err (&pci_dev->dev,"pci_enable_device failed, disabling device\n" );return -EIO ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 93/338 drm/radeon: Fix PCI device refcount leak in radeon_atrm_get_bios()
In reply to Greg Kroah-HartmanFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit 725a521a18734f65de05b8d353b5bd0d3ca4c37a ]
As comment of pci_get_class() says, it returns a pci_device with its refcount increased and decreased the refcount for the input parameter @from if it is not NULL.
If we break the loop in radeon_atrm_get_bios() with 'pdev' not NULL, we need to call pci_dev_put() to decrease the refcount. Add the missing pci_dev_put() to avoid refcount leak.
--- drivers/gpu/drm/radeon/radeon_bios.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/radeon/radeon_bios.c +1 -0
@@ -215,6 +215,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)if (!found)return false; +pci_dev_put (pdev); rdev->bios =kmalloc (size,GFP_KERNEL );if (!rdev->bios) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 94/338 drm/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()
In reply to Greg Kroah-HartmanFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit ca54639c7752edf1304d92ff4d0c049d4efc9ba0 ]
As comment of pci_get_class() says, it returns a pci_device with its refcount increased and decreased the refcount for the input parameter @from if it is not NULL.
If we break the loop in amdgpu_atrm_get_bios() with 'pdev' not NULL, we need to call pci_dev_put() to decrease the refcount. Add the missing pci_dev_put() to avoid refcount leak.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c +1 -0
@@ -307,6 +307,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)if (!found)return false; +pci_dev_put (pdev); adev->bios =kmalloc (size,GFP_KERNEL );if (!adev->bios) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 95/338 ASoC: pcm512x: Fix PM disable depth imbalance in pcm512x_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 97b801be6f8e53676b9f2b105f54e35c745c1b22 ]
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by going to err_pm instead of err_clk.
--- sound/soc/codecs/pcm512x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/codecs/pcm512x.c +4 -4
@@ -1472,7 +1472,7 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)if (val >6 ) {dev_err (dev,"Invalid pll-in\n" ); ret = -EINVAL ; - goto err_clk; + goto err_pm; } pcm512x->pll_in = val; }
@@ -1481,7 +1481,7 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)if (val >6 ) {dev_err (dev,"Invalid pll-out\n" ); ret = -EINVAL ; - goto err_clk; + goto err_pm; } pcm512x->pll_out = val; }
@@ -1490,12 +1490,12 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)dev_err (dev,"Error: both pll-in and pll-out, or none\n" ); ret = -EINVAL ; - goto err_clk; + goto err_pm; }if (pcm512x->pll_in && pcm512x->pll_in == pcm512x->pll_out) {dev_err (dev,"Error: pll-in == pll-out\n" ); ret = -EINVAL ; - goto err_clk; + goto err_pm; } }#endif
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 78/338 mtd: lpddr2_nvm: Fix possible null-ptr-deref
In reply to Greg Kroah-HartmanFrom: Hui Tang <[email protected]>
[ Upstream commit 6bdd45d795adf9e73b38ced5e7f750cd199499ff ]
It will cause null-ptr-deref when resource_size(add_range) invoked, if platform_get_resource() returns NULL.
--- drivers/mtd/lpddr/lpddr2_nvm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mtd/lpddr/lpddr2_nvm.c +2 -0
@@ -448,6 +448,8 @@ static int lpddr2_nvm_probe(struct platform_device *pdev)/* lpddr2_nvm address range */ add_range =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!add_range) +return -ENODEV ;/* Populate map_info data structure */ *map = (struct map_info ) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 96/338 bonding: uninitialized variable in bond_miimon_inspect()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit e5214f363dabca240446272dac54d404501ad5e5 ]
The "ignore_updelay" variable needs to be initialized to false.
--- drivers/net/bonding/bond_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bonding/bond_main.c +1 -1
@@ -2076,10 +2076,10 @@ static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *in/* called with rcu_read_lock() */ static int bond_miimon_inspect (struct bonding *bond) { +bool ignore_updelay = false;int link_state, commit =0 ;struct list_head *iter;struct slave *slave; -bool ignore_updelay; ignore_updelay = !rcu_dereference (bond->curr_active_slave);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 97/338 wifi: mac80211: fix memory leak in ieee80211_if_add()
In reply to Greg Kroah-HartmanFrom: Zhengchao Shao <[email protected]>
[ Upstream commit 13e5afd3d773c6fc6ca2b89027befaaaa1ea7293 ]
When register_netdevice() failed in ieee80211_if_add(), ndev->tstats isn't released. Fix it.
--- net/mac80211/iface.c | 1 + 1 file changed, 1 insertion(+)
net/mac80211/iface.c +1 -0
@@ -1902,6 +1902,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, ret =register_netdevice (ndev);if (ret) { +ieee80211_if_free (ndev);free_netdev (ndev);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 98/338 regulator: core: fix module refcount leak in set_supply()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit da46ee19cbd8344d6860816b4827a7ce95764867 ]
If create_regulator() fails in set_supply(), the module refcount needs be put to keep refcount balanced.
--- drivers/regulator/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/regulator/core.c +1 -0
@@ -1164,6 +1164,7 @@ static int set_supply(struct regulator_dev *rdev, rdev->supply =create_regulator (supply_rdev, &rdev->dev,"SUPPLY" );if (rdev->supply ==NULL ) { +module_put (supply_rdev->owner); err = -ENOMEM ;return err; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 99/338 media: saa7164: fix missing pci_disable_device()
In reply to Greg Kroah-HartmanFrom: Liu Shixin <[email protected]>
[ Upstream commit 57fb35d7542384cac8f198cd1c927540ad38b61a ]
Add missing pci_disable_device() in the error path in saa7164_initdev().
--- drivers/media/pci/saa7164/saa7164-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/pci/saa7164/saa7164-core.c +3 -1
@@ -1240,7 +1240,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev,if (saa7164_dev_setup (dev) <0 ) { err = -EINVAL ; - goto fail_free; + goto fail_dev; }/* print pci info */
@@ -1408,6 +1408,8 @@ static int saa7164_initdev(struct pci_dev *pci_dev, fail_irq:saa7164_dev_unregister (dev); +fail_dev: +pci_disable_device (pci_dev); fail_free:v4l2_device_unregister (&dev->v4l2_dev);kfree (dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 100/338 ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
[ Upstream commit cf2ea3c86ad90d63d1c572b43e1ca9276b0357ad ]
I got a null-ptr-defer error report when I do the following tests on the qemu platform:
make defconfig and CONFIG_PARPORT=m, CONFIG_PARPORT_PC=m, CONFIG_SND_MTS64=m
Then making test scripts:
cat>test_mod1.sh<<EOF
modprobe snd-mts64
modprobe snd-mts64
EOF
Executing the script, perhaps several times, we will get a null-ptr-defer report, as follow:
syzkaller:~# ./test_mod.sh snd_mts64: probe of snd_mts64.0 failed with error -5 modprobe: ERROR: could not insert 'snd_mts64': No such device BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP PTI CPU: 0 PID: 205 Comm: modprobe Not tainted 6.1.0-rc8-00588-g76dcd734eca2 #6 Call Trace: <IRQ> snd_mts64_interrupt+0x24/0xa0 [snd_mts64] parport_irq_handler+0x37/0x50 [parport] __handle_irq_event_percpu+0x39/0x190 handle_irq_event_percpu+0xa/0x30 handle_irq_event+0x2f/0x50 handle_edge_irq+0x99/0x1b0 __common_interrupt+0x5d/0x100 common_interrupt+0xa0/0xc0 </IRQ> <TASK> asm_common_interrupt+0x22/0x40 RIP: 0010:_raw_write_unlock_irqrestore+0x11/0x30 parport_claim+0xbd/0x230 [parport] snd_mts64_probe+0x14a/0x465 [snd_mts64] platform_probe+0x3f/0xa0 really_probe+0x129/0x2c0 __driver_probe_device+0x6d/0xc0 driver_probe_device+0x1a/0xa0 __device_attach_driver+0x7a/0xb0 bus_for_each_drv+0x62/0xb0 __device_attach+0xe4/0x180 bus_probe_device+0x82/0xa0 device_add+0x550/0x920 platform_device_add+0x106/0x220 snd_mts64_attach+0x2e/0x80 [snd_mts64] port_check+0x14/0x20 [parport] bus_for_each_dev+0x6e/0xc0 __parport_register_driver+0x7c/0xb0 [parport] snd_mts64_module_init+0x31/0x1000 [snd_mts64] do_one_initcall+0x3c/0x1f0 do_init_module+0x46/0x1c6 load_module+0x1d8d/0x1e10 __do_sys_finit_module+0xa2/0xf0 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK> Kernel panic - not syncing: Fatal exception in interrupt Rebooting in 1 seconds..
The mts wa not initialized during interrupt, we add check for mts to fix this bug.
--- sound/drivers/mts64.c | 3 +++ 1 file changed, 3 insertions(+)
sound/drivers/mts64.c +3 -0
@@ -830,6 +830,9 @@ static void snd_mts64_interrupt(void *private)u8 status, data;struct snd_rawmidi_substream *substream; +if (!mts) +return ; +spin_lock (&mts->lock); ret =mts64_read (mts->pardev->port); data = ret &0x00ff ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 101/338 SUNRPC: Fix missing release socket in rpc_sockname()
In reply to Greg Kroah-HartmanFrom: Wang ShaoBo <[email protected]>
[ Upstream commit 50fa355bc0d75911fe9d5072a5ba52cdb803aff7 ]
socket dynamically created is not released when getting an unintended address family type in rpc_sockname(), direct to out_release for calling sock_release().
--- net/sunrpc/clnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/clnt.c +1 -1
@@ -1267,7 +1267,7 @@ static int rpc_sockname(struct net *net, struct sockaddr *sap, size_t salen,break ;default : err = -EAFNOSUPPORT ; - goto out; + goto out_release; }if (err <0 ) {dprintk ("RPC: can't bind UDP socket (%d)\n" , err);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 102/338 NFSv4.x: Fail client initialisation if state manager thread cant run
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
[ Upstream commit b4e4f66901658fae0614dea5bf91062a5387eda7 ]
If the state manager thread fails to start, then we should just mark the client initialisation as failed so that other processes or threads don't get stuck in nfs_wait_client_init_complete().
--- fs/nfs/nfs4state.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/nfs4state.c +2 -0
@@ -1209,6 +1209,8 @@ void nfs4_schedule_state_manager(struct nfs_client *clp)if (IS_ERR (task)) {printk (KERN_ERR "%s: kthread_run: %ld\n" , __func__,PTR_ERR (task)); +if (!nfs_client_init_is_complete (clp)) +nfs_mark_client_ready (clp,PTR_ERR (task));nfs4_clear_state_manager_bit (clp);nfs_put_client (clp);module_put (THIS_MODULE );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 103/338 mmc: moxart: fix return value check of mmc_add_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 0ca18d09c744fb030ae9bc5836c3e357e0237dea ]
mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path.
So fix this by checking the return value and goto error path which will call mmc_free_host().
--- drivers/mmc/host/moxart-mmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/moxart-mmc.c +3 -1
@@ -660,7 +660,9 @@ static int moxart_probe(struct platform_device *pdev) goto out;dev_set_drvdata (dev, mmc); -mmc_add_host (mmc); + ret =mmc_add_host (mmc); +if (ret) + goto out;dev_dbg (dev,"IRQ=%d, FIFO is %d bytes\n" , irq, host->fifo_width);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 104/338 mmc: mxcmmc: fix return value check of mmc_add_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit cde600af7b413c9fe03e85c58c4279df90e91d13 ]
mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path.
So fix this by checking the return value and goto error path which will call mmc_free_host().
--- drivers/mmc/host/mxcmmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/mxcmmc.c +3 -1
@@ -1169,7 +1169,9 @@ static int mxcmci_probe(struct platform_device *pdev) host->watchdog.function = &mxcmci_watchdog; host->watchdog.data = (unsigned long )mmc; -mmc_add_host (mmc); + ret =mmc_add_host (mmc); +if (ret) + goto out_free_dma;return 0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 105/338 mmc: rtsx_usb_sdmmc: fix return value check of mmc_add_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit fc38a5a10e9e5a75eb9189854abeb8405b214cc9 ]
mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path.
So fix this by checking the return value and calling mmc_free_host() in the error path, besides, led_classdev_unregister() and pm_runtime_disable() also need be called.
--- drivers/mmc/host/rtsx_usb_sdmmc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/mmc/host/rtsx_usb_sdmmc.c +10 -1
@@ -1355,6 +1355,7 @@ static int rtsx_usb_sdmmc_drv_probe(struct platform_device *pdev)#ifdef RTSX_USB_USE_LEDS_CLASS int err;#endif +int ret; ucr =usb_get_intfdata (to_usb_interface (pdev->dev.parent));if (!ucr)
@@ -1393,7 +1394,15 @@ static int rtsx_usb_sdmmc_drv_probe(struct platform_device *pdev)INIT_WORK (&host->led_work, rtsx_usb_update_led);#endif -mmc_add_host (mmc); + ret =mmc_add_host (mmc); +if (ret) { +#ifdef RTSX_USB_USE_LEDS_CLASS +led_classdev_unregister (&host->led); +#endif +mmc_free_host (mmc); +pm_runtime_disable (&pdev->dev); +return ret; + }return 0 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 79/338 Input: elants_i2c - properly handle the reset GPIO when power is off
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit a85fbd6498441694475716a4d5c65f9d3e073faf ]
As can be seen in elants_i2c_power_off(), we want the reset GPIO asserted when power is off. The reset GPIO is active low so we need the reset line logic low when power is off to avoid leakage.
We have a problem, though, at probe time. At probe time we haven't powered the regulators on yet but we have:
devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_LOW);
While that _looks_ right, it turns out that it's not. The GPIOD_OUT_LOW doesn't mean to init the GPIO to low. It means init the GPIO to "not asserted". Since this is an active low GPIO that inits it to be high.
Let's fix this to properly init the GPIO. Now after both probe and power off the state of the GPIO is consistent (it's "asserted" or level low).
Once we fix this, we can see that at power on time we no longer to assert the reset GPIO as the first thing. The reset GPIO is _always_ asserted before powering on. Let's fix powering on to account for this.
--- drivers/input/touchscreen/elants_i2c.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/input/touchscreen/elants_i2c.c +3 -6
@@ -1089,14 +1089,12 @@ static int elants_i2c_power_on(struct elants_data *ts)if (IS_ERR_OR_NULL (ts->reset_gpio))return 0 ; -gpiod_set_value_cansleep (ts->reset_gpio,1 ); - error =regulator_enable (ts->vcc33);if (error) {dev_err (&ts->client->dev,"failed to enable vcc33 regulator: %d\n" , error); - goto release_reset_gpio; +return error; } error =regulator_enable (ts->vccio);
@@ -1105,7 +1103,7 @@ static int elants_i2c_power_on(struct elants_data *ts)"failed to enable vccio regulator: %d\n" , error);regulator_disable (ts->vcc33); - goto release_reset_gpio; +return error; }/*
@@ -1114,7 +1112,6 @@ static int elants_i2c_power_on(struct elants_data *ts)*/ udelay (ELAN_POWERON_DELAY_USEC ); -release_reset_gpio:gpiod_set_value_cansleep (ts->reset_gpio,0 );if (error)return error;
@@ -1222,7 +1219,7 @@ static int elants_i2c_probe(struct i2c_client *client,return error; } - ts->reset_gpio =devm_gpiod_get (&client->dev,"reset" ,GPIOD_OUT_LOW ); + ts->reset_gpio =devm_gpiod_get (&client->dev,"reset" ,GPIOD_OUT_HIGH );if (IS_ERR (ts->reset_gpio)) { error =PTR_ERR (ts->reset_gpio);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 106/338 mmc: toshsd: fix return value check of mmc_add_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit f670744a316ea983113a65313dcd387b5a992444 ]
mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path.
So fix this by checking the return value and goto error path which will call mmc_free_host(), besides, free_irq() also needs be called.
--- drivers/mmc/host/toshsd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/toshsd.c +5 -1
@@ -655,7 +655,9 @@ static int toshsd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret) goto unmap; -mmc_add_host (mmc); + ret =mmc_add_host (mmc); +if (ret) + goto free_irq; base =pci_resource_start (pdev,0 );dev_dbg (&pdev->dev,"MMIO %pa, IRQ %d\n" , &base, pdev->irq);
@@ -664,6 +666,8 @@ static int toshsd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)return 0 ; +free_irq: +free_irq (pdev->irq, host); unmap:pci_iounmap (pdev, host->ioaddr); release:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 107/338 mmc: vub300: fix return value check of mmc_add_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 0613ad2401f88bdeae5594c30afe318e93b14676 ]
mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path.
So fix this by checking the return value and goto error path which will call mmc_free_host(), besides, the timer added before mmc_add_host() needs be del.
And this patch fixes another missing call mmc_free_host() if usb_control_msg() fails.
--- drivers/mmc/host/vub300.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/mmc/host/vub300.c +8 -3
@@ -2309,14 +2309,14 @@ static int vub300_probe(struct usb_interface *interface,0x0000 ,0x0000 , &vub300->system_port_status, sizeof(vub300->system_port_status), 1000);if (retval <0 ) { - goto error4; + goto error5; }else if (sizeof (vub300->system_port_status) == retval) { vub300->card_present = (0x0001 & vub300->system_port_status.port_flags) ?1 :0 ; vub300->read_only = (0x0010 & vub300->system_port_status.port_flags) ?1 :0 ; }else { - goto error4; + goto error5; }usb_set_intfdata (interface, vub300);INIT_DELAYED_WORK (&vub300->pollwork, vub300_pollwork_thread);
@@ -2342,8 +2342,13 @@ static int vub300_probe(struct usb_interface *interface,"USB vub300 remote SDIO host controller[%d]" "connected with no SD/SDIO card inserted\n" , interface_to_InterfaceNumber(interface)); -mmc_add_host (mmc); + retval =mmc_add_host (mmc); +if (retval) + goto error6; +return 0 ; +error6: +del_timer_sync (&vub300->inactivity_timer); error5:mmc_free_host (mmc);/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 108/338 mmc: wmt-sdmmc: fix return value check of mmc_add_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 29276d56f6ed138db0f38cd31aedc0b725c8c76c ]
mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path.
So fix this by checking the return value and goto error path which will call mmc_free_host(), besides, clk_disable_unprepare() also needs be called.
--- drivers/mmc/host/wmt-sdmmc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/wmt-sdmmc.c +5 -1
@@ -863,11 +863,15 @@ static int wmt_mci_probe(struct platform_device *pdev)/* configure the controller to a known 'ready' state */ wmt_reset_hardware (mmc); -mmc_add_host (mmc); + ret =mmc_add_host (mmc); +if (ret) + goto fail7;dev_info (&pdev->dev,"WMT SDHC Controller initialized\n" );return 0 ; +fail7: +clk_disable_unprepare (priv->clk_sdmmc); fail6:clk_put (priv->clk_sdmmc); fail5_and_a_half:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 109/338 mmc: via-sdmmc: fix return value check of mmc_add_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit e4e46fb61e3bb4628170810d3f2b996b709b90d9 ]
mmc_add_host() may return error, if we ignore its return value, it will lead two issues:
1. The memory that allocated in mmc_alloc_host() is leaked.
2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-deref in device_del().
Fix this by checking the return value and goto error path which will call mmc_free_host().
--- drivers/mmc/host/via-sdmmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/via-sdmmc.c +3 -1
@@ -1168,7 +1168,9 @@ static int via_sd_probe(struct pci_dev *pcidev, pcidev->subsystem_device == 0x3891) sdhost->quirks =VIA_CRDR_QUIRK_300MS_PWRDELAY ; -mmc_add_host (mmc); + ret =mmc_add_host (mmc); +if (ret) + goto unmap;return 0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 80/338 media: solo6x10: fix possible memory leak in solo_sysfs_init()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 7f5866dd96d95b74e439f6ee17b8abd8195179fb ]
If device_register() returns error in solo_sysfs_init(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup().
--- drivers/media/pci/solo6x10/solo6x10-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/pci/solo6x10/solo6x10-core.c +1 -0
@@ -428,6 +428,7 @@ static int solo_sysfs_init(struct solo_dev *solo_dev) solo_dev->nr_chans);if (device_register (dev)) { +put_device (dev); dev->parent =NULL ;return -ENOMEM ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 81/338 media: platform: exynos4-is: Fix error handling in fimc_md_init()
In reply to Greg Kroah-HartmanFrom: Yuan Can <[email protected]>
[ Upstream commit b434422c45282a0573d8123239abc41fa72665d4 ]
A problem about modprobe s5p_fimc failed is triggered with the following log given:
[ 272.075275] Error: Driver 'exynos4-fimc' is already registered, aborting... modprobe: ERROR: could not insert 's5p_fimc': Device or resource busy
The reason is that fimc_md_init() returns platform_driver_register() directly without checking its return value, if platform_driver_register() failed, it returns without unregister fimc_driver, resulting the s5p_fimc can never be installed later.
A simple call graph is shown as below:
fimc_md_init()
fimc_register_driver() # register fimc_driver
platform_driver_register()
platform_driver_register()
driver_register()
bus_add_driver()
dev = kzalloc(...) # OOM happened
# return without unregister fimc_driver
Fix by unregister fimc_driver when platform_driver_register() returns error.
--- drivers/media/platform/exynos4-is/fimc-core.c | 2 +- drivers/media/platform/exynos4-is/media-dev.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/media/platform/exynos4-is/fimc-core.c +1 -1
@@ -1255,7 +1255,7 @@ int __init fimc_register_driver(void)return platform_driver_register (&fimc_driver); } -void __exit fimc_unregister_driver(void) +void fimc_unregister_driver (void ) {platform_driver_unregister (&fimc_driver); }
drivers/media/platform/exynos4-is/media-dev.c +5 -1
@@ -1561,7 +1561,11 @@ static int __init fimc_md_init(void)if (ret)return ret; -return platform_driver_register (&fimc_md_driver); + ret =platform_driver_register (&fimc_md_driver); +if (ret) +fimc_unregister_driver (); + +return ret; } static void __exit fimc_md_exit(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 82/338 HID: hid-sensor-custom: set fixed size for custom attributes
In reply to Greg Kroah-HartmanFrom: Marcus Folkesson <[email protected]>
[ Upstream commit 9d013910df22de91333a0acc81d1dbb115bd76f6 ]
This is no bugfix (so no Fixes: tag is necessary) as it is taken care of in hid_sensor_custom_add_attributes().
The motivation for this patch is that:
hid_sensor_custom_field.attr_name and hid_sensor_custom_field.attrs
has the size of HID_CUSTOM_TOTAL_ATTRS and used in same context.
We compare against HID_CUSTOM_TOTAL_ATTRS when
looping through hid_custom_attrs.
We will silent the smatch error:hid_sensor_custom_add_attributes() error: buffer overflow 'hid_custom_attrs' 8 <= 10
--- drivers/hid/hid-sensor-custom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-sensor-custom.c +1 -1
@@ -67,7 +67,7 @@ struct hid_sensor_sample {u32 raw_len; } __packed; -static struct attribute hid_custom_attrs[] = { +static struct attribute hid_custom_attrs[HID_CUSTOM_TOTAL_ATTRS ] = { {.name ="name" , .mode =S_IRUGO }, {.name ="units" , .mode =S_IRUGO }, {.name ="unit-expo" , .mode =S_IRUGO },
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 83/338 ALSA: seq: fix undefined behavior in bit shift for SNDRV_SEQ_FILTER_USE_EVENT
In reply to Greg Kroah-HartmanFrom: Baisong Zhong <[email protected]>
[ Upstream commit cf59e1e4c79bf741905484cdb13c130b53576a16 ]
Shifting signed 32-bit value by 31 bits is undefined, so changing significant bit to unsigned. The UBSAN warning calltrace like below:
UBSAN: shift-out-of-bounds in sound/core/seq/seq_clientmgr.c:509:22 left shift of 1 by 31 places cannot be represented in type 'int' ... Call Trace: <TASK> dump_stack_lvl+0x8d/0xcf ubsan_epilogue+0xa/0x44 __ubsan_handle_shift_out_of_bounds+0x1e7/0x208 snd_seq_deliver_single_event.constprop.21+0x191/0x2f0 snd_seq_deliver_event+0x1a2/0x350 snd_seq_kernel_client_dispatch+0x8b/0xb0 snd_seq_client_notify_subscription+0x72/0xa0 snd_seq_ioctl_subscribe_port+0x128/0x160 snd_seq_kernel_client_ctl+0xce/0xf0 snd_seq_oss_create_client+0x109/0x15b alsa_seq_oss_init+0x11c/0x1aa do_one_initcall+0x80/0x440 kernel_init_freeable+0x370/0x3c3 kernel_init+0x1b/0x190 ret_from_fork+0x1f/0x30 </TASK>
--- include/uapi/sound/asequencer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/uapi/sound/asequencer.h +4 -4
@@ -344,10 +344,10 @@ typedef int __bitwise snd_seq_client_type_t;#define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)/* event filter flags */ -#define SNDRV_SEQ_FILTER_BROADCAST (1<<0)/* accept broadcast messages */ -#define SNDRV_SEQ_FILTER_MULTICAST (1<<1)/* accept multicast messages */ -#define SNDRV_SEQ_FILTER_BOUNCE (1<<2)/* accept bounce event in error */ -#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31)/* use event filter */ +#define SNDRV_SEQ_FILTER_BROADCAST (1U<<0)/* accept broadcast messages */ +#define SNDRV_SEQ_FILTER_MULTICAST (1U<<1)/* accept multicast messages */ +#define SNDRV_SEQ_FILTER_BOUNCE (1U<<2)/* accept bounce event in error */ +#define SNDRV_SEQ_FILTER_USE_EVENT (1U<<31)/* use event filter */ struct snd_seq_client_info {int client;/* client number to inquire */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 84/338 clk: rockchip: Fix memory leak in rockchip_clk_register_pll()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit 739a6a6bbdb793bd57938cb24aa5a6df89983546 ]
If clk_register() fails, @pll->rate_table may have allocated memory by kmemdup(), so it needs to be freed, otherwise will cause memory leak issue, this patch fixes it.
--- drivers/clk/rockchip/clk-pll.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/rockchip/clk-pll.c +1 -0
@@ -972,6 +972,7 @@ struct clk *rockchip_clk_register_pll(struct rockchip_clk_provider *ctx,return mux_clk; err_pll: +kfree (pll->rate_table);clk_unregister (mux_clk); mux_clk = pll_clk; err_mux:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 85/338 mtd: maps: pxa2xx-flash: fix memory leak in probe
In reply to Greg Kroah-HartmanFrom: Zheng Yongjun <[email protected]>
[ Upstream commit 2399401feee27c639addc5b7e6ba519d3ca341bf ]
Free 'info' upon remapping error to avoid a memory leak.
--- drivers/mtd/maps/pxa2xx-flash.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mtd/maps/pxa2xx-flash.c +2 -0
@@ -69,6 +69,7 @@ static int pxa2xx_flash_probe(struct platform_device *pdev)if (!info->map.virt) {printk (KERN_WARNING "Failed to ioremap %s\n" , info->map.name); +kfree (info);return -ENOMEM ; } info->map.cached =
@@ -91,6 +92,7 @@ static int pxa2xx_flash_probe(struct platform_device *pdev)iounmap ((void *)info->map.virt);if (info->map.cached)iounmap (info->map.cached); +kfree (info);return -EIO ; } info->mtd->dev.parent = &pdev->dev;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 76/338 ima: Fix misuse of dereference of pointer in template_desc_init_fields()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit 25369175ce84813dd99d6604e710dc2491f68523 ]
The input parameter @fields is type of struct ima_template_field ***, so when allocates array memory for @fields, the size of element should be sizeof(**field) instead of sizeof(*field).
Actually the original code would not cause any runtime error, but it's better to make it logically right.
--- security/integrity/ima/ima_template.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/integrity/ima/ima_template.c +2 -2
@@ -196,11 +196,11 @@ static int template_desc_init_fields(const char *template_fmt, }if (fields && num_fields) { - *fields =kmalloc_array (i,sizeof (*fields),GFP_KERNEL ); + *fields =kmalloc_array (i,sizeof (**fields),GFP_KERNEL );if (*fields ==NULL )return -ENOMEM ; -memcpy (*fields, found_fields, i *sizeof (*fields)); +memcpy (*fields, found_fields, i *sizeof (**fields)); *num_fields = i; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 111/338 mmc: mmci: fix return value check of mmc_add_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit b38a20f29a49ae04d23750d104b25400b792b98c ]
mmc_add_host() may return error, if we ignore its return value, it will lead two issues:
1. The memory that allocated in mmc_alloc_host() is leaked.
2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-deref in device_del().
So fix this by checking the return value and goto error path which will call mmc_free_host().
--- drivers/mmc/host/mmci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/mmci.c +3 -1
@@ -1792,7 +1792,9 @@ static int mmci_probe(struct amba_device *dev,pm_runtime_set_autosuspend_delay (&dev->dev,50 );pm_runtime_use_autosuspend (&dev->dev); -mmc_add_host (mmc); + ret =mmc_add_host (mmc); +if (ret) + goto clk_disable;pm_runtime_put (&dev->dev);return 0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 120/338 net: defxx: Fix missing err handling in dfx_init()
In reply to Greg Kroah-HartmanFrom: Yongqiang Liu <[email protected]>
[ Upstream commit ae18dcdff0f8d7e84cd3fd9f496518b5e72d185d ]
When eisa_driver_register() or tc_register_driver() failed, the modprobe defxx would fail with some err log as follows:
Error: Driver 'defxx' is already registered, aborting...
Fix this issue by adding err hanling in dfx_init().
--- drivers/net/fddi/defxx.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/net/fddi/defxx.c +18 -4
@@ -3844,10 +3844,24 @@ static int dfx_init(void)int status; status =pci_register_driver (&dfx_pci_driver); -if (!status) - status =eisa_driver_register (&dfx_eisa_driver); -if (!status) - status =tc_register_driver (&dfx_tc_driver); +if (status) + goto err_pci_register; + + status =eisa_driver_register (&dfx_eisa_driver); +if (status) + goto err_eisa_register; + + status =tc_register_driver (&dfx_tc_driver); +if (status) + goto err_tc_register; + +return 0 ; + +err_tc_register: +eisa_driver_unregister (&dfx_eisa_driver); +err_eisa_register: +pci_unregister_driver (&dfx_pci_driver); +err_pci_register:return status; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 121/338 drivers: net: qlcnic: Fix potential memory leak in qlcnic_sriov_init()
In reply to Greg Kroah-HartmanFrom: Yuan Can <[email protected]>
[ Upstream commit 01de1123322e4fe1bbd0fcdf0982511b55519c03 ]
If vp alloc failed in qlcnic_sriov_init(), all previously allocated vp needs to be freed.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +2 -0
@@ -222,6 +222,8 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs)return 0 ; qlcnic_destroy_async_wq: +while (i--) +kfree (sriov->vf_info[i].vp);destroy_workqueue (bc->bc_async_wq); qlcnic_destroy_trans_wq:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 122/338 ethernet: s2io: dont call dev_kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 6cee96e09df54ae17784c0f38a49e0ed8229b825 ]
It is not allowed to call kfree_skb() or consume_skb() from hardware interrupt context or with hardware interrupts being disabled.
It should use dev_kfree_skb_irq() or dev_consume_skb_irq() instead. The difference between them is free reason, dev_kfree_skb_irq() means the SKB is dropped in error and dev_consume_skb_irq() means the SKB is consumed in normal.
In this case, dev_kfree_skb() is called in free_tx_buffers() to drop the SKBs in tx buffers, when the card is down, so replace it with dev_kfree_skb_irq() here.
--- drivers/net/ethernet/neterion/s2io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/neterion/s2io.c +1 -1
@@ -2381,7 +2381,7 @@ static void free_tx_buffers(struct s2io_nic *nic) skb =s2io_txdl_getskb (&mac_control->fifos[i], txdp, j);if (skb) { swstats->mem_freed += skb->truesize; -dev_kfree_skb (skb); +dev_kfree_skb_irq (skb); cnt++; } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 123/338 net: farsync: Fix kmemleak when rmmods farsync
In reply to Greg Kroah-HartmanFrom: Li Zetao <[email protected]>
[ Upstream commit 2f623aaf9f31de968dea6169849706a2f9be444c ]
There are two memory leaks reported by kmemleak:
unreferenced object 0xffff888114b20200 (size 128):
comm "modprobe", pid 4846, jiffies 4295146524 (age 401.345s)
hex dump (first 32 bytes):
e0 62 57 09 81 88 ff ff e0 62 57 09 81 88 ff ff .bW......bW.....
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff815bcd82>] kmalloc_trace+0x22/0x60
[<ffffffff83d35c78>] __hw_addr_add_ex+0x198/0x6c0
[<ffffffff83d3989d>] dev_addr_init+0x13d/0x230
[<ffffffff83d1063d>] alloc_netdev_mqs+0x10d/0xe50
[<ffffffff82b4a06e>] alloc_hdlcdev+0x2e/0x80
[<ffffffffa016a741>] fst_add_one+0x601/0x10e0 [farsync]
... unreferenced object 0xffff88810b85b000 (size 1024):
comm "modprobe", pid 4846, jiffies 4295146523 (age 401.346s)
hex dump (first 32 bytes):
00 00 b0 02 00 c9 ff ff 00 70 0a 00 00 c9 ff ff .........p......
00 00 00 f2 00 00 00 f3 0a 00 00 00 02 00 00 00 ................
backtrace:
[<ffffffff815bcd82>] kmalloc_trace+0x22/0x60
[<ffffffffa016a294>] fst_add_one+0x154/0x10e0 [farsync]
[<ffffffff82060e83>] local_pci_probe+0xd3/0x170
...The root cause is traced to the netdev and fst_card_info are not freed when removes one fst in fst_remove_one(), which may trigger oom if repeated insmod and rmmod module.
Fix it by adding free_netdev() and kfree() in fst_remove_one(), just as the operations on the error handling path in fst_add_one().
--- drivers/net/wan/farsync.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wan/farsync.c +2 -0
@@ -2619,6 +2619,7 @@ fst_remove_one(struct pci_dev *pdev)for (i =0 ; i < card->nports; i++) {struct net_device *dev =port_to_dev (&card->ports[i]);unregister_hdlc_device (dev); +free_netdev (dev); }fst_disable_intr (card);
@@ -2639,6 +2640,7 @@ fst_remove_one(struct pci_dev *pdev) card->tx_dma_handle_card); } fst_card_array[card->card_no] =NULL ; +kfree (card); }static struct pci_driver fst_driver = {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 124/338 net/tunnel: wait until all sk_user_data reader finish before releasing the sock
In reply to Greg Kroah-HartmanFrom: Hangbin Liu <[email protected]>
[ Upstream commit 3cf7203ca620682165706f70a1b12b5194607dce ]
There is a race condition in vxlan that when deleting a vxlan device during receiving packets, there is a possibility that the sock is released after getting vxlan_sock vs from sk_user_data. Then in later vxlan_ecn_decapsulate(), vxlan_get_sk_family() we will got NULL pointer dereference. e.g.
#0 [ffffa25ec6978a38] machine_kexec at ffffffff8c669757 #1 [ffffa25ec6978a90] __crash_kexec at ffffffff8c7c0a4d #2 [ffffa25ec6978b58] crash_kexec at ffffffff8c7c1c48 #3 [ffffa25ec6978b60] oops_end at ffffffff8c627f2b #4 [ffffa25ec6978b80] page_fault_oops at ffffffff8c678fcb #5 [ffffa25ec6978bd8] exc_page_fault at ffffffff8d109542 #6 [ffffa25ec6978c00] asm_exc_page_fault at ffffffff8d200b62
[exception RIP: vxlan_ecn_decapsulate+0x3b]
RIP: ffffffffc1014e7b RSP: ffffa25ec6978cb0 RFLAGS: 00010246
RAX: 0000000000000008 RBX: ffff8aa000888000 RCX: 0000000000000000
RDX: 000000000000000e RSI: ffff8a9fc7ab803e RDI: ffff8a9fd1168700
RBP: ffff8a9fc7ab803e R8: 0000000000700000 R9: 00000000000010ae
R10: ffff8a9fcb748980 R11: 0000000000000000 R12: ffff8a9fd1168700
R13: ffff8aa000888000 R14: 00000000002a0000 R15: 00000000000010ae
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #7 [ffffa25ec6978ce8] vxlan_rcv at ffffffffc10189cd [vxlan] #8 [ffffa25ec6978d90] udp_queue_rcv_one_skb at ffffffff8cfb6507 #9 [ffffa25ec6978dc0] udp_unicast_rcv_skb at ffffffff8cfb6e45
#10 [ffffa25ec6978dc8] __udp4_lib_rcv at ffffffff8cfb8807 #11 [ffffa25ec6978e20] ip_protocol_deliver_rcu at ffffffff8cf76951 #12 [ffffa25ec6978e48] ip_local_deliver at ffffffff8cf76bde #13 [ffffa25ec6978ea0] __netif_receive_skb_one_core at ffffffff8cecde9b #14 [ffffa25ec6978ec8] process_backlog at ffffffff8cece139 #15 [ffffa25ec6978f00] __napi_poll at ffffffff8ceced1a
#16 [ffffa25ec6978f28] net_rx_action at ffffffff8cecf1f3 #17 [ffffa25ec6978fa0] __softirqentry_text_start at ffffffff8d4000ca #18 [ffffa25ec6978ff0] do_softirq at ffffffff8c6fbdc3
Reproducer: https://github.com/Mellanox/ovs-tests/blob/master/test-ovs-vxlan-remove-tunnel-during-traffic.sh
Fix this by waiting for all sk_user_data reader to finish before releasing the sock.
--- net/ipv4/udp_tunnel.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/udp_tunnel.c +1 -0
@@ -186,6 +186,7 @@ EXPORT_SYMBOL_GPL(udp_tunnel_xmit_skb);void udp_tunnel_sock_release (struct socket *sock) {rcu_assign_sk_user_data (sock->sk,NULL ); +synchronize_rcu ();kernel_sock_shutdown (sock,SHUT_RDWR );sock_release (sock); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 125/338 net: apple: mace: dont call dev_kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 3dfe3486c1cd4f82b466b7d307f23777137b8acc ]
It is not allowed to call kfree_skb() or consume_skb() from hardware interrupt context or with hardware interrupts being disabled.
It should use dev_kfree_skb_irq() or dev_consume_skb_irq() instead. The difference between them is free reason, dev_kfree_skb_irq() means the SKB is dropped in error and dev_consume_skb_irq() means the SKB is consumed in normal.
In this case, dev_kfree_skb() is called in mace_tx_timeout() to drop the SKB, when tx timeout, so replace it with dev_kfree_skb_irq().
--- drivers/net/ethernet/apple/mace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/apple/mace.c +1 -1
@@ -842,7 +842,7 @@ static void mace_tx_timeout(unsigned long data)if (mp->tx_bad_runt) { mp->tx_bad_runt =0 ; }else if (i != mp->tx_fill) { -dev_kfree_skb (mp->tx_bufs[i]); +dev_kfree_skb_irq (mp->tx_bufs[i]);if (++i >=N_TX_RING ) i =0 ; mp->tx_empty = i;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 126/338 net: apple: bmac: dont call dev_kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 5fe02e046e6422c4adfdbc50206ec7186077da24 ]
It is not allowed to call kfree_skb() or consume_skb() from hardware interrupt context or with hardware interrupts being disabled.
It should use dev_kfree_skb_irq() or dev_consume_skb_irq() instead. The difference between them is free reason, dev_kfree_skb_irq() means the SKB is dropped in error and dev_consume_skb_irq() means the SKB is consumed in normal.
In this case, dev_kfree_skb() is called in bmac_tx_timeout() to drop the SKB, when tx timeout, so replace it with dev_kfree_skb_irq().
--- drivers/net/ethernet/apple/bmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/apple/bmac.c +1 -1
@@ -1516,7 +1516,7 @@ static void bmac_tx_timeout(unsigned long data) i = bp->tx_empty; ++dev->stats.tx_errors;if (i != bp->tx_fill) { -dev_kfree_skb (bp->tx_bufs[i]); +dev_kfree_skb_irq (bp->tx_bufs[i]); bp->tx_bufs[i] =NULL ;if (++i >=N_TX_RING ) i =0 ; bp->tx_empty = i;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 127/338 net: emaclite: dont call dev_kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit d1678bf45f21fa5ae4a456f821858679556ea5f8 ]
It is not allowed to call kfree_skb() or consume_skb() from hardware interrupt context or with hardware interrupts being disabled.
It should use dev_kfree_skb_irq() or dev_consume_skb_irq() instead. The difference between them is free reason, dev_kfree_skb_irq() means the SKB is dropped in error and dev_consume_skb_irq() means the SKB is consumed in normal.
In this case, dev_kfree_skb() is called in xemaclite_tx_timeout() to drop the SKB, when tx timeout, so replace it with dev_kfree_skb_irq().
--- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/xilinx/xilinx_emaclite.c +1 -1
@@ -537,7 +537,7 @@ static void xemaclite_tx_timeout(struct net_device *dev)xemaclite_enable_interrupts (lp);if (lp->deferred_skb) { -dev_kfree_skb (lp->deferred_skb); +dev_kfree_skb_irq (lp->deferred_skb); lp->deferred_skb =NULL ; dev->stats.tx_errors++; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 128/338 net: ethernet: dnet: dont call dev_kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit f07fadcbee2a5e84caa67c7c445424200bffb60b ]
It is not allowed to call kfree_skb() or consume_skb() from hardware interrupt context or with hardware interrupts being disabled.
In this case, the lock is used to protected 'bp', so we can move dev_kfree_skb() after the spin_unlock_irqrestore().
--- drivers/net/ethernet/dnet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/dnet.c +2 -2
@@ -558,11 +558,11 @@ static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev)skb_tx_timestamp (skb); +spin_unlock_irqrestore (&bp->lock, flags); +/* free the buffer */ dev_kfree_skb (skb); -spin_unlock_irqrestore (&bp->lock, flags); -return NETDEV_TX_OK ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 129/338 hamradio: dont call dev_kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 3727f742915f04f6fc550b80cf406999bd4e90d0 ]
It is not allowed to call kfree_skb() or consume_skb() from hardware interrupt context or with hardware interrupts being disabled.
It should use dev_kfree_skb_irq() or dev_consume_skb_irq() instead. The difference between them is free reason, dev_kfree_skb_irq() means the SKB is dropped in error and dev_consume_skb_irq() means the SKB is consumed in normal.
In scc_discard_buffers(), dev_kfree_skb() is called to discard the SKBs, so replace it with dev_kfree_skb_irq().
In scc_net_tx(), dev_kfree_skb() is called to drop the SKB that exceed queue length, so replace it with dev_kfree_skb_irq().
--- drivers/net/hamradio/scc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/hamradio/scc.c +3 -3
@@ -299,12 +299,12 @@ static inline void scc_discard_buffers(struct scc_channel *scc)spin_lock_irqsave (&scc->lock, flags);if (scc->tx_buff !=NULL ) { -dev_kfree_skb (scc->tx_buff); +dev_kfree_skb_irq (scc->tx_buff); scc->tx_buff =NULL ; }while (!skb_queue_empty (&scc->tx_queue)) -dev_kfree_skb (skb_dequeue (&scc->tx_queue)); +dev_kfree_skb_irq (skb_dequeue (&scc->tx_queue));spin_unlock_irqrestore (&scc->lock, flags); }
@@ -1666,7 +1666,7 @@ static netdev_tx_t scc_net_tx(struct sk_buff *skb, struct net_device *dev)if (skb_queue_len (&scc->tx_queue) > scc->dev->tx_queue_len) {struct sk_buff *skb_del; skb_del =skb_dequeue (&scc->tx_queue); -dev_kfree_skb (skb_del); +dev_kfree_skb_irq (skb_del); }skb_queue_tail (&scc->tx_queue, skb);netif_trans_update (dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 112/338 media: c8sectpfe: Add of_node_put() when breaking out of loop
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit 63ff05a1ad242a5a0f897921c87b70d601bda59c ]
In configure_channels(), we should call of_node_put() when breaking out of for_each_child_of_node() which will automatically increase and decrease the refcount.
--- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +1 -0
@@ -947,6 +947,7 @@ static int configure_channels(struct c8sectpfei *fei)if (ret) {dev_err (fei->dev,"configure_memdma_and_inputblock failed\n" ); +of_node_put (child); goto err_unmap; } index++;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 130/338 net: amd: lance: dont call dev_kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 6151d105dfce8c23edf30eed35e97f3d9b96a35c ]
It is not allowed to call kfree_skb() or consume_skb() from hardware interrupt context or with hardware interrupts being disabled.
It should use dev_kfree_skb_irq() or dev_consume_skb_irq() instead. The difference between them is free reason, dev_kfree_skb_irq() means the SKB is dropped in error and dev_consume_skb_irq() means the SKB is consumed in normal.
In these two cases, dev_kfree_skb() is called consume the xmited SKB, so replace it with dev_consume_skb_irq().
--- drivers/net/ethernet/amd/atarilance.c | 2 +- drivers/net/ethernet/amd/lance.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/amd/atarilance.c +1 -1
@@ -825,7 +825,7 @@ lance_start_xmit(struct sk_buff *skb, struct net_device *dev) lp->memcpy_f (PKTBUF_ADDR (head), (void *)skb->data, skb->len ); head->flag =TMD1_OWN_CHIP |TMD1_ENP |TMD1_STP ; dev->stats.tx_bytes += skb->len; -dev_kfree_skb ( skb ); +dev_consume_skb_irq (skb); lp->cur_tx++;while ( lp->cur_tx >=TX_RING_SIZE && lp->dirty_tx >=TX_RING_SIZE ) { lp->cur_tx -=TX_RING_SIZE ;
drivers/net/ethernet/amd/lance.c +1 -1
@@ -997,7 +997,7 @@ static netdev_tx_t lance_start_xmit(struct sk_buff *skb,skb_copy_from_linear_data (skb, &lp->tx_bounce_buffs[entry], skb->len); lp->tx_ring[entry].base = ((u32 )isa_virt_to_bus ((lp->tx_bounce_buffs + entry)) &0xffffff ) |0x83000000 ; -dev_kfree_skb (skb); +dev_consume_skb_irq (skb); }else { lp->tx_skbuff[entry] = skb; lp->tx_ring[entry].base = ((u32 )isa_virt_to_bus (skb->data) &0xffffff ) |0x83000000 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 131/338 net: amd-xgbe: Check only the minimum speed for active/passive cables
In reply to Greg Kroah-HartmanFrom: Tom Lendacky <[email protected]>
[ Upstream commit f8ab263d4d48e6dab752029bf562f20a2ee630ed ]
There are cables that exist that can support speeds in excess of 10GbE. The driver, however, restricts the EEPROM advertised nominal bitrate to a specific range, which can prevent usage of cables that can support, for example, up to 25GbE.
Rather than checking that an active or passive cable supports a specific range, only check for a minimum supported speed.
--- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +2 -12
@@ -234,10 +234,7 @@ enum xgbe_sfp_speed {#define XGBE_SFP_BASE_BR 12#define XGBE_SFP_BASE_BR_1GBE_MIN 0x0a -#define XGBE_SFP_BASE_BR_1GBE_MAX 0x0d#define XGBE_SFP_BASE_BR_10GBE_MIN 0x64 -#define XGBE_SFP_BASE_BR_10GBE_MAX 0x68 -#define XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX 0x78#define XGBE_SFP_BASE_CU_CABLE_LEN 18
@@ -832,29 +829,22 @@ static void xgbe_phy_sfp_phy_settings(struct xgbe_prv_data *pdata)static bool xgbe_phy_sfp_bit_rate (struct xgbe_sfp_eeprom *sfp_eeprom,enum xgbe_sfp_speed sfp_speed) { -u8 *sfp_base, min, max; +u8 *sfp_base, min; sfp_base = sfp_eeprom->base;switch (sfp_speed) {case XGBE_SFP_SPEED_1000 : min =XGBE_SFP_BASE_BR_1GBE_MIN ; - max =XGBE_SFP_BASE_BR_1GBE_MAX ;break ;case XGBE_SFP_SPEED_10000 : min =XGBE_SFP_BASE_BR_10GBE_MIN ; -if (memcmp (&sfp_eeprom->base[XGBE_SFP_BASE_VENDOR_NAME ], -XGBE_MOLEX_VENDOR ,XGBE_SFP_BASE_VENDOR_NAME_LEN ) ==0 ) - max =XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX ; -else - max =XGBE_SFP_BASE_BR_10GBE_MAX ;break ;default :return false; } -return ((sfp_base[XGBE_SFP_BASE_BR ] >= min) && - (sfp_base[XGBE_SFP_BASE_BR ] <= max)); +return sfp_base[XGBE_SFP_BASE_BR ] >= min; }static void xgbe_phy_free_phy_device (struct xgbe_prv_data *pdata)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 132/338 net: lan9303: Fix read error execution path
In reply to Greg Kroah-HartmanFrom: Jerry Ray <[email protected]>
[ Upstream commit 8964916d206071b058c6351f88b1966bd58cbde0 ]
This patch fixes an issue where a read failure of a port statistic counter will return unknown results. While it is highly unlikely the read will ever fail, it is much cleaner to return a zero for the stat count.
--- drivers/net/dsa/lan9303-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/dsa/lan9303-core.c +3 -1
@@ -721,9 +721,11 @@ static void lan9303_get_ethtool_stats(struct dsa_switch *ds, int port, ret =lan9303_read_switch_port ( chip, port, lan9303_mib[u].offset, ®); -if (ret) +if (ret) {dev_warn (chip->dev,"Reading status port %d reg %u failed\n" , port, lan9303_mib[u].offset); + reg =0 ; + } data[u] = reg; } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 133/338 ntb_netdev: Use dev_kfree_skb_any() in interrupt context
In reply to Greg Kroah-HartmanFrom: Eric Pilmore <[email protected]>
[ Upstream commit 5f7d78b2b12a9d561f48fa00bab29b40f4616dad ]
TX/RX callback handlers (ntb_netdev_tx_handler(), ntb_netdev_rx_handler()) can be called in interrupt context via the DMA framework when the respective DMA operations have completed. As such, any calls by these routines to free skb's, should use the interrupt context safe dev_kfree_skb_any() function.
Previously, these callback handlers would call the interrupt unsafe version of dev_kfree_skb(). This has not presented an issue on Intel IOAT DMA engines as that driver utilizes tasklets rather than a hard interrupt handler, like the AMD PTDMA DMA driver. On AMD systems, a kernel WARNING message is encountered, which is being issued from skb_release_head_state() due to in_hardirq() being true.
Besides the user visible WARNING from the kernel, the other symptom of this bug was that TCP/IP performance across the ntb_netdev interface was very poor, i.e. approximately an order of magnitude below what was expected. With the repair to use dev_kfree_skb_any(), kernel WARNINGs from skb_release_head_state() ceased and TCP/IP performance, as measured by iperf, was on par with expected results, approximately 20 Gb/s on AMD Milan based server. Note that this performance is comparable with Intel based servers.
--- drivers/net/ntb_netdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ntb_netdev.c +2 -2
@@ -140,7 +140,7 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data, enqueue_again: rc =ntb_transport_rx_enqueue (qp, skb, skb->data, ndev->mtu +ETH_HLEN );if (rc) { -dev_kfree_skb (skb); +dev_kfree_skb_any (skb); ndev->stats.rx_errors++; ndev->stats.rx_fifo_errors++; }
@@ -195,7 +195,7 @@ static void ntb_netdev_tx_handler(struct ntb_transport_qp *qp, void *qp_data, ndev->stats.tx_aborted_errors++; } -dev_kfree_skb (skb); +dev_kfree_skb_any (skb);if (ntb_transport_tx_free_entry (dev->qp) >= tx_start) {/* Make sure anybody stopping the queue after this sees the new
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 134/338 Bluetooth: btusb: dont call kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit b15a6bd3c80c77faec8317319b97f976b1a08332 ]
It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. So replace kfree_skb() with dev_kfree_skb_irq() under spin_lock_irqsave().
--- drivers/bluetooth/btusb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/bluetooth/btusb.c +3 -3
@@ -490,13 +490,13 @@ static inline void btusb_free_frags(struct btusb_data *data)spin_lock_irqsave (&data->rxlock, flags); -kfree_skb (data->evt_skb); +dev_kfree_skb_irq (data->evt_skb); data->evt_skb =NULL ; -kfree_skb (data->acl_skb); +dev_kfree_skb_irq (data->acl_skb); data->acl_skb =NULL ; -kfree_skb (data->sco_skb); +dev_kfree_skb_irq (data->sco_skb); data->sco_skb =NULL ;spin_unlock_irqrestore (&data->rxlock, flags);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 135/338 Bluetooth: hci_qca: dont call kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit df4cfc91208e0a98f078223793f5871b1a82cc54 ]
It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. So replace kfree_skb() with dev_kfree_skb_irq() under spin_lock_irqsave().
--- drivers/bluetooth/hci_qca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bluetooth/hci_qca.c +1 -1
@@ -715,7 +715,7 @@ static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb)default :BT_ERR ("Illegal tx state: %d (losing packet)" , qca->tx_ibs_state); -kfree_skb (skb); +dev_kfree_skb_irq (skb);break ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 136/338 Bluetooth: hci_h5: dont call kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 383630cc6758d619874c2e8bb2f68a61f3f9ef6e ]
It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. So replace kfree_skb() with dev_kfree_skb_irq() under spin_lock_irqsave().
--- drivers/bluetooth/hci_h5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bluetooth/hci_h5.c +1 -1
@@ -264,7 +264,7 @@ static void h5_pkt_cull(struct h5 *h5)break ;__skb_unlink (skb, &h5->unack); -kfree_skb (skb); +dev_kfree_skb_irq (skb); }if (skb_queue_empty (&h5->unack))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 137/338 Bluetooth: hci_bcsp: dont call kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 7b503e339c1a80bf0051ec2d19c3bc777014ac61 ]
It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. So replace kfree_skb() with dev_kfree_skb_irq() under spin_lock_irqsave().
--- drivers/bluetooth/hci_bcsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bluetooth/hci_bcsp.c +1 -1
@@ -392,7 +392,7 @@ static void bcsp_pkt_cull(struct bcsp_struct *bcsp) i++;__skb_unlink (skb, &bcsp->unack); -kfree_skb (skb); +dev_kfree_skb_irq (skb); }if (skb_queue_empty (&bcsp->unack))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 138/338 Bluetooth: hci_core: dont call kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 39c1eb6fcbae8ce9bb71b2ac5cb609355a2b181b ]
It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. So replace kfree_skb() with dev_kfree_skb_irq() under spin_lock_irqsave().
--- net/bluetooth/hci_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_core.c +1 -1
@@ -4216,7 +4216,7 @@ void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status, *req_complete_skb =bt_cb (skb)->hci.req_complete_skb; else *req_complete =bt_cb (skb)->hci.req_complete; -kfree_skb (skb); +dev_kfree_skb_irq (skb); }spin_unlock_irqrestore (&hdev->cmd_q.lock, flags); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 139/338 Bluetooth: RFCOMM: dont call kfree_skb() under spin_lock_irqsave()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 0ba18967d4544955b2eff2fbc4f2a8750c4df90a ]
It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. So replace kfree_skb() with dev_kfree_skb_irq() under spin_lock_irqsave().
--- net/bluetooth/rfcomm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/rfcomm/core.c +1 -1
@@ -593,7 +593,7 @@ int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb) ret =rfcomm_dlc_send_frag (d, frag);if (ret <0 ) { -kfree_skb (frag); +dev_kfree_skb_irq (frag); goto unlock; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 113/338 media: coda: Add check for dcoda_iram_alloc
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit 6b8082238fb8bb20f67e46388123e67a5bbc558d ]
As the coda_iram_alloc may return NULL pointer, it should be better to check the return value
in order to avoid NULL poineter dereference, same as the others.
--- drivers/media/platform/coda/coda-bit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/coda/coda-bit.c +2 -2
@@ -637,7 +637,7 @@ static void coda_setup_iram(struct coda_ctx *ctx)/* Only H.264BP and H.263P3 are considered */ iram_info->buf_dbk_y_use =coda_iram_alloc (iram_info, w64); iram_info->buf_dbk_c_use =coda_iram_alloc (iram_info, w64); -if (!iram_info->buf_dbk_c_use) +if (!iram_info->buf_dbk_y_use || !iram_info->buf_dbk_c_use) goto out; iram_info->axi_sram_use |= dbk_bits;
@@ -661,7 +661,7 @@ static void coda_setup_iram(struct coda_ctx *ctx) iram_info->buf_dbk_y_use =coda_iram_alloc (iram_info, w128); iram_info->buf_dbk_c_use =coda_iram_alloc (iram_info, w128); -if (!iram_info->buf_dbk_c_use) +if (!iram_info->buf_dbk_y_use || !iram_info->buf_dbk_c_use) goto out; iram_info->axi_sram_use |= dbk_bits;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 140/338 stmmac: fix potential division by 0
In reply to Greg Kroah-HartmanFrom: Piergiorgio Beruto <[email protected]>
[ Upstream commit ede5a389852d3640a28e7187fb32b7f204380901 ]
When the MAC is connected to a 10 Mb/s PHY and the PTP clock is derived from the MAC reference clock (default), the clk_ptp_rate becomes too small and the calculated sub second increment becomes 0 when computed by the stmmac_config_sub_second_increment() function within stmmac_init_tstamp_counter().
Therefore, the subsequent div_u64 in stmmac_init_tstamp_counter() operation triggers a divide by 0 exception as shown below.
[ 95.062067] socfpga-dwmac ff700000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 [ 95.076440] socfpga-dwmac ff700000.ethernet eth0: PHY [stmmac-0:08] driver [NCN26000] (irq=49) [ 95.095964] dwmac1000: Master AXI performs any burst length [ 95.101588] socfpga-dwmac ff700000.ethernet eth0: No Safety Features support found [ 95.109428] Division by zero in kernel. [ 95.113447] CPU: 0 PID: 239 Comm: ifconfig Not tainted 6.1.0-rc7-centurion3-1.0.3.0-01574-gb624218205b7-dirty #77 [ 95.123686] Hardware name: Altera SOCFPGA [ 95.127695] unwind_backtrace from show_stack+0x10/0x14 [ 95.132938] show_stack from dump_stack_lvl+0x40/0x4c [ 95.137992] dump_stack_lvl from Ldiv0+0x8/0x10 [ 95.142527] Ldiv0 from __aeabi_uidivmod+0x8/0x18 [ 95.147232] __aeabi_uidivmod from div_u64_rem+0x1c/0x40 [ 95.152552] div_u64_rem from stmmac_init_tstamp_counter+0xd0/0x164 [ 95.158826] stmmac_init_tstamp_counter from stmmac_hw_setup+0x430/0xf00 [ 95.165533] stmmac_hw_setup from __stmmac_open+0x214/0x2d4 [ 95.171117] __stmmac_open from stmmac_open+0x30/0x44 [ 95.176182] stmmac_open from __dev_open+0x11c/0x134 [ 95.181172] __dev_open from __dev_change_flags+0x168/0x17c [ 95.186750] __dev_change_flags from dev_change_flags+0x14/0x50 [ 95.192662] dev_change_flags from devinet_ioctl+0x2b4/0x604 [ 95.198321] devinet_ioctl from inet_ioctl+0x1ec/0x214 [ 95.203462] inet_ioctl from sock_ioctl+0x14c/0x3c4 [ 95.208354] sock_ioctl from vfs_ioctl+0x20/0x38 [ 95.212984] vfs_ioctl from sys_ioctl+0x250/0x844 [ 95.217691] sys_ioctl from ret_fast_syscall+0x0/0x4c [ 95.222743] Exception stack(0xd0ee1fa8 to 0xd0ee1ff0) [ 95.227790] 1fa0: 00574c4f be9aeca4 00000003 00008914 be9aeca4 be9aec50 [ 95.235945] 1fc0: 00574c4f be9aeca4 0059f078 00000036 be9aee8c be9aef7a 00000015 00000000 [ 95.244096] 1fe0: 005a01f0 be9aec38 004d7484 b6e67d74
--- drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 3 ++- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +2 -1
@@ -53,7 +53,8 @@ static u32 stmmac_config_sub_second_increment(void __iomem *ioaddr,if (!(value &PTP_TCR_TSCTRLSSR )) data = (data *1000 ) /465 ; - data &=PTP_SSIR_SSINC_MASK ; +if (data >PTP_SSIR_SSINC_MAX ) + data =PTP_SSIR_SSINC_MAX ; reg_value = data;if (gmac4)
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h +1 -1
@@ -65,7 +65,7 @@#define PTP_TCR_TSENMACADDR BIT(18)/* SSIR defines */ -#define PTP_SSIR_SSINC_MASK 0xff +#define PTP_SSIR_SSINC_MAX 0xff#define GMAC4_PTP_SSIR_SSINC_SHIFT 16#endif /* __STMMAC_PTP_H__ */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 141/338 apparmor: fix a memleak in multi_transaction_new()
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
[ Upstream commit c73275cf6834787ca090317f1d20dbfa3b7f05aa ]
In multi_transaction_new(), the variable t is not freed or passed out on the failure of copy_from_user(t->data, buf, size), which could lead to a memleak.
Fix this bug by adding a put_multi_transaction(t) in the error path.
--- security/apparmor/apparmorfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
security/apparmor/apparmorfs.c +3 -1
@@ -874,8 +874,10 @@ static struct multi_transaction *multi_transaction_new(struct file *file,if (!t)return ERR_PTR (-ENOMEM );kref_init (&t->count); -if (copy_from_user (t->data, buf, size)) +if (copy_from_user (t->data, buf, size)) { +put_multi_transaction (t);return ERR_PTR (-EFAULT ); + }return t; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 142/338 PCI: Check for alloc failure in pci_request_irq()
In reply to Greg Kroah-HartmanFrom: Zeng Heng <[email protected]>
[ Upstream commit 2d9cd957d40c3ac491b358e7cff0515bb07a3a9c ]
When kvasprintf() fails to allocate memory, it returns a NULL pointer. Return error from pci_request_irq() so we don't dereference it.
--- drivers/pci/irq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pci/irq.c +2 -0
@@ -91,6 +91,8 @@ int pci_request_irq(struct pci_dev *dev, unsigned int nr, irq_handler_t handler,va_start (ap, fmt); devname =kvasprintf (GFP_KERNEL , fmt, ap);va_end (ap); +if (!devname) +return -ENOMEM ; ret =request_threaded_irq (pci_irq_vector (dev, nr), handler, thread_fn,IRQF_SHARED , devname, dev_id);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 114/338 media: coda: Add check for kmalloc
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit 6e5e5defdb8b0186312c2f855ace175aee6daf9b ]
As the kmalloc may return NULL pointer,
it should be better to check the return value
in order to avoid NULL poineter dereference,
same as the others.
--- drivers/media/platform/coda/coda-bit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/media/platform/coda/coda-bit.c +8 -2
@@ -865,10 +865,16 @@ static int coda_start_encoding(struct coda_ctx *ctx) }if (dst_fourcc ==V4L2_PIX_FMT_JPEG ) { -if (!ctx->params.jpeg_qmat_tab[0 ]) +if (!ctx->params.jpeg_qmat_tab[0 ]) { ctx->params.jpeg_qmat_tab[0 ] =kmalloc (64 ,GFP_KERNEL ); -if (!ctx->params.jpeg_qmat_tab[1 ]) +if (!ctx->params.jpeg_qmat_tab[0 ]) +return -ENOMEM ; + } +if (!ctx->params.jpeg_qmat_tab[1 ]) { ctx->params.jpeg_qmat_tab[1 ] =kmalloc (64 ,GFP_KERNEL ); +if (!ctx->params.jpeg_qmat_tab[1 ]) +return -ENOMEM ; + }coda_set_jpeg_compression_quality (ctx, ctx->params.jpeg_quality); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 115/338 clk: samsung: Fix memory leak in _samsung_clk_register_pll()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit 5174e5b0d1b669a489524192b6adcbb3c54ebc72 ]
If clk_register() fails, @pll->rate_table may have allocated memory by kmemdup(), so it needs to be freed, otherwise will cause memory leak issue, this patch fixes it.
--- drivers/clk/samsung/clk-pll.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/samsung/clk-pll.c +1 -0
@@ -1392,6 +1392,7 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx,if (ret) {pr_err ("%s: failed to register pll clock %s : %d\n" , __func__, pll_clk->name, ret); +kfree (pll->rate_table);kfree (pll);return ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 116/338 wifi: rtl8xxxu: Add __packed to struct rtl8723bu_c2h
In reply to Greg Kroah-HartmanFrom: Bitterblue Smith <[email protected]>
[ Upstream commit dd469a754afdb782ba3033cee102147493dc39f4 ]
This struct is used to access a sequence of bytes received from the wifi chip. It must not have any padding bytes between the members.
This doesn't change anything on my system, possibly because currently none of the members need more than byte alignment.
--- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +1 -1
@@ -1191,7 +1191,7 @@ struct rtl8723bu_c2h {u8 dummy3_0; }__packed ra_report; }; -}; +} __packed;struct rtl8xxxu_fileops ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 117/338 wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
In reply to Greg Kroah-HartmanFrom: Wang Yufen <[email protected]>
[ Upstream commit c2f2924bc7f9ea75ef8d95863e710168f8196256 ]
Fix to return a negative error code instead of 0 when brcmf_chip_set_active() fails. In addition, change the return value for brcmf_pcie_exit_download_state() to keep consistent.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +1 -1
@@ -599,7 +599,7 @@ static int brcmf_pcie_exit_download_state(struct brcmf_pciedev_info *devinfo, }if (!brcmf_chip_set_active (devinfo->ci, resetintr)) -return -EINVAL ; +return -EIO ;return 0 ; }
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +1 -0
@@ -3326,6 +3326,7 @@ static int brcmf_sdio_download_firmware(struct brcmf_sdio *bus,/* Take arm out of reset */ if (!brcmf_chip_set_active (bus->ci, rstvec)) {brcmf_err ("error getting out of ARM core reset\n" ); + bcmerror = -EIO ; goto err; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 118/338 blktrace: Fix output non-blktrace event when blk_classic option enabled
In reply to Greg Kroah-HartmanFrom: Yang Jihong <[email protected]>
[ Upstream commit f596da3efaf4130ff61cd029558845808df9bf99 ]
When the blk_classic option is enabled, non-blktrace events must be filtered out. Otherwise, events of other types are output in the blktrace classic format, which is unexpected.
The problem can be triggered in the following ways:
# echo 1 > /sys/kernel/debug/tracing/options/blk_classic # echo 1 > /sys/kernel/debug/tracing/events/enable # echo blk > /sys/kernel/debug/tracing/current_tracer # cat /sys/kernel/debug/tracing/trace_pipe
--- kernel/trace/blktrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/trace/blktrace.c +2 -1
@@ -1612,7 +1612,8 @@ blk_trace_event_print_binary(struct trace_iterator *iter, int flags,static enum print_line_t blk_tracer_print_line (struct trace_iterator *iter) { -if (!(blk_tracer_flags.val &TRACE_BLK_OPT_CLASSIC )) +if ((iter->ent->type !=TRACE_BLK ) || + !(blk_tracer_flags.val &TRACE_BLK_OPT_CLASSIC ))return TRACE_TYPE_UNHANDLED ;return print_one_line (iter, true);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 119/338 net: vmw_vsock: vmci: Check memcpy_from_msg()
In reply to Greg Kroah-HartmanFrom: Artem Chernyshev <[email protected]>
[ Upstream commit 44aa5a6dba8283bfda28b1517af4de711c5652a4 ]
vmci_transport_dgram_enqueue() does not check the return value of memcpy_from_msg(). If memcpy_from_msg() fails, it is possible that uninitialized memory contents are sent unintentionally instead of user's message in the datagram to the destination. Return with an error if memcpy_from_msg() fails.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- net/vmw_vsock/vmci_transport.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/vmw_vsock/vmci_transport.c +5 -1
@@ -1730,7 +1730,11 @@ static int vmci_transport_dgram_enqueue(if (!dg)return -ENOMEM ; -memcpy_from_msg (VMCI_DG_PAYLOAD (dg), msg, len); + err =memcpy_from_msg (VMCI_DG_PAYLOAD (dg), msg, len); +if (err) { +kfree (dg); +return err; + } dg->dst =vmci_make_handle (remote_addr->svm_cid, remote_addr->svm_port);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 110/338 mmc: wbsd: fix return value check of mmc_add_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit dc5b9b50fc9d1334407e316e6e29a5097ef833bd ]
mmc_add_host() may return error, if we ignore its return value, it will lead two issues:
1. The memory that allocated in mmc_alloc_host() is leaked.
2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-deref in device_del().
So fix this by checking the return value and goto error path which will call mmc_free_host(), besides, other resources also need be released.
--- drivers/mmc/host/wbsd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/mmc/host/wbsd.c +11 -1
@@ -1716,7 +1716,17 @@ static int wbsd_init(struct device *dev, int base, int irq, int dma,*/ wbsd_init_device (host); -mmc_add_host (mmc); + ret =mmc_add_host (mmc); +if (ret) { +if (!pnp) +wbsd_chip_poweroff (host); + +wbsd_release_resources (host); +wbsd_free_mmc (dev); + +mmc_free_host (mmc); +return ret; + }pr_info ("%s: W83L51xD" ,mmc_hostname (mmc));if (host->chip_id !=0 )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 144/338 RDMA/rxe: Fix NULL-ptr-deref in rxe_qp_do_cleanup() when socket create failed
In reply to Greg Kroah-HartmanFrom: Zhang Xiaoxu <[email protected]>
[ Upstream commit f67376d801499f4fa0838c18c1efcad8840e550d ]
There is a null-ptr-deref when mount.cifs over rdma:
BUG: KASAN: null-ptr-deref in rxe_qp_do_cleanup+0x2f3/0x360 [rdma_rxe] Read of size 8 at addr 0000000000000018 by task mount.cifs/3046 CPU: 2 PID: 3046 Comm: mount.cifs Not tainted 6.1.0-rc5+ #62 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc3 Call Trace: <TASK> dump_stack_lvl+0x34/0x44 kasan_report+0xad/0x130 rxe_qp_do_cleanup+0x2f3/0x360 [rdma_rxe] execute_in_process_context+0x25/0x90 __rxe_cleanup+0x101/0x1d0 [rdma_rxe] rxe_create_qp+0x16a/0x180 [rdma_rxe] create_qp.part.0+0x27d/0x340 ib_create_qp_kernel+0x73/0x160 rdma_create_qp+0x100/0x230 _smbd_get_connection+0x752/0x20f0 smbd_get_connection+0x21/0x40 cifs_get_tcp_session+0x8ef/0xda0 mount_get_conns+0x60/0x750 cifs_mount+0x103/0xd00 cifs_smb3_do_mount+0x1dd/0xcb0 smb3_get_tree+0x1d5/0x300 vfs_get_tree+0x41/0xf0 path_mount+0x9b3/0xdd0 __x64_sys_mount+0x190/0x1d0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0
The root cause of the issue is the socket create failed in rxe_qp_init_req().
So move the reset rxe_qp_do_cleanup() after the NULL ptr check.
--- drivers/infiniband/sw/rxe/rxe_qp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/sw/rxe/rxe_qp.c +3 -3
@@ -866,12 +866,12 @@ static void rxe_qp_do_cleanup(struct work_struct *work) qp->resp.mr =NULL ; } -if (qp_type (qp) ==IB_QPT_RC ) -sk_dst_reset (qp->sk->sk); -free_rd_atomic_resources (qp);if (qp->sk) { +if (qp_type (qp) ==IB_QPT_RC ) +sk_dst_reset (qp->sk->sk); +kernel_sock_shutdown (qp->sk,SHUT_RDWR );sock_release (qp->sk); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 153/338 crypto: img-hash - Fix variable dereferenced before check hdev->req
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
[ Upstream commit 04ba54e5af8f8f0137b08cb51a0b3a2e1ea46c94 ]
Smatch report warning as follows:
drivers/crypto/img-hash.c:366 img_hash_dma_task() warn: variable dereferenced before check 'hdev->req'
Variable dereferenced should be done after check 'hdev->req', fix it.
--- drivers/crypto/img-hash.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/crypto/img-hash.c +6 -2
@@ -359,12 +359,16 @@ static int img_hash_dma_init(struct img_hash_dev *hdev)static void img_hash_dma_task (unsigned long d) {struct img_hash_dev *hdev = (struct img_hash_dev *)d; -struct img_hash_request_ctx *ctx =ahash_request_ctx (hdev->req); +struct img_hash_request_ctx *ctx;u8 *addr;size_t nbytes, bleft, wsend, len, tbc;struct scatterlist tsg; -if (!hdev->req || !ctx->sg) +if (!hdev->req) +return ; + + ctx =ahash_request_ctx (hdev->req); +if (!ctx->sg)return ; addr =sg_virt (ctx->sg);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 154/338 hwrng: amd - Fix PCI device refcount leak
In reply to Greg Kroah-HartmanFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit ecadb5b0111ea19fc7c240bb25d424a94471eb7d ]
for_each_pci_dev() is implemented by pci_get_device(). The comment of pci_get_device() says that it will increase the reference count for the returned pci_dev and also decrease the reference count for the input pci_dev @from if it is not NULL.
If we break for_each_pci_dev() loop with pdev not NULL, we need to call pci_dev_put() to decrease the reference count. Add the missing pci_dev_put() for the normal and error path.
--- drivers/char/hw_random/amd-rng.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/char/hw_random/amd-rng.c +13 -5
@@ -143,15 +143,19 @@ static int __init mod_init(void) found: err =pci_read_config_dword (pdev,0x58 , &pmbase);if (err) -return err; + goto put_dev; pmbase &=0x0000FF00 ; -if (pmbase ==0 ) -return -EIO ; +if (pmbase ==0 ) { + err = -EIO ; + goto put_dev; + } priv =kzalloc (sizeof (*priv),GFP_KERNEL ); -if (!priv) -return -ENOMEM ; +if (!priv) { + err = -ENOMEM ; + goto put_dev; + }if (!request_region (pmbase +PMBASE_OFFSET ,PMBASE_SIZE ,DRV_NAME )) { dev_err(&pdev->dev, DRV_NAME " region 0x%x already in use!\n",
@@ -185,6 +189,8 @@ static int __init mod_init(void)release_region (pmbase +PMBASE_OFFSET ,PMBASE_SIZE ); out:kfree (priv); +put_dev: +pci_dev_put (pdev);return err; }
@@ -200,6 +206,8 @@ static void __exit mod_exit(void)release_region (priv->pmbase +PMBASE_OFFSET ,PMBASE_SIZE ); +pci_dev_put (priv->pcidev); +kfree (priv); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 155/338 hwrng: geode - Fix PCI device refcount leak
In reply to Greg Kroah-HartmanFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit 9f6ec8dc574efb7f4f3d7ee9cd59ae307e78f445 ]
for_each_pci_dev() is implemented by pci_get_device(). The comment of pci_get_device() says that it will increase the reference count for the returned pci_dev and also decrease the reference count for the input pci_dev @from if it is not NULL.
If we break for_each_pci_dev() loop with pdev not NULL, we need to call pci_dev_put() to decrease the reference count. We add a new struct 'amd_geode_priv' to record pointer of the pci_dev and membase, and then add missing pci_dev_put() for the normal and error path.
--- drivers/char/hw_random/geode-rng.c | 36 +++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-)
drivers/char/hw_random/geode-rng.c +28 -8
@@ -51,6 +51,10 @@ static const struct pci_device_id pci_tbl[] = { };MODULE_DEVICE_TABLE (pci, pci_tbl); +struct amd_geode_priv { +struct pci_dev *pcidev; +void __iomem *membase; +};static int geode_rng_data_read (struct hwrng *rng,u32 *data) {
@@ -90,6 +94,7 @@ static int __init mod_init(void)const struct pci_device_id *ent;void __iomem *mem;unsigned long rng_base; +struct amd_geode_priv *priv;for_each_pci_dev (pdev) { ent =pci_match_id (pci_tbl, pdev);
@@ -97,17 +102,26 @@ static int __init mod_init(void) goto found; }/* Device not found. */ - goto out; +return err; found: + priv =kzalloc (sizeof (*priv),GFP_KERNEL ); +if (!priv) { + err = -ENOMEM ; + goto put_dev; + } + rng_base =pci_resource_start (pdev,0 );if (rng_base ==0 ) - goto out; + goto free_priv; err = -ENOMEM ; mem =ioremap (rng_base,0x58 );if (!mem) - goto out; - geode_rng.priv = (unsigned long )mem; + goto free_priv; + + geode_rng.priv = (unsigned long )priv; + priv->membase = mem; + priv->pcidev = pdev;pr_info ("AMD Geode RNG detected\n" ); err =hwrng_register (&geode_rng);
@@ -116,20 +130,26 @@ static int __init mod_init(void) err); goto err_unmap; } -out:return err; err_unmap:iounmap (mem); - goto out; +free_priv: +kfree (priv); +put_dev: +pci_dev_put (pdev); +return err; } static void __exit mod_exit(void) { -void __iomem *mem = (void __iomem *)geode_rng.priv; +struct amd_geode_priv *priv; + priv = (struct amd_geode_priv *)geode_rng.priv;hwrng_unregister (&geode_rng); -iounmap (mem); +iounmap (priv->membase); +pci_dev_put (priv->pcidev); +kfree (priv); }module_init (mod_init);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 156/338 IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces
In reply to Greg Kroah-HartmanFrom: Dragos Tatulea <[email protected]>
[ Upstream commit dbc94a0fb81771a38733c0e8f2ea8c4fa6934dc1 ]
There are 2 ways to create IPoIB PKEY child interfaces:
1) Writing a PKEY to /sys/class/net/<ib parent interface>/create_child.
2) Using netlink with iproute.
While with sysfs the child interface has the same number of tx and rx queues as the parent, with netlink there will always be 1 tx and 1 rx queue for the child interface. That's because the get_num_tx/rx_queues() netlink ops are missing and the default value of 1 is taken for the number of queues (in rtnl_create_link()).
This change adds the get_num_tx/rx_queues() ops which allows for interfaces with multiple queues to be created over netlink. This constant only represents the max number of tx and rx queues on that net device.
--- drivers/infiniband/ulp/ipoib/ipoib_netlink.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/infiniband/ulp/ipoib/ipoib_netlink.c +7 -0
@@ -42,6 +42,11 @@ static const struct nla_policy ipoib_policy[IFLA_IPOIB_MAX + 1] = { [IFLA_IPOIB_UMCAST] = { .type = NLA_U16 }, }; +static unsigned int ipoib_get_max_num_queues (void ) +{ + return min_t(unsigned int, num_possible_cpus(), 128); +} +static int ipoib_fill_info (struct sk_buff *skb,const struct net_device *dev) {struct ipoib_dev_priv *priv =ipoib_priv (dev);
@@ -170,6 +175,8 @@ static struct rtnl_link_ops ipoib_link_ops __read_mostly = { .dellink = ipoib_unregister_child_dev, .get_size = ipoib_get_size, .fill_info = ipoib_fill_info, + .get_num_rx_queues = ipoib_get_max_num_queues, + .get_num_tx_queues = ipoib_get_max_num_queues, };int __init ipoib_netlink_init (void )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 157/338 drivers: dio: fix possible memory leak in dio_init()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit e63e99397b2613d50a5f4f02ed07307e67a190f1 ]
If device_register() returns error, the 'dev' and name needs be freed. Add a release function, and then call put_device() in the error path, so the name is freed in kobject_cleanup() and to the 'dev' is freed in release function.
--- drivers/dio/dio.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/dio/dio.c +8 -0
@@ -110,6 +110,12 @@ static char dio_no_name[] = { 0 };#endif /* CONFIG_DIO_CONSTANTS */ +static void dio_dev_release (struct device *dev) +{ + struct dio_dev *ddev = container_of(dev, typeof(struct dio_dev), dev); +kfree (ddev); +} +int __init dio_find (int deviceid) {/* Called to find a DIO device before the full bus scan has run.
@@ -222,6 +228,7 @@ static int __init dio_init(void) dev->bus = &dio_bus; dev->dev.parent = &dio_bus.dev; dev->dev.bus = &dio_bus_type; + dev->dev.release = dio_dev_release; dev->scode = scode; dev->resource.start = pa; dev->resource.end = pa +DIO_SIZE (scode, va);
@@ -249,6 +256,7 @@ static int __init dio_init(void)if (error) {pr_err ("DIO: Error registering device %s\n" , dev->name); +put_device (&dev->dev);continue ; } error =dio_create_sysfs_dev_files (dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 158/338 class: fix possible memory leak in __class_register()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 8c3e8a6bdb5253b97ad532570f8b5db5f7a06407 ]
If class_add_groups() returns error, the 'cp->subsys' need be unregister, and the 'cp' need be freed.
We can not call kset_unregister() here, because the 'cls' will be freed in callback function class_release() and it's also freed in caller's error path, it will cause double free.
So fix this by calling kobject_del() and kfree_const(name) to cleanup kobject. Besides, call kfree() to free the 'cp'.
Fault injection test can trigger this:
unreferenced object 0xffff888102fa8190 (size 8):
comm "modprobe", pid 502, jiffies 4294906074 (age 49.296s) hex dump (first 8 bytes):
70 6b 74 63 64 76 64 00 pktcdvd.
backtrace:
[<00000000e7c7703d>] __kmalloc_track_caller+0x1ae/0x320
[<000000005e4d70bc>] kstrdup+0x3a/0x70
[<00000000c2e5e85a>] kstrdup_const+0x68/0x80
[<000000000049a8c7>] kvasprintf_const+0x10b/0x190
[<0000000029123163>] kobject_set_name_vargs+0x56/0x150
[<00000000747219c9>] kobject_set_name+0xab/0xe0
[<0000000005f1ea4e>] __class_register+0x15c/0x49aunreferenced object 0xffff888037274000 (size 1024):
comm "modprobe", pid 502, jiffies 4294906074 (age 49.296s) hex dump (first 32 bytes):
00 40 27 37 80 88 ff ff 00 40 27 37 80 88 ff ff .@'7.....@'7....
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
backtrace:
[<00000000151f9600>] kmem_cache_alloc_trace+0x17c/0x2f0
[<00000000ecf3dd95>] __class_register+0x86/0x49a--- drivers/base/class.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/base/class.c +5 -0
@@ -187,6 +187,11 @@ int __class_register(struct class *cls, struct lock_class_key *key) } error =class_add_groups (class_get (cls), cls->class_groups);class_put (cls); +if (error) { +kobject_del (&cp->subsys.kobj); +kfree_const (cp->subsys.kobj.name); +kfree (cp); + }return error; }EXPORT_SYMBOL_GPL (__class_register);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 159/338 vfio: platform: Do not pass return buffer to ACPI _RST method
In reply to Greg Kroah-HartmanFrom: Rafael Mendonca <[email protected]>
[ Upstream commit e67e070632a665c932d534b8b800477bb3111449 ]
The ACPI _RST method has no return value, there's no need to pass a return buffer to acpi_evaluate_object().
--- drivers/vfio/platform/vfio_platform_common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/vfio/platform/vfio_platform_common.c +1 -2
@@ -77,12 +77,11 @@ static int vfio_platform_acpi_call_reset(struct vfio_platform_device *vdev, const char **extra_dbg) {#ifdef CONFIG_ACPI -struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL };struct device *dev = vdev->device;acpi_handle handle =ACPI_HANDLE (dev);acpi_status acpi_ret; - acpi_ret =acpi_evaluate_object (handle,"_RST" ,NULL , &buffer); + acpi_ret =acpi_evaluate_object (handle,"_RST" ,NULL ,NULL );if (ACPI_FAILURE (acpi_ret)) {if (extra_dbg) *extra_dbg =acpi_format_exception (acpi_ret);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 160/338 uio: uio_dmem_genirq: Fix missing unlock in irq configuration
In reply to Greg Kroah-HartmanFrom: Rafael Mendonca <[email protected]>
[ Upstream commit 9de255c461d1b3f0242b3ad1450c3323a3e00b34 ]
Commit b74351287d4b ("uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol()") started calling disable_irq() without holding the spinlock because it can sleep. However, that fix introduced another bug: if interrupt is already disabled and a new disable request comes in, then the spinlock is not unlocked:
root@localhost:~# printf '\x00\x00\x00\x00' > /dev/uio0 root@localhost:~# printf '\x00\x00\x00\x00' > /dev/uio0 root@localhost:~# [ 14.851538] BUG: scheduling while atomic: bash/223/0x00000002 [ 14.851991] Modules linked in: uio_dmem_genirq uio myfpga(OE) bochs drm_vram_helper drm_ttm_helper ttm drm_kms_helper drm snd_pcm ppdev joydev psmouse snd_timer snd e1000fb_sys_fops syscopyarea parport sysfillrect soundcore sysimgblt input_leds pcspkr i2c_piix4 serio_raw floppy evbug qemu_fw_cfg mac_hid pata_acpi ip_tables x_tables autofs4 [last unloaded: parport_pc] [ 14.854206] CPU: 0 PID: 223 Comm: bash Tainted: G OE 6.0.0-rc7 #21 [ 14.854786] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 [ 14.855664] Call Trace: [ 14.855861] <TASK> [ 14.856025] dump_stack_lvl+0x4d/0x67 [ 14.856325] dump_stack+0x14/0x1a [ 14.856583] __schedule_bug.cold+0x4b/0x5c [ 14.856915] __schedule+0xe81/0x13d0 [ 14.857199] ? idr_find+0x13/0x20 [ 14.857456] ? get_work_pool+0x2d/0x50 [ 14.857756] ? __flush_work+0x233/0x280 [ 14.858068] ? __schedule+0xa95/0x13d0 [ 14.858307] ? idr_find+0x13/0x20 [ 14.858519] ? get_work_pool+0x2d/0x50 [ 14.858798] schedule+0x6c/0x100 [ 14.859009] schedule_hrtimeout_range_clock+0xff/0x110 [ 14.859335] ? tty_write_room+0x1f/0x30 [ 14.859598] ? n_tty_poll+0x1ec/0x220 [ 14.859830] ? tty_ldisc_deref+0x1a/0x20 [ 14.860090] schedule_hrtimeout_range+0x17/0x20 [ 14.860373] do_select+0x596/0x840 [ 14.860627] ? __kernel_text_address+0x16/0x50 [ 14.860954] ? poll_freewait+0xb0/0xb0 [ 14.861235] ? poll_freewait+0xb0/0xb0 [ 14.861517] ? rpm_resume+0x49d/0x780 [ 14.861798] ? common_interrupt+0x59/0xa0 [ 14.862127] ? asm_common_interrupt+0x2b/0x40 [ 14.862511] ? __uart_start.isra.0+0x61/0x70 [ 14.862902] ? __check_object_size+0x61/0x280 [ 14.863255] core_sys_select+0x1c6/0x400 [ 14.863575] ? vfs_write+0x1c9/0x3d0 [ 14.863853] ? vfs_write+0x1c9/0x3d0 [ 14.864121] ? _copy_from_user+0x45/0x70 [ 14.864526] do_pselect.constprop.0+0xb3/0xf0 [ 14.864893] ? do_syscall_64+0x6d/0x90 [ 14.865228] ? do_syscall_64+0x6d/0x90 [ 14.865556] __x64_sys_pselect6+0x76/0xa0 [ 14.865906] do_syscall_64+0x60/0x90 [ 14.866214] ? syscall_exit_to_user_mode+0x2a/0x50 [ 14.866640] ? do_syscall_64+0x6d/0x90 [ 14.866972] ? do_syscall_64+0x6d/0x90 [ 14.867286] ? do_syscall_64+0x6d/0x90 [ 14.867626] entry_SYSCALL_64_after_hwframe+0x63/0xcd [...] stripped [ 14.872959] </TASK>
('myfpga' is a simple 'uio_dmem_genirq' driver I wrote to test this)
The implementation of "uio_dmem_genirq" was based on "uio_pdrv_genirq" and it is used in a similar manner to the "uio_pdrv_genirq" driver with respect to interrupt configuration and handling. At the time "uio_dmem_genirq" was introduced, both had the same implementation of the 'uio_info' handlers irqcontrol() and handler(). Then commit 34cb27528398 ("UIO: Fix concurrency issue"), which was only applied to "uio_pdrv_genirq", ended up making them a little different. That commit, among other things, changed disable_irq() to disable_irq_nosync() in the implementation of irqcontrol(). The motivation there was to avoid a deadlock between irqcontrol() and handler(), since it added a spinlock in the irq handler, and disable_irq() waits for the completion of the irq handler.
By changing disable_irq() to disable_irq_nosync() in irqcontrol(), we also avoid the sleeping-while-atomic bug that commit b74351287d4b ("uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol()") was trying to fix. Thus, this fixes the missing unlock in irqcontrol() by importing the implementation of irqcontrol() handler from the "uio_pdrv_genirq" driver. In the end, it reverts commit b74351287d4b ("uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol()") and change disable_irq() to disable_irq_nosync().
It is worth noting that this still does not address the concurrency issue fixed by commit 34cb27528398 ("UIO: Fix concurrency issue"). It will be addressed separately in the next commits.
Split out from commit 34cb27528398 ("UIO: Fix concurrency issue").
--- drivers/uio/uio_dmem_genirq.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/uio/uio_dmem_genirq.c +3 -5
@@ -135,13 +135,11 @@ static int uio_dmem_genirq_irqcontrol(struct uio_info *dev_info, s32 irq_on)if (irq_on) {if (test_and_clear_bit (0 , &priv->flags))enable_irq (dev_info->irq); -spin_unlock_irqrestore (&priv->lock, flags); }else { -if (!test_and_set_bit (0 , &priv->flags)) { -spin_unlock_irqrestore (&priv->lock, flags); -disable_irq (dev_info->irq); - } +if (!test_and_set_bit (0 , &priv->flags)) +disable_irq_nosync (dev_info->irq); } +spin_unlock_irqrestore (&priv->lock, flags);return 0 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 161/338 uio: uio_dmem_genirq: Fix deadlock between irq config and handling
In reply to Greg Kroah-HartmanFrom: Rafael Mendonca <[email protected]>
[ Upstream commit 118b918018175d9fcd8db667f905012e986cc2c9 ]
This fixes a concurrency issue addressed in commit 34cb27528398 ("UIO: Fix concurrency issue"):
"In a SMP case there was a race condition issue between Uio_pdrv_genirq_irqcontrol() running on one CPU and irq handler on another CPU. Fix it by spin_locking shared resources access inside irq handler."
The implementation of "uio_dmem_genirq" was based on "uio_pdrv_genirq" and it is used in a similar manner to the "uio_pdrv_genirq" driver with respect to interrupt configuration and handling. At the time "uio_dmem_genirq" was merged, both had the same implementation of the 'uio_info' handlers irqcontrol() and handler(), thus, both had the same concurrency issue mentioned by the above commit. However, the above patch was only applied to the "uio_pdrv_genirq" driver.
Split out from commit 34cb27528398 ("UIO: Fix concurrency issue").
--- drivers/uio/uio_dmem_genirq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/uio/uio_dmem_genirq.c +4 -1
@@ -113,8 +113,10 @@ static irqreturn_t uio_dmem_genirq_handler(int irq, struct uio_info *dev_info)* remember the state so we can allow user space to enable it later. */ +spin_lock (&priv->lock);if (!test_and_set_bit (0 , &priv->flags))disable_irq_nosync (irq); +spin_unlock (&priv->lock);return IRQ_HANDLED ; }
@@ -128,7 +130,8 @@ static int uio_dmem_genirq_irqcontrol(struct uio_info *dev_info, s32 irq_on)* in the interrupt controller, but keep track of the * state to prevent per-irq depth damage. * -* Serialize this operation to support multiple tasks. +* Serialize this operation to support multiple tasks and concurrency +* with irq handler on SMP systems. */ spin_lock_irqsave (&priv->lock, flags);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 162/338 usb: fotg210-udc: Fix ages old endianness issues
In reply to Greg Kroah-HartmanFrom: Linus Walleij <[email protected]>
[ Upstream commit 46ed6026ca2181c917c8334a82e3eaf40a6234dd ]
The code in the FOTG210 driver isn't entirely endianness-agnostic as reported by the kernel robot sparse testing. This came to the surface while moving the files around.
The driver is only used on little-endian systems, so this causes no real-world regression, but it is nice to be strict and have some compile coverage also on big endian machines, so fix it up with the right LE accessors.
--- drivers/usb/gadget/udc/fotg210-udc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/usb/gadget/udc/fotg210-udc.c +6 -6
@@ -636,10 +636,10 @@ static void fotg210_request_error(struct fotg210_udc *fotg210)static void fotg210_set_address (struct fotg210_udc *fotg210,struct usb_ctrlrequest *ctrl) { -if (ctrl->wValue >=0x0100 ) { +if (le16_to_cpu (ctrl->wValue) >=0x0100 ) {fotg210_request_error (fotg210); }else { -fotg210_set_dev_addr (fotg210, ctrl->wValue); +fotg210_set_dev_addr (fotg210,le16_to_cpu (ctrl->wValue));fotg210_set_cxdone (fotg210); } }
@@ -720,17 +720,17 @@ static void fotg210_get_status(struct fotg210_udc *fotg210,switch (ctrl->bRequestType &USB_RECIP_MASK ) {case USB_RECIP_DEVICE : - fotg210->ep0_data =1 <<USB_DEVICE_SELF_POWERED ; + fotg210->ep0_data =cpu_to_le16 (1 <<USB_DEVICE_SELF_POWERED );break ;case USB_RECIP_INTERFACE : - fotg210->ep0_data =0 ; + fotg210->ep0_data =cpu_to_le16 (0 );break ;case USB_RECIP_ENDPOINT : epnum = ctrl->wIndex &USB_ENDPOINT_NUMBER_MASK ;if (epnum) fotg210->ep0_data = -fotg210_is_epnstall (fotg210->ep[epnum]) - <<USB_ENDPOINT_HALT ; +cpu_to_le16 (fotg210_is_epnstall (fotg210->ep[epnum]) + <<USB_ENDPOINT_HALT );else fotg210_request_error (fotg210);break ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 145/338 scsi: hpsa: Fix error handling in hpsa_add_sas_host()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 4ef174a3ad9b5d73c1b6573e244ebba2b0d86eac ]
hpsa_sas_port_add_phy() does:
...
sas_phy_add() -> may return error here
sas_port_add_phy()
...
Whereas hpsa_free_sas_phy() does:
...
sas_port_delete_phy()
sas_phy_delete()
...
If hpsa_sas_port_add_phy() returns an error, hpsa_free_sas_phy() can not be called to free the memory because the port and the phy have not been added yet.
Replace hpsa_free_sas_phy() with sas_phy_free() and kfree() to avoid kernel crash in this case.
--- drivers/scsi/hpsa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/hpsa.c +2 -1
@@ -9452,7 +9452,8 @@ static int hpsa_add_sas_host(struct ctlr_info *h)return 0 ; free_sas_phy: -hpsa_free_sas_phy (hpsa_sas_phy); +sas_phy_free (hpsa_sas_phy->phy); +kfree (hpsa_sas_phy); free_sas_port:hpsa_free_sas_port (hpsa_sas_port); free_sas_node:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 163/338 staging: vme_user: Fix possible UAF in tsi148_dma_list_add
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
[ Upstream commit 357057ee55d3c99a5de5abe8150f7bca04f8e53b ]
Smatch report warning as follows:
drivers/staging/vme_user/vme_tsi148.c:1757 tsi148_dma_list_add() warn:
'&entry->list' not removed from list
In tsi148_dma_list_add(), the error path "goto err_dma" will not remove entry->list from list->entries, but entry will be freed, then list traversal may cause UAF.
Fix by removeing it from list->entries before free().
--- drivers/vme/bridges/vme_tsi148.c | 1 + 1 file changed, 1 insertion(+)
drivers/vme/bridges/vme_tsi148.c +1 -0
@@ -1778,6 +1778,7 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,return 0 ; err_dma: +list_del (&entry->list); err_dest: err_source: err_align:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 164/338 serial: amba-pl011: avoid SBSA UART accessing DMACR register
In reply to Greg Kroah-HartmanFrom: Jiamei Xie <[email protected]>
[ Upstream commit 94cdb9f33698478b0e7062586633c42c6158a786 ]
Chapter "B Generic UART" in "ARM Server Base System Architecture" [1] documentation describes a generic UART interface. Such generic UART does not support DMA. In current code, sbsa_uart_pops and amba_pl011_pops share the same stop_rx operation, which will invoke pl011_dma_rx_stop, leading to an access of the DMACR register. This commit adds a using_rx_dma check in pl011_dma_rx_stop to avoid the access to DMACR register for SBSA UARTs which does not support DMA.
When the kernel enables DMA engine with "CONFIG_DMA_ENGINE=y", Linux
SBSA PL011 driver will access PL011 DMACR register in some functions.
For most real SBSA Pl011 hardware implementations, the DMACR write
behaviour will be ignored. So these DMACR operations will not cause
obvious problems. But for some virtual SBSA PL011 hardware, like Xen
virtual SBSA PL011 (vpl011) device, the behaviour might be different.
Xen vpl011 emulation will inject a data abort to guest, when guest is
accessing an unimplemented UART register. As Xen VPL011 is SBSA
compatible, it will not implement DMACR register. So when Linux SBSA
PL011 driver access DMACR register, it will get an unhandled data abort
fault and the application will get a segmentation fault:
Unhandled fault at 0xffffffc00944d048
Mem abort info:
ESR = 0x96000000
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x00: ttbr address size fault
Data abort info:
ISV = 0, ISS = 0x00000000
CM = 0, WnR = 0
swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000020e2e000
[ffffffc00944d048] pgd=100000003ffff803, p4d=100000003ffff803, pud=100000003ffff803, pmd=100000003fffa803, pte=006800009c090f13
Internal error: ttbr address size fault: 96000000 [#1] PREEMPT SMP ... Call trace: pl011_stop_rx+0x70/0x80 tty_port_shutdown+0x7c/0xb4 tty_port_close+0x60/0xcc uart_close+0x34/0x8c tty_release+0x144/0x4c0 __fput+0x78/0x220 ____fput+0x1c/0x30 task_work_run+0x88/0xc0 do_notify_resume+0x8d0/0x123c el0_svc+0xa8/0xc0 el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x1a0/0x1a4 Code: b9000083 b901f001 794038a0 8b000042 (b9000041) ---[ end trace 83dd93df15c3216f ]---
note: bootlogd[132] exited with preempt_count 1 /etc/rcS.d/S07bootlogd: line 47: 132 Segmentation fault start-stop-daemon
This has been discussed in the Xen community, and we think it should fix this in Linux. See [2] for more information.
[1] https://developer.arm.com/documentation/den0094/c/?lang=en
[2] https://lists.xenproject.org/archives/html/xen-devel/2022-11/msg00543.html
--- drivers/tty/serial/amba-pl011.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/serial/amba-pl011.c +3 -0
@@ -1066,6 +1066,9 @@ static void pl011_dma_rx_callback(void *data)*/ static inline void pl011_dma_rx_stop (struct uart_amba_port *uap) { +if (!uap->using_rx_dma) +return ; +/* FIXME. Just disable the DMA enable */ uap->dmacr &= ~UART011_RXDMAE ;pl011_write (uap->dmacr, uap,REG_DMACR );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 165/338 serial: pch: Fix PCI device refcount leak in pch_request_dma()
In reply to Greg Kroah-HartmanFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit 8be3a7bf773700534a6e8f87f6ed2ed111254be5 ]
As comment of pci_get_slot() says, it returns a pci_device with its refcount increased. The caller must decrement the reference count by calling pci_dev_put().
Since 'dma_dev' is only used to filter the channel in filter(), we can call pci_dev_put() before exiting from pch_request_dma(). Add the missing pci_dev_put() for the normal and error path.
--- drivers/tty/serial/pch_uart.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/tty/serial/pch_uart.c +4 -0
@@ -748,6 +748,7 @@ static void pch_request_dma(struct uart_port *port)if (!chan) {dev_err (priv->port.dev,"%s:dma_request_channel FAILS(Tx)\n" , __func__); +pci_dev_put (dma_dev);return ; } priv->chan_tx = chan;
@@ -764,6 +765,7 @@ static void pch_request_dma(struct uart_port *port) __func__);dma_release_channel (priv->chan_tx); priv->chan_tx =NULL ; +pci_dev_put (dma_dev);return ; }
@@ -771,6 +773,8 @@ static void pch_request_dma(struct uart_port *port) priv->rx_buf_virt =dma_alloc_coherent (port->dev, port->fifosize, &priv->rx_buf_dma,GFP_KERNEL ); priv->chan_rx = chan; + +pci_dev_put (dma_dev); }static void pch_dma_rx_complete (void *arg)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 166/338 serial: sunsab: Fix error handling in sunsab_init()
In reply to Greg Kroah-HartmanFrom: Yuan Can <[email protected]>
[ Upstream commit 1a6ec673fb627c26e2267ca0a03849f91dbd9b40 ]
The sunsab_init() returns the platform_driver_register() directly without checking its return value, if platform_driver_register() failed, the allocated sunsab_ports is leaked.
Fix by free sunsab_ports and set it to NULL when platform_driver_register() failed.
--- drivers/tty/serial/sunsab.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/tty/serial/sunsab.c +7 -1
@@ -1138,7 +1138,13 @@ static int __init sunsab_init(void) } } -return platform_driver_register (&sab_driver); + err =platform_driver_register (&sab_driver); +if (err) { +kfree (sunsab_ports); + sunsab_ports =NULL ; + } + +return err; } static void __exit sunsab_exit(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 167/338 test_firmware: fix memory leak in test_firmware_init()
In reply to Greg Kroah-HartmanFrom: Zhengchao Shao <[email protected]>
[ Upstream commit 7610615e8cdb3f6f5bbd9d8e7a5d8a63e3cabf2e ]
When misc_register() failed in test_firmware_init(), the memory pointed by test_fw_config->name is not released. The memory leak information is as follows:
unreferenced object 0xffff88810a34cb00 (size 32):
comm "insmod", pid 7952, jiffies 4294948236 (age 49.060s) hex dump (first 32 bytes):
74 65 73 74 2d 66 69 72 6d 77 61 72 65 2e 62 69 test-firmware.bi
6e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 n...............
backtrace:
[<ffffffff81b21fcb>] __kmalloc_node_track_caller+0x4b/0xc0
[<ffffffff81affb96>] kstrndup+0x46/0xc0
[<ffffffffa0403a49>] __test_firmware_config_init+0x29/0x380 [test_firmware]
[<ffffffffa040f068>] 0xffffffffa040f068
[<ffffffff81002c41>] do_one_initcall+0x141/0x780
[<ffffffff816a72c3>] do_init_module+0x1c3/0x630
[<ffffffff816adb9e>] load_module+0x623e/0x76a0
[<ffffffff816af471>] __do_sys_finit_module+0x181/0x240
[<ffffffff89978f99>] do_syscall_64+0x39/0xb0
[<ffffffff89a0008b>] entry_SYSCALL_64_after_hwframe+0x63/0xcd--- lib/test_firmware.c | 1 + 1 file changed, 1 insertion(+)
lib/test_firmware.c +1 -0
@@ -903,6 +903,7 @@ static int __init test_firmware_init(void) rc =misc_register (&test_fw_misc_device);if (rc) { +__test_firmware_config_free ();kfree (test_fw_config);pr_err ("could not register misc device: %d\n" , rc);return rc;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 168/338 misc: tifm: fix possible memory leak in tifm_7xx1_switch_media()
In reply to Greg Kroah-HartmanFrom: ruanjinjie <[email protected]>
[ Upstream commit fd2c930cf6a5b9176382c15f9acb1996e76e25ad ]
If device_register() returns error in tifm_7xx1_switch_media(), name of kobject which is allocated in dev_set_name() called in device_add() is leaked.
Never directly free @dev after calling device_register(), even if it returned an error! Always use put_device() to give up the reference initialized.
--- drivers/misc/tifm_7xx1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/tifm_7xx1.c +1 -1
@@ -194,7 +194,7 @@ static void tifm_7xx1_switch_media(struct work_struct *work)spin_unlock_irqrestore (&fm->lock, flags); }if (sock) -tifm_free_device (&sock->dev); +put_device (&sock->dev); }spin_lock_irqsave (&fm->lock, flags); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 169/338 misc: sgi-gru: fix use-after-free error in gru_set_context_option, gru_fault and gru_handle_user_call_os
In reply to Greg Kroah-HartmanFrom: Zheng Wang <[email protected]>
[ Upstream commit 643a16a0eb1d6ac23744bb6e90a00fc21148a9dc ]
In some bad situation, the gts may be freed gru_check_chiplet_assignment. The call chain can be gru_unload_context->gru_free_gru_context->gts_drop and kfree finally. However, the caller didn't know if the gts is freed or not and use it afterwards. This will trigger a Use after Free bug.
Fix it by introducing a return value to see if it's in error path or not. Free the gts in caller if gru_check_chiplet_assignment check failed.
--- drivers/misc/sgi-gru/grufault.c | 13 +++++++++++-- drivers/misc/sgi-gru/grumain.c | 22 ++++++++++++++++++---- drivers/misc/sgi-gru/grutables.h | 2 +- 3 files changed, 30 insertions(+), 7 deletions(-)
drivers/misc/sgi-gru/grufault.c +11 -2
@@ -661,6 +661,7 @@ int gru_handle_user_call_os(unsigned long cb)if ((cb & (GRU_HANDLE_STRIDE -1 )) || ucbnum >=GRU_NUM_CB )return -EINVAL ; +again: gts =gru_find_lock_gts (cb);if (!gts)return -EINVAL ;
@@ -669,7 +670,11 @@ int gru_handle_user_call_os(unsigned long cb)if (ucbnum >= gts->ts_cbr_au_count *GRU_CBR_AU_SIZE ) goto exit; -gru_check_context_placement (gts); +if (gru_check_context_placement (gts)) { +gru_unlock_gts (gts); +gru_unload_context (gts,1 ); + goto again; + }/* * CCH may contain stale data if ts_force_cch_reload is set.
@@ -887,7 +892,11 @@ int gru_set_context_option(unsigned long arg) }else { gts->ts_user_blade_id = req.val1; gts->ts_user_chiplet_id = req.val0; -gru_check_context_placement (gts); +if (gru_check_context_placement (gts)) { +gru_unlock_gts (gts); +gru_unload_context (gts,1 ); +return ret; + } }break ;case sco_gseg_owner:
drivers/misc/sgi-gru/grumain.c +18 -4
@@ -729,9 +729,10 @@ static int gru_check_chiplet_assignment(struct gru_state *gru,* chiplet. Misassignment can occur if the process migrates to a different * blade or if the user changes the selected blade/chiplet. */ -void gru_check_context_placement (struct gru_thread_state *gts) +int gru_check_context_placement (struct gru_thread_state *gts) {struct gru_state *gru; +int ret =0 ;/* * If the current task is the context owner, verify that the
@@ -739,15 +740,23 @@ void gru_check_context_placement(struct gru_thread_state *gts)* references. Pthread apps use non-owner references to the CBRs. */ gru = gts->ts_gru; +/* +* If gru or gts->ts_tgid_owner isn't initialized properly, return +* success to indicate that the caller does not need to unload the +* gru context.The caller is responsible for their inspection and +* reinitialization if needed. +*/ if (!gru || gts->ts_tgid_owner != current->tgid) -return ; +return ret;if (!gru_check_chiplet_assignment (gru, gts)) {STAT (check_context_unload); -gru_unload_context (gts,1 ); + ret = -EINVAL ; }else if (gru_retarget_intr (gts)) {STAT (check_context_retarget_intr); } + +return ret; }
@@ -947,7 +956,12 @@ int gru_fault(struct vm_fault *vmf)mutex_lock (>s->ts_ctxlock);preempt_disable (); -gru_check_context_placement (gts); +if (gru_check_context_placement (gts)) { +preempt_enable (); +mutex_unlock (>s->ts_ctxlock); +gru_unload_context (gts,1 ); +return VM_FAULT_NOPAGE ; + }if (!gts->ts_gru) {STAT (load_user_context);
drivers/misc/sgi-gru/grutables.h +1 -1
@@ -651,7 +651,7 @@ extern int gru_user_flush_tlb(unsigned long arg);extern int gru_user_unload_context (unsigned long arg);extern int gru_get_exception_detail (unsigned long arg);extern int gru_set_context_option (unsigned long address); -extern void gru_check_context_placement (struct gru_thread_state *gts); +extern int gru_check_context_placement (struct gru_thread_state *gts);extern int gru_cpu_fault_map_id (void );extern struct vm_area_struct *gru_find_vma (unsigned long vaddr);extern void gru_flush_all_tlb (struct gru_state *gru);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 170/338 cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 61c80d1c3833e196256fb060382db94f24d3d9a7 ]
If device_register() fails in cxl_register_afu|adapter(), the device is not added, device_unregister() can not be called in the error path, otherwise it will cause a null-ptr-deref because of removing not added device.
As comment of device_register() says, it should use put_device() to give up the reference in the error path. So split device_unregister() into device_del() and put_device(), then goes to put dev when register fails.
--- drivers/misc/cxl/guest.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
drivers/misc/cxl/guest.c +14 -10
@@ -971,10 +971,10 @@ int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_n* if it returns an error! */ if ((rc =cxl_register_afu (afu))) - goto err_put1; + goto err_put_dev;if ((rc =cxl_sysfs_afu_add (afu))) - goto err_put1; + goto err_del_dev;/* * pHyp doesn't expose the programming models supported by the
@@ -990,7 +990,7 @@ int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_n afu->modes_supported =CXL_MODE_DIRECTED ;if ((rc =cxl_afu_select_best_mode (afu))) - goto err_put2; + goto err_remove_sysfs; adapter->afu[afu->slice] = afu;
@@ -1010,10 +1010,12 @@ int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_nreturn 0 ; -err_put2: +err_remove_sysfs:cxl_sysfs_afu_remove (afu); -err_put1: -device_unregister (&afu->dev); +err_del_dev: +device_del (&afu->dev); +err_put_dev: +put_device (&afu->dev); free = false;guest_release_serr_irq (afu); err2:
@@ -1147,18 +1149,20 @@ struct cxl *cxl_guest_init_adapter(struct device_node *np, struct platform_devic* even if it returns an error! */ if ((rc =cxl_register_adapter (adapter))) - goto err_put1; + goto err_put_dev;if ((rc =cxl_sysfs_adapter_add (adapter))) - goto err_put1; + goto err_del_dev;/* release the context lock as the adapter is configured */ cxl_adapter_context_unlock (adapter);return adapter; -err_put1: -device_unregister (&adapter->dev); +err_del_dev: +device_del (&adapter->dev); +err_put_dev: +put_device (&adapter->dev); free = false;cxl_guest_remove_chardev (adapter); err1:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 171/338 cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 02cd3032b154fa02fdf90e7467abaeed889330b2 ]
If device_register() fails in cxl_pci_afu|adapter(), the device is not added, device_unregister() can not be called in the error path, otherwise it will cause a null-ptr-deref because of removing not added device.
As comment of device_register() says, it should use put_device() to give up the reference in the error path. So split device_unregister() into device_del() and put_device(), then goes to put dev when register fails.
--- drivers/misc/cxl/pci.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/misc/cxl/pci.c +12 -8
@@ -1398,10 +1398,10 @@ static int pci_init_afu(struct cxl *adapter, int slice, struct pci_dev *dev)* if it returns an error! */ if ((rc =cxl_register_afu (afu))) - goto err_put1; + goto err_put_dev;if ((rc =cxl_sysfs_afu_add (afu))) - goto err_put1; + goto err_del_dev; adapter->afu[afu->slice] = afu;
@@ -1410,10 +1410,12 @@ static int pci_init_afu(struct cxl *adapter, int slice, struct pci_dev *dev)return 0 ; -err_put1: +err_del_dev: +device_del (&afu->dev); +err_put_dev:pci_deconfigure_afu (afu);cxl_debugfs_afu_remove (afu); -device_unregister (&afu->dev); +put_device (&afu->dev);return rc; err_free_native:
@@ -1874,23 +1876,25 @@ static struct cxl *cxl_pci_init_adapter(struct pci_dev *dev)* even if it returns an error! */ if ((rc =cxl_register_adapter (adapter))) - goto err_put1; + goto err_put_dev;if ((rc =cxl_sysfs_adapter_add (adapter))) - goto err_put1; + goto err_del_dev;/* Release the context lock as adapter is configured */ cxl_adapter_context_unlock (adapter);return adapter; -err_put1: +err_del_dev: +device_del (&adapter->dev); +err_put_dev:/* This should mirror cxl_remove_adapter, except without the * sysfs parts */ cxl_debugfs_adapter_remove (adapter);cxl_deconfigure_adapter (adapter); -device_unregister (&adapter->dev); +put_device (&adapter->dev);return ERR_PTR (rc); err_release:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 172/338 drivers: mcb: fix resource leak in mcb_probe()
In reply to Greg Kroah-HartmanFrom: Zhengchao Shao <[email protected]>
[ Upstream commit d7237462561fcd224fa687c56ccb68629f50fc0d ]
When probe hook function failed in mcb_probe(), it doesn't put the device. Compiled test only.
--- drivers/mcb/mcb-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mcb/mcb-core.c +3 -1
@@ -74,8 +74,10 @@ static int mcb_probe(struct device *dev)get_device (dev); ret = mdrv->probe (mdev, found_id); -if (ret) +if (ret) {module_put (carrier_mod); +put_device (dev); + }return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 146/338 scsi: hpsa: Fix possible memory leak in hpsa_add_sas_device()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit fda34a5d304d0b98cc967e8763b52221b66dc202 ]
If hpsa_sas_port_add_rphy() returns an error, the 'rphy' allocated in sas_end_device_alloc() needs to be freed. Address this by calling sas_rphy_free() in the error path.
--- drivers/scsi/hpsa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/hpsa.c +3 -1
@@ -9489,10 +9489,12 @@ static int hpsa_add_sas_device(struct hpsa_sas_node *hpsa_sas_node, rc =hpsa_sas_port_add_rphy (hpsa_sas_port, rphy);if (rc) - goto free_sas_port; + goto free_sas_rphy;return 0 ; +free_sas_rphy: +sas_rphy_free (rphy); free_sas_port:hpsa_free_sas_port (hpsa_sas_port); device->sas_port =NULL ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 173/338 mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 728ac3389296caf68638628c987aeae6c8851e2d ]
If mcb_device_register() returns error in chameleon_parse_gdd(), the refcount of bus and device name are leaked. Fix this by calling put_device() to give up the reference, so they can be released in mcb_release_dev() and kobject_cleanup().
--- drivers/mcb/mcb-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mcb/mcb-parse.c +1 -1
@@ -107,7 +107,7 @@ static int chameleon_parse_gdd(struct mcb_bus *bus,return 0 ; err: -mcb_free_dev (mdev); +put_device (&mdev->dev);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 174/338 chardev: fix error handling in cdev_device_add()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 11fa7fefe3d8fac7da56bc9aa3dd5fb3081ca797 ]
While doing fault injection test, I got the following report:
------------[ cut here ]------------ kobject: '(null)' (0000000039956980): is not initialized, yet kobject_put() is being called. WARNING: CPU: 3 PID: 6306 at kobject_put+0x23d/0x4e0 CPU: 3 PID: 6306 Comm: 283 Tainted: G W 6.1.0-rc2-00005-g307c1086d7c9 #1253 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:kobject_put+0x23d/0x4e0 Call Trace: <TASK> cdev_device_add+0x15e/0x1b0 __iio_device_register+0x13b4/0x1af0 [industrialio] __devm_iio_device_register+0x22/0x90 [industrialio] max517_probe+0x3d8/0x6b4 [max517] i2c_device_probe+0xa81/0xc00
When device_add() is injected fault and returns error, if dev->devt is not set, cdev_add() is not called, cdev_del() is not needed. Fix this by checking dev->devt in error path.
--- fs/char_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/char_dev.c +1 -1
@@ -553,7 +553,7 @@ int cdev_device_add(struct cdev *cdev, struct device *dev) } rc =device_add (dev); -if (rc) +if (rc && dev->devt)cdev_del (cdev);return rc;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 175/338 i2c: pxa-pci: fix missing pci_disable_device() on error in ce4100_i2c_probe
In reply to Greg Kroah-HartmanFrom: Hui Tang <[email protected]>
[ Upstream commit d78a167332e1ca8113268ed922c1212fd71b73ad ]
Using pcim_enable_device() to avoid missing pci_disable_device().
--- drivers/i2c/busses/i2c-pxa-pci.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/i2c/busses/i2c-pxa-pci.c +3 -7
@@ -105,7 +105,7 @@ static int ce4100_i2c_probe(struct pci_dev *dev,int i;struct ce4100_devices *sds; - ret =pci_enable_device_mem (dev); + ret =pcim_enable_device (dev);if (ret)return ret;
@@ -114,10 +114,8 @@ static int ce4100_i2c_probe(struct pci_dev *dev,return -EINVAL ; } sds =kzalloc (sizeof (*sds),GFP_KERNEL ); -if (!sds) { - ret = -ENOMEM ; - goto err_mem; - } +if (!sds) +return -ENOMEM ;for (i =0 ; i <ARRAY_SIZE (sds->pdev); i++) { sds->pdev[i] =add_i2c_device (dev, i);
@@ -133,8 +131,6 @@ static int ce4100_i2c_probe(struct pci_dev *dev, err_dev_add:kfree (sds); -err_mem: -pci_disable_device (dev);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 147/338 scsi: fcoe: Fix possible name leak when device_register() fails
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 47b6a122c7b69a876c7ee2fc064a26b09627de9d ]
If device_register() returns an error, the name allocated by dev_set_name() needs to be freed. As the comment of device_register() says, one should use put_device() to give up the reference in the error path. Fix this by calling put_device(), then the name can be freed in kobject_cleanup().
The 'fcf' is freed in fcoe_fcf_device_release(), so the kfree() in the error path can be removed.
The 'ctlr' is freed in fcoe_ctlr_device_release(), so don't use the error label, just return NULL after calling put_device().
--- drivers/scsi/fcoe/fcoe_sysfs.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/scsi/fcoe/fcoe_sysfs.c +10 -9
@@ -831,14 +831,15 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,dev_set_name (&ctlr->dev,"ctlr_%d" , ctlr->id); error =device_register (&ctlr->dev); -if (error) - goto out_del_q2; +if (error) { +destroy_workqueue (ctlr->devloss_work_q); +destroy_workqueue (ctlr->work_q); +put_device (&ctlr->dev); +return NULL ; + }return ctlr; -out_del_q2: -destroy_workqueue (ctlr->devloss_work_q); - ctlr->devloss_work_q =NULL ; out_del_q:destroy_workqueue (ctlr->work_q); ctlr->work_q =NULL ;
@@ -1037,16 +1038,16 @@ struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *ctlr, fcf->selected = new_fcf->selected; error =device_register (&fcf->dev); -if (error) - goto out_del; +if (error) { +put_device (&fcf->dev); + goto out; + } fcf->state =FCOE_FCF_STATE_CONNECTED ;list_add_tail (&fcf->peers, &ctlr->fcfs);return fcf; -out_del: -kfree (fcf); out:return NULL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 148/338 scsi: ipr: Fix WARNING in ipr_init()
In reply to Greg Kroah-HartmanFrom: Shang XiaoJing <[email protected]>
[ Upstream commit e6f108bffc3708ddcff72324f7d40dfcd0204894 ]
ipr_init() will not call unregister_reboot_notifier() when pci_register_driver() fails, which causes a WARNING. Call unregister_reboot_notifier() when pci_register_driver() fails.
notifier callback ipr_halt [ipr] already registered
WARNING: CPU: 3 PID: 299 at kernel/notifier.c:29 notifier_chain_register+0x16d/0x230 Modules linked in: ipr(+) xhci_pci_renesas xhci_hcd ehci_hcd usbcore led_class gpu_sched drm_buddy video wmi drm_ttm_helper ttm drm_display_helper drm_kms_helper drm drm_panel_orientation_quirks agpgart cfbft CPU: 3 PID: 299 Comm: modprobe Tainted: G W 6.1.0-rc1-00190-g39508d23b672-dirty #332 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 RIP: 0010:notifier_chain_register+0x16d/0x230 Call Trace: <TASK> __blocking_notifier_chain_register+0x73/0xb0 ipr_init+0x30/0x1000 [ipr] do_one_initcall+0xdb/0x480 do_init_module+0x1cf/0x680 load_module+0x6a50/0x70a0 __do_sys_finit_module+0x12f/0x1c0 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd
--- drivers/scsi/ipr.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/scsi/ipr.c +9 -1
@@ -10858,11 +10858,19 @@ static struct notifier_block ipr_notifier = {**/ static int __init ipr_init (void ) { +int rc; +ipr_info ("IBM Power RAID SCSI Device Driver version: %s %s\n" ,IPR_DRIVER_VERSION ,IPR_DRIVER_DATE );register_reboot_notifier (&ipr_notifier); -return pci_register_driver (&ipr_driver); + rc =pci_register_driver (&ipr_driver); +if (rc) { +unregister_reboot_notifier (&ipr_notifier); +return rc; + } + +return 0 ; }/**
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 149/338 scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
In reply to Greg Kroah-HartmanFrom: Chen Zhongjin <[email protected]>
[ Upstream commit 4155658cee394b22b24c6d64e49247bf26d95b92 ]
fcoe_init() calls fcoe_transport_attach(&fcoe_sw_transport), but when fcoe_if_init() fails, &fcoe_sw_transport is not detached and leaves freed &fcoe_sw_transport on fcoe_transports list. This causes panic when reinserting module.
BUG: unable to handle page fault for address: fffffbfff82e2213 RIP: 0010:fcoe_transport_attach+0xe1/0x230 [libfcoe] Call Trace: <TASK> do_one_initcall+0xd0/0x4e0 load_module+0x5eee/0x7210 ...
--- drivers/scsi/fcoe/fcoe.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/fcoe/fcoe.c +1 -0
@@ -2531,6 +2531,7 @@ static int __init fcoe_init(void) out_free:mutex_unlock (&fcoe_config_mutex); +fcoe_transport_detach (&fcoe_sw_transport); out_destroy:destroy_workqueue (fcoe_wq);return rc;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 150/338 scsi: snic: Fix possible UAF in snic_tgt_create()
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
[ Upstream commit e118df492320176af94deec000ae034cc92be754 ]
Smatch reports a warning as follows:
drivers/scsi/snic/snic_disc.c:307 snic_tgt_create() warn:
'&tgt->list' not removed from list
If device_add() fails in snic_tgt_create(), tgt will be freed, but tgt->list will not be removed from snic->disc.tgt_list, then list traversal may cause UAF.
Remove from snic->disc.tgt_list before free().
--- drivers/scsi/snic/snic_disc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/snic/snic_disc.c +3 -0
@@ -317,6 +317,9 @@ snic_tgt_create(struct snic *snic, struct snic_tgt_id *tgtid) ret);put_device (&snic->shost->shost_gendev); +spin_lock_irqsave (snic->shost->host_lock, flags); +list_del (&tgt->list); +spin_unlock_irqrestore (snic->shost->host_lock, flags);kfree (tgt); tgt =NULL ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 151/338 RDMA/hfi1: Fix error return code in parse_platform_config()
In reply to Greg Kroah-HartmanFrom: Wang Yufen <[email protected]>
[ Upstream commit 725349f8ba1e78a146c6ff8f3ee5e2712e517106 ]
In the previous iteration of the while loop, the "ret" may have been assigned a value of 0, so the error return code -EINVAL may have been incorrectly set to 0. To fix set valid return code before calling to goto.
--- drivers/infiniband/hw/hfi1/firmware.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/infiniband/hw/hfi1/firmware.c +6 -0
@@ -1761,6 +1761,7 @@ int parse_platform_config(struct hfi1_devdata *dd)if (!dd->platform_config.data) {dd_dev_err (dd,"%s: Missing config file\n" , __func__); + ret = -EINVAL ; goto bail; } ptr = (u32 *)dd->platform_config.data;
@@ -1769,6 +1770,7 @@ int parse_platform_config(struct hfi1_devdata *dd) ptr++;if (magic_num !=PLATFORM_CONFIG_MAGIC_NUM ) {dd_dev_err (dd,"%s: Bad config file\n" , __func__); + ret = -EINVAL ; goto bail; }
@@ -1779,6 +1781,7 @@ int parse_platform_config(struct hfi1_devdata *dd)if (file_length > dd->platform_config.size) {dd_dev_info (dd,"%s:File claims to be larger than read size\n" , __func__); + ret = -EINVAL ; goto bail; }else if (file_length < dd->platform_config.size) { dd_dev_info(dd,
@@ -1798,6 +1801,7 @@ int parse_platform_config(struct hfi1_devdata *dd)dd_dev_err (dd,"%s: Failed validation at offset %ld\n" , __func__, (ptr - (u32 *) dd->platform_config.data)); + ret = -EINVAL ; goto bail; }
@@ -1844,6 +1848,7 @@ int parse_platform_config(struct hfi1_devdata *dd) __func__, table_type, (ptr - (u32 *) dd->platform_config.data)); + ret = -EINVAL ; goto bail;/* We don't trust this file now */ } pcfgcache->config_tables[table_type].table = ptr;
@@ -1868,6 +1873,7 @@ int parse_platform_config(struct hfi1_devdata *dd) __func__, table_type, (ptr - (u32 *)dd->platform_config.data)); + ret = -EINVAL ; goto bail;/* We don't trust this file now */ } pcfgcache->config_tables[table_type].table_metadata =
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 152/338 orangefs: Fix sysfs not cleanup when dev init failed
In reply to Greg Kroah-HartmanFrom: Zhang Xiaoxu <[email protected]>
[ Upstream commit ea60a4ad0cf88b411cde6888b8c890935686ecd7 ]
When the dev init failed, should cleanup the sysfs, otherwise, the module will never be loaded since can not create duplicate sysfs directory:
sysfs: cannot create duplicate filename '/fs/orangefs'
CPU: 1 PID: 6549 Comm: insmod Tainted: G W 6.0.0+ #44 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x34/0x44 sysfs_warn_dup.cold+0x17/0x24 sysfs_create_dir_ns+0x16d/0x180 kobject_add_internal+0x156/0x3a0 kobject_init_and_add+0xcf/0x120 orangefs_sysfs_init+0x7e/0x3a0 [orangefs] orangefs_init+0xfe/0x1000 [orangefs] do_one_initcall+0x87/0x2a0 do_init_module+0xdf/0x320 load_module+0x2f98/0x3330 __do_sys_finit_module+0x113/0x1b0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0
kobject_add_internal failed for orangefs with -EEXIST, don't try to register things with the same name in the same directory.
--- fs/orangefs/orangefs-mod.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/orangefs/orangefs-mod.c +4 -4
@@ -141,7 +141,7 @@ static int __init orangefs_init(void)gossip_err ("%s: could not initialize device subsystem %d!\n" , __func__, ret); - goto cleanup_device; + goto cleanup_sysfs; } ret =register_filesystem (&orangefs_fs_type);
@@ -153,11 +153,11 @@ static int __init orangefs_init(void) goto out; } -orangefs_sysfs_exit (); - -cleanup_device:orangefs_dev_cleanup (); +cleanup_sysfs: +orangefs_sysfs_exit (); + sysfs_init_failed: debugfs_init_failed:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 143/338 RDMA/hfi: Decrease PCI device reference count in error path
In reply to Greg Kroah-HartmanFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit 9b51d072da1d27e1193e84708201c48e385ad912 ]
pci_get_device() will increase the reference count for the returned pci_dev, and also decrease the reference count for the input parameter *from* if it is not NULL.
If we break out the loop in node_affinity_init() with 'dev' not NULL, we need to call pci_dev_put() to decrease the reference count. Add missing pci_dev_put() in error path.
--- drivers/infiniband/hw/hfi1/affinity.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/infiniband/hw/hfi1/affinity.c +2 -0
@@ -165,6 +165,8 @@ int node_affinity_init(void)for (node =0 ; node < node_affinity.num_possible_nodes; node++) hfi1_per_node_cntr[node] =1 ; +pci_dev_put (dev); +return 0 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 177/338 staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
[ Upstream commit d30f4436f364b4ad915ca2c09be07cd0f93ceb44 ]
The skb is delivered to netif_rx() in rtllib_monitor_rx(), which may free it, after calling this, dereferencing skb may trigger use-after-free. Found by Smatch.
--- drivers/staging/rtl8192e/rtllib_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtllib_rx.c +1 -1
@@ -1501,9 +1501,9 @@ static int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb, hdrlen +=4 ; } -rtllib_monitor_rx (ieee, skb, rx_stats, hdrlen); ieee->stats.rx_packets++; ieee->stats.rx_bytes += skb->len; +rtllib_monitor_rx (ieee, skb, rx_stats, hdrlen);return 1 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 186/338 HSI: omap_ssi_core: fix unbalanced pm_runtime_disable()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit f5181c35ed7ba0ceb6e42872aad1334d994b0175 ]
In error label 'out1' path in ssi_probe(), the pm_runtime_enable() has not been called yet, so pm_runtime_disable() is not needed.
--- drivers/hsi/controllers/omap_ssi_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hsi/controllers/omap_ssi_core.c +1 -1
@@ -572,9 +572,9 @@ static int ssi_probe(struct platform_device *pd)device_for_each_child (&pd->dev,NULL , ssi_remove_ports); out2:ssi_remove_controller (ssi); +pm_runtime_disable (&pd->dev); out1:platform_set_drvdata (pd,NULL ); -pm_runtime_disable (&pd->dev);return err; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 187/338 HSI: omap_ssi_core: fix possible memory leak in ssi_probe()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 1aff514e1d2bd47854dbbdf867970b9d463d4c57 ]
If ssi_add_controller() returns error, it should call hsi_put_controller() to give up the reference that was set in hsi_alloc_controller(), so that it can call hsi_controller_release() to free controller and ports that allocated in hsi_alloc_controller().
--- drivers/hsi/controllers/omap_ssi_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hsi/controllers/omap_ssi_core.c +3 -1
@@ -538,8 +538,10 @@ static int ssi_probe(struct platform_device *pd)platform_set_drvdata (pd, ssi); err =ssi_add_controller (ssi, pd); -if (err <0 ) +if (err <0 ) { +hsi_put_controller (ssi); goto out1; + }pm_runtime_enable (&pd->dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 188/338 power: supply: fix residue sysfs file in error handle route of __power_supply_register()
In reply to Greg Kroah-HartmanFrom: Zeng Heng <[email protected]>
[ Upstream commit 5b79480ce1978864ac3f06f2134dfa3b6691fe74 ]
If device_add() succeeds, we should call device_del() when want to get rid of it, so move it into proper jump symbol.
Otherwise, when __power_supply_register() returns fail and goto wakeup_init_failed to exit, there is still residue device file in sysfs. When attempt to probe device again, sysfs would complain as below:
sysfs: cannot create duplicate filename '/devices/platform/i2c/i2c-0/0-001c/power_supply/adp5061'
Call Trace: dump_stack_lvl+0x68/0x85 sysfs_warn_dup.cold+0x1c/0x29 sysfs_create_dir_ns+0x1b1/0x1d0 kobject_add_internal+0x143/0x390 kobject_add+0x108/0x170
--- drivers/power/supply/power_supply_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/power_supply_core.c +1 -1
@@ -934,8 +934,8 @@ __power_supply_register(struct device *parent, register_cooler_failed:psy_unregister_thermal (psy); register_thermal_failed: -device_del (dev); wakeup_init_failed: +device_del (dev); device_add_failed: check_supplies_failed: dev_set_name_failed:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 189/338 HSI: omap_ssi_core: Fix error handling in ssi_init()
In reply to Greg Kroah-HartmanFrom: Yuan Can <[email protected]>
[ Upstream commit 3ffa9f713c39a213a08d9ff13ab983a8aa5d8b5d ]
The ssi_init() returns the platform_driver_register() directly without checking its return value, if platform_driver_register() failed, the ssi_pdriver is not unregistered.
Fix by unregister ssi_pdriver when the last platform_driver_register() failed.
--- drivers/hsi/controllers/omap_ssi_core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hsi/controllers/omap_ssi_core.c +7 -1
@@ -667,7 +667,13 @@ static int __init ssi_init(void) {if (ret)return ret; -return platform_driver_register (&ssi_port_pdriver); + ret =platform_driver_register (&ssi_port_pdriver); +if (ret) { +platform_driver_unregister (&ssi_pdriver); +return ret; + } + +return 0 ; }module_init (ssi_init);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 190/338 include/uapi/linux/swab: Fix potentially missing __always_inline
In reply to Greg Kroah-HartmanFrom: Matt Redfearn <[email protected]>
[ Upstream commit defbab270d45e32b068e7e73c3567232d745c60f ]
Commit bc27fb68aaad ("include/uapi/linux/byteorder, swab: force inlining of some byteswap operations") added __always_inline to swab functions and commit 283d75737837 ("uapi/linux/stddef.h: Provide __always_inline to userspace headers") added a definition of __always_inline for use in exported headers when the kernel's compiler.h is not available.
However, since swab.h does not include stddef.h, if the header soup does not indirectly include it, the definition of __always_inline is missing, resulting in a compilation failure, which was observed compiling the perf tool using exported headers containing this commit:
In file included from /usr/include/linux/byteorder/little_endian.h:12:0,
from /usr/include/asm/byteorder.h:14,
from tools/include/uapi/linux/perf_event.h:20,
from perf.h:8,
from builtin-bench.c:18:/usr/include/linux/swab.h:160:8: error: unknown type name `__always_inline'
static __always_inline __u16 __swab16p(const __u16 *p)
Fix this by replacing the inclusion of linux/compiler.h with linux/stddef.h to ensure that we pick up that definition if required, without relying on it's indirect inclusion. compiler.h is then included indirectly, via stddef.h.
--- include/uapi/linux/swab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/swab.h +1 -1
@@ -3,7 +3,7 @@#define _UAPI_LINUX_SWAB_H#include <linux/types.h> -#include <linux/compiler.h> +#include <linux/stddef.h> #include <asm/bitsperlong.h> #include <asm/swab.h>
Signature · 1 line
2.35.1