[PATCH 5.11 012/210] selinux: fix cond_list corruption when changing booleans

2021-04-12 Thread Greg Kroah-Hartman
From: Ondrej Mosnacek commit d8f5f0ea5b86300390b026b6c6e7836b7150814a upstream. Currently, duplicate_policydb_cond_list() first copies the whole conditional avtab and then tries to link to the correct entries in cond_dup_av_list() using avtab_search(). However, since the conditional avtab may

[PATCH 5.10 011/188] selinux: fix cond_list corruption when changing booleans

2021-04-12 Thread Greg Kroah-Hartman
From: Ondrej Mosnacek commit d8f5f0ea5b86300390b026b6c6e7836b7150814a upstream. Currently, duplicate_policydb_cond_list() first copies the whole conditional avtab and then tries to link to the correct entries in cond_dup_av_list() using avtab_search(). However, since the conditional avtab may

Re: [PATCH v2] mm: page_poison: print page info when corruption is caught

2021-04-08 Thread Vlastimil Babka
On 4/8/21 1:08 AM, Sergei Trofimovich wrote: > When page_poison detects page corruption it's useful to see who > freed a page recently to have a guess where write-after-free > corruption happens. > > After this change corruption report has extra page data. > Example report fr

[PATCH v2] mm: page_poison: print page info when corruption is caught

2021-04-07 Thread Sergei Trofimovich
When page_poison detects page corruption it's useful to see who freed a page recently to have a guess where write-after-free corruption happens. After this change corruption report has extra page data. Example report from real corruption (includes only page_pwner part): pagealloc: memory

Re: [PATCH] mm: page_poison: print page owner info when corruption is caught

2021-04-07 Thread Sergei Trofimovich
On Wed, Apr 07, 2021 at 02:15:50PM +0200, Vlastimil Babka wrote: > On 4/4/21 4:17 PM, Sergei Trofimovich wrote: > > When page_poison detects page corruption it's useful to see who > > freed a page recently to have a guess where write-after-free > > corruption happens. >

Re: [PATCH] mm: page_poison: print page owner info when corruption is caught

2021-04-07 Thread Vlastimil Babka
On 4/4/21 4:17 PM, Sergei Trofimovich wrote: > When page_poison detects page corruption it's useful to see who > freed a page recently to have a guess where write-after-free > corruption happens. > > After this change corruption report has extra page_owner data. > Exampl

[PATCH 5.11 088/152] drm/amdkfd: dqm fence memory corruption

2021-04-05 Thread Greg Kroah-Hartman
are all processed according to 8 bytes. Fence memory only allocates 4 bytes of memory, but microcode does write 8 bytes of memory, so there is a memory corruption. Changes since v1: * Change dqm->fence_addr as a u64 pointer to fix this issue, also fix up query_status and amdkfd_fence_wait_time

[PATCH 5.10 073/126] drm/amdkfd: dqm fence memory corruption

2021-04-05 Thread Greg Kroah-Hartman
are all processed according to 8 bytes. Fence memory only allocates 4 bytes of memory, but microcode does write 8 bytes of memory, so there is a memory corruption. Changes since v1: * Change dqm->fence_addr as a u64 pointer to fix this issue, also fix up query_status and amdkfd_fence_wait_time

[PATCH] mm: page_poison: print page owner info when corruption is caught

2021-04-04 Thread Sergei Trofimovich
When page_poison detects page corruption it's useful to see who freed a page recently to have a guess where write-after-free corruption happens. After this change corruption report has extra page_owner data. Example report from real corruption: pagealloc: memory corruption

[PATCH 5/5] mm/userfaultfd: fix memory corruption due to writeprotect

2021-04-01 Thread Suren Baghdasaryan
From: Nadav Amit Userfaultfd self-test fails occasionally, indicating a memory corruption. Analyzing this problem indicates that there is a real bug since mmap_lock is only taken for read in mwriteprotect_range() and defers flushes, and since there is insufficient consideration of concurrent

[PATCH 5/5] mm/userfaultfd: fix memory corruption due to writeprotect

2021-04-01 Thread Suren Baghdasaryan
From: Nadav Amit Userfaultfd self-test fails occasionally, indicating a memory corruption. Analyzing this problem indicates that there is a real bug since mmap_lock is only taken for read in mwriteprotect_range() and defers flushes, and since there is insufficient consideration of concurrent

Re: [PATCH] drm/amdkfd: dqm fence memory corruption

2021-03-26 Thread Felix Kuehling
gt; through query status PM4 message. However, query status >>> PM4 message definition and microcode processing are all >>> processed according to 8 bytes. Fence memory only allocates >>> 4 bytes of memory, but microcode does write 8 bytes of memory, >>> so there i

Re: [PATCH] drm/amdkfd: dqm fence memory corruption

2021-03-26 Thread Qu Huang
processing are all processed according to 8 bytes. Fence memory only allocates 4 bytes of memory, but microcode does write 8 bytes of memory, so there is a memory corruption. Thank you for pointing out that discrepancy. That's a good catch! I'd prefer to fix this properly by making dqm->fence_a

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 11:02:47PM +0300, Dmitry Osipenko wrote: > 24.03.2021 22:57, Minchan Kim пишет: > > On Wed, Mar 24, 2021 at 10:49:58PM +0300, Dmitry Osipenko wrote: > >> 24.03.2021 22:43, Dmitry Osipenko пишет: > >>> 24.03.2021 22:20, Minchan Kim пишет: > static int __init

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Dmitry Osipenko
24.03.2021 22:57, Minchan Kim пишет: > On Wed, Mar 24, 2021 at 10:49:58PM +0300, Dmitry Osipenko wrote: >> 24.03.2021 22:43, Dmitry Osipenko пишет: >>> 24.03.2021 22:20, Minchan Kim пишет: static int __init cma_sysfs_init(void) { - int i = 0; + struct kobject

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 10:49:58PM +0300, Dmitry Osipenko wrote: > 24.03.2021 22:43, Dmitry Osipenko пишет: > > 24.03.2021 22:20, Minchan Kim пишет: > >> static int __init cma_sysfs_init(void) > >> { > >> - int i = 0; > >> + struct kobject *cma_kobj_root; > >> + struct cma_kobject *cma_kobj;

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 08:53:26PM +0100, David Hildenbrand wrote: > On 24.03.21 20:45, John Hubbard wrote: > > On 3/24/21 12:20 PM, Minchan Kim wrote: > > > struct cma_stat's lifespan for cma_sysfs is different with > > > struct cma because kobject for sysfs requires dynamic object > > > while

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread David Hildenbrand
On 24.03.21 20:45, John Hubbard wrote: On 3/24/21 12:20 PM, Minchan Kim wrote: struct cma_stat's lifespan for cma_sysfs is different with struct cma because kobject for sysfs requires dynamic object while CMA is static object[1]. When CMA is initialized, it couldn't use slab to allocate

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Dmitry Osipenko
24.03.2021 22:43, Dmitry Osipenko пишет: > 24.03.2021 22:20, Minchan Kim пишет: >> static int __init cma_sysfs_init(void) >> { >> -int i = 0; >> +struct kobject *cma_kobj_root; >> +struct cma_kobject *cma_kobj; >> struct cma *cma; >> +unsigned int i; > >> while (--i >=

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 10:43:49PM +0300, Dmitry Osipenko wrote: > 24.03.2021 22:20, Minchan Kim пишет: > > static int __init cma_sysfs_init(void) > > { > > - int i = 0; > > + struct kobject *cma_kobj_root; > > + struct cma_kobject *cma_kobj; > > struct cma *cma; > > + unsigned int

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread John Hubbard
On 3/24/21 12:20 PM, Minchan Kim wrote: struct cma_stat's lifespan for cma_sysfs is different with struct cma because kobject for sysfs requires dynamic object while CMA is static object[1]. When CMA is initialized, it couldn't use slab to allocate cma_stat since slab was not initialized yet.

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Dmitry Osipenko
24.03.2021 22:20, Minchan Kim пишет: > static int __init cma_sysfs_init(void) > { > - int i = 0; > + struct kobject *cma_kobj_root; > + struct cma_kobject *cma_kobj; > struct cma *cma; > + unsigned int i; > while (--i >= 0) { Do you realize that this doesn't work

[PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
struct cma_stat's lifespan for cma_sysfs is different with struct cma because kobject for sysfs requires dynamic object while CMA is static object[1]. When CMA is initialized, it couldn't use slab to allocate cma_stat since slab was not initialized yet. Thus, it allocates the dynamic object in

Re: [PATCH 5.10 103/157] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-22 Thread Florian Fainelli
On 3/22/2021 8:00 AM, Greg Kroah-Hartman wrote: > On Mon, Mar 22, 2021 at 07:44:05PM +0530, Naresh Kamboju wrote: >> On Mon, 22 Mar 2021 at 18:14, Greg Kroah-Hartman >> wrote: >>> >>> From: Thomas Bogendoerfer >>> >>> [ Upstream commit bd67b711bfaa02cf19e88aa2d9edae5c1c1d2739 ] >>> >>> BMIPS

Re: [PATCH 5.10 103/157] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-22 Thread Greg Kroah-Hartman
On Mon, Mar 22, 2021 at 07:44:05PM +0530, Naresh Kamboju wrote: > On Mon, 22 Mar 2021 at 18:14, Greg Kroah-Hartman > wrote: > > > > From: Thomas Bogendoerfer > > > > [ Upstream commit bd67b711bfaa02cf19e88aa2d9edae5c1c1d2739 ] > > > > BMIPS is one of the few platforms that do change the

Re: [PATCH 5.10 103/157] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-22 Thread Naresh Kamboju
On Mon, 22 Mar 2021 at 18:14, Greg Kroah-Hartman wrote: > > From: Thomas Bogendoerfer > > [ Upstream commit bd67b711bfaa02cf19e88aa2d9edae5c1c1d2739 ] > > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start bottom-up

[PATCH 4.14 34/43] PCI: rpadlpar: Fix potential drc_name corruption in store functions

2021-03-22 Thread Greg Kroah-Hartman
terminated when copied into the static drc_name buffer. Further, since the string is now NUL terminated the code only needs to change '\n' to '\0' when present. Cc: sta...@vger.kernel.org Signed-off-by: Tyrel Datwyler [mpe: Reformat change log and add mention of possible stack corruption] Signed

[PATCH 4.9 17/25] PCI: rpadlpar: Fix potential drc_name corruption in store functions

2021-03-22 Thread Greg Kroah-Hartman
terminated when copied into the static drc_name buffer. Further, since the string is now NUL terminated the code only needs to change '\n' to '\0' when present. Cc: sta...@vger.kernel.org Signed-off-by: Tyrel Datwyler [mpe: Reformat change log and add mention of possible stack corruption] Signed

[PATCH 4.4 10/14] PCI: rpadlpar: Fix potential drc_name corruption in store functions

2021-03-22 Thread Greg Kroah-Hartman
terminated when copied into the static drc_name buffer. Further, since the string is now NUL terminated the code only needs to change '\n' to '\0' when present. Cc: sta...@vger.kernel.org Signed-off-by: Tyrel Datwyler [mpe: Reformat change log and add mention of possible stack corruption] Signed

[PATCH 4.19 33/43] PCI: rpadlpar: Fix potential drc_name corruption in store functions

2021-03-22 Thread Greg Kroah-Hartman
terminated when copied into the static drc_name buffer. Further, since the string is now NUL terminated the code only needs to change '\n' to '\0' when present. Cc: sta...@vger.kernel.org Signed-off-by: Tyrel Datwyler [mpe: Reformat change log and add mention of possible stack corruption] Signed

[PATCH 5.4 48/60] PCI: rpadlpar: Fix potential drc_name corruption in store functions

2021-03-22 Thread Greg Kroah-Hartman
terminated when copied into the static drc_name buffer. Further, since the string is now NUL terminated the code only needs to change '\n' to '\0' when present. Cc: sta...@vger.kernel.org Signed-off-by: Tyrel Datwyler [mpe: Reformat change log and add mention of possible stack corruption] Signed

[PATCH 5.10 137/157] PCI: rpadlpar: Fix potential drc_name corruption in store functions

2021-03-22 Thread Greg Kroah-Hartman
terminated when copied into the static drc_name buffer. Further, since the string is now NUL terminated the code only needs to change '\n' to '\0' when present. Cc: sta...@vger.kernel.org Signed-off-by: Tyrel Datwyler [mpe: Reformat change log and add mention of possible stack corruption] Signed

[PATCH 5.10 103/157] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-22 Thread Greg Kroah-Hartman
From: Thomas Bogendoerfer [ Upstream commit bd67b711bfaa02cf19e88aa2d9edae5c1c1d2739 ] BMIPS is one of the few platforms that do change the exception base. After commit 2dcb39645441 ("memblock: do not start bottom-up allocations with kernel_end") we started seeing BMIPS boards fail to boot with

[PATCH 5.11 099/120] PCI: rpadlpar: Fix potential drc_name corruption in store functions

2021-03-22 Thread Greg Kroah-Hartman
terminated when copied into the static drc_name buffer. Further, since the string is now NUL terminated the code only needs to change '\n' to '\0' when present. Cc: sta...@vger.kernel.org Signed-off-by: Tyrel Datwyler [mpe: Reformat change log and add mention of possible stack corruption] Signed

[tip: irq/core] genirq/matrix: Prevent allocation counter corruption

2021-03-19 Thread tip-bot2 for Vitaly Kuznetsov
Committer: Thomas Gleixner CommitterDate: Fri, 19 Mar 2021 22:52:11 +01:00 genirq/matrix: Prevent allocation counter corruption When irq_matrix_free() is called for an unallocated vector the managed_allocated and total_allocated counters get out of sync with the real state of the matrix. Later

Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption

2021-03-18 Thread Kees Cook
On Thu, Mar 18, 2021 at 01:56:05PM +0100, Vlastimil Babka wrote: > I was going to suggest adding a panic_on_taint parameter... but turns out it > was > already added last year! And various memory corruption detections already use > TAINT_BAD_PAGE, including SLUB. > If any

Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption

2021-03-18 Thread Vlastimil Babka
ka wrote: >> >> On 3/9/21 2:47 PM, Georgi Djakov wrote: >> >>> Being able to stop the system immediately when a memory corruption >> >>> is detected is crucial to finding the source of it. This is very >> >>> useful when the memory can be

[PATCH rdma-next 0/6] Fix memory corruption in CM

2021-03-18 Thread Leon Romanovsky
From: Leon Romanovsky Hi, This series from Mark fixes long standing bug in CM migration logic, reported by Ryan [1]. Thanks [1] https://lore.kernel.org/linux-rdma/cafmmrnx9cg--nunzjfm8ywqfaetsmawv4eogkb3a0+hnjdt...@mail.gmail.com/ Mark Zhang (6): Revert "IB/cm: Mark stale CM id's whenever

Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption

2021-03-17 Thread Kees Cook
wrote: > >>> Being able to stop the system immediately when a memory corruption > >>> is detected is crucial to finding the source of it. This is very > >>> useful when the memory can be inspected with kdump or other tools. > >> > >> Is this

Re: BUG: KFENCE: memory corruption in usb_get_device_descriptor

2021-03-17 Thread Greg Kroah-Hartman
hikey hi6220 device > 3) While booting the device you will get to see this kernel BUG: > > [ 18.243075] BUG: KFENCE: memory corruption in > usb_get_device_descriptor+0x80/0xb0 > [ 18.813861] BUG: KFENCE: memory corruption in > __usbnet_read_cmd.isra.0+0xd0/0x1a0 There was a warnin

Re: [PATCH v2] rpadlpar: fix potential drc_name corruption in store functions

2021-03-17 Thread Michael Ellerman
ot_store logging a corrupted > string value. > > [...] Applied to powerpc/fixes. [1/1] rpadlpar: fix potential drc_name corruption in store functions https://git.kernel.org/powerpc/c/cc7a0bb058b85ea03db87169c60c7cfdd5d34678 cheers

Re: BUG: KFENCE: memory corruption in usb_get_device_descriptor

2021-03-17 Thread Naresh Kamboju
.tuxbuild.com/1pfztfszUNcDwOAyMrw2wPMKNfc/config 2) Boot arm64 hikey hi6220 device 3) While booting the device you will get to see this kernel BUG: [ 18.243075] BUG: KFENCE: memory corruption in usb_get_device_descriptor+0x80/0xb0 [ 18.813861] BUG: KFENCE: memory corruption in __usb

Re: BUG: KFENCE: memory corruption in usb_get_device_descriptor

2021-03-17 Thread Greg Kroah-Hartman
On Wed, Mar 17, 2021 at 02:28:40PM +0530, Naresh Kamboju wrote: > While booting Linux mainline master 5.12.0-rc2 and 5.12.0-rc3 on arm64 > Hikey device the following KFENCE bug was found. > > Recently, we have enabled CONFIG_KFENCE=y and started seeing this crash. > kernel BUG log: What USB

BUG: KFENCE: memory corruption in usb_get_device_descriptor

2021-03-17 Thread Naresh Kamboju
While booting Linux mainline master 5.12.0-rc2 and 5.12.0-rc3 on arm64 Hikey device the following KFENCE bug was found. Recently, we have enabled CONFIG_KFENCE=y and started seeing this crash. kernel BUG log: [ 18.243075] BUG: KFENCE: memory corruption in usb_get_device_descriptor+0x80/0xb0

[PATCH v2] rpadlpar: fix potential drc_name corruption in store functions

2021-03-15 Thread Tyrel Datwyler
Both add_slot_store() and remove_slot_store() try to fix up the drc_name copied from the store buffer by placing a NULL terminator at nbyte + 1 or in place of a '\n' if present. However, the static buffer that we copy the drc_name data into is not zeored and can contain anything past the n-th

Re: [PATCH] rpadlpar: fix potential drc_name corruption in store functions

2021-03-15 Thread Tyrel Datwyler
On 3/14/21 7:52 PM, Michael Ellerman wrote: > Tyrel Datwyler writes: >> On 3/13/21 1:17 AM, Michal Suchánek wrote: >>> On Wed, Mar 10, 2021 at 04:30:21PM -0600, Tyrel Datwyler wrote: Both add_slot_store() and remove_slot_store() try to fix up the drc_name copied from the store buffer by

[PATCH 5.11 301/306] mm/userfaultfd: fix memory corruption due to writeprotect

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Nadav Amit commit 6ce64428d62026a10cb5d80138ff2f90cc21d367 upstream. Userfaultfd self-test fails occasionally, indicating a memory corruption. Analyzing this problem indicates that there is a real bug since mmap_lock is only taken for read

[PATCH 5.10 283/290] mm/userfaultfd: fix memory corruption due to writeprotect

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Nadav Amit commit 6ce64428d62026a10cb5d80138ff2f90cc21d367 upstream. Userfaultfd self-test fails occasionally, indicating a memory corruption. Analyzing this problem indicates that there is a real bug since mmap_lock is only taken for read

[PATCH 5.11 224/306] staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Dan Carpenter commit d4ac640322b06095128a5c45ba4a1e80929fe7f3 upstream. The "ie_len" is a value in the 1-255 range that comes from the user. We have to cap it to ensure that it's not too large or it could lead to memory corruption. Fixes: 9a

[PATCH 5.10 228/290] staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Dan Carpenter commit d4ac640322b06095128a5c45ba4a1e80929fe7f3 upstream. The "ie_len" is a value in the 1-255 range that comes from the user. We have to cap it to ensure that it's not too large or it could lead to memory corruption. Fixes: 9a

[PATCH 5.10 159/290] kasan: fix memory corruption in kasan_bitops_tags test

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Andrey Konovalov [ Upstream commit e66e1799a76621003e5b04c9c057826a2152e103 ] Since the hardware tag-based KASAN mode might not have a redzone that comes after an allocated object (when kasan.mode=prod is enabled), the kasan_bitops_tags() test ends up corrupting

[PATCH 5.11 156/306] kasan: fix memory corruption in kasan_bitops_tags test

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Andrey Konovalov [ Upstream commit e66e1799a76621003e5b04c9c057826a2152e103 ] Since the hardware tag-based KASAN mode might not have a redzone that comes after an allocated object (when kasan.mode=prod is enabled), the kasan_bitops_tags() test ends up corrupting

[PATCH 5.10 134/290] udf: fix silent AED tagLocation corruption

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Steven J. Magnani [ Upstream commit 63c9e47a1642fc817654a1bc18a6ec4bbcc0f056 ] When extending a file, udf_do_extend_file() may enter following empty indirect extent. At the end of udf_do_extend_file() we revert prev_epos to point to the last written extent.

[PATCH 5.4 130/168] staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Dan Carpenter commit d4ac640322b06095128a5c45ba4a1e80929fe7f3 upstream. The "ie_len" is a value in the 1-255 range that comes from the user. We have to cap it to ensure that it's not too large or it could lead to memory corruption. Fixes: 9a

[PATCH 4.19 092/120] staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Dan Carpenter commit d4ac640322b06095128a5c45ba4a1e80929fe7f3 upstream. The "ie_len" is a value in the 1-255 range that comes from the user. We have to cap it to ensure that it's not too large or it could lead to memory corruption. Fixes: 9a

[PATCH 5.4 064/168] udf: fix silent AED tagLocation corruption

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Steven J. Magnani [ Upstream commit 63c9e47a1642fc817654a1bc18a6ec4bbcc0f056 ] When extending a file, udf_do_extend_file() may enter following empty indirect extent. At the end of udf_do_extend_file() we revert prev_epos to point to the last written extent.

[PATCH 4.19 043/120] udf: fix silent AED tagLocation corruption

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Steven J. Magnani [ Upstream commit 63c9e47a1642fc817654a1bc18a6ec4bbcc0f056 ] When extending a file, udf_do_extend_file() may enter following empty indirect extent. At the end of udf_do_extend_file() we revert prev_epos to point to the last written extent.

[PATCH 5.11 121/306] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Thomas Bogendoerfer [ Upstream commit bd67b711bfaa02cf19e88aa2d9edae5c1c1d2739 ] BMIPS is one of the few platforms that do change the exception base. After commit 2dcb39645441 ("memblock: do not start bottom-up allocations with kernel_end") we started seeing

[PATCH 5.11 129/306] udf: fix silent AED tagLocation corruption

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Steven J. Magnani [ Upstream commit 63c9e47a1642fc817654a1bc18a6ec4bbcc0f056 ] When extending a file, udf_do_extend_file() may enter following empty indirect extent. At the end of udf_do_extend_file() we revert prev_epos to point to the last written extent.

[PATCH 4.14 68/95] staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Dan Carpenter commit d4ac640322b06095128a5c45ba4a1e80929fe7f3 upstream. The "ie_len" is a value in the 1-255 range that comes from the user. We have to cap it to ensure that it's not too large or it could lead to memory corruption. Fixes: 9a

[PATCH 4.14 32/95] udf: fix silent AED tagLocation corruption

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Steven J. Magnani [ Upstream commit 63c9e47a1642fc817654a1bc18a6ec4bbcc0f056 ] When extending a file, udf_do_extend_file() may enter following empty indirect extent. At the end of udf_do_extend_file() we revert prev_epos to point to the last written extent.

[PATCH 5.10 083/290] gpio: fix gpio-device list corruption

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Johan Hovold commit cf25ef6b631c6fc6c0435fc91eba8734cca20511 upstream. Make sure to hold the gpio_lock when removing the gpio device from the gpio_devices list (when dropping the last reference) to avoid corrupting the list when there are concurrent accesses.

[PATCH 5.11 038/306] gpio: fix gpio-device list corruption

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Johan Hovold commit cf25ef6b631c6fc6c0435fc91eba8734cca20511 upstream. Make sure to hold the gpio_lock when removing the gpio device from the gpio_devices list (when dropping the last reference) to avoid corrupting the list when there are concurrent accesses.

[PATCH 4.9 18/78] udf: fix silent AED tagLocation corruption

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Steven J. Magnani [ Upstream commit 63c9e47a1642fc817654a1bc18a6ec4bbcc0f056 ] When extending a file, udf_do_extend_file() may enter following empty indirect extent. At the end of udf_do_extend_file() we revert prev_epos to point to the last written extent.

[PATCH 4.9 47/78] staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Dan Carpenter commit d4ac640322b06095128a5c45ba4a1e80929fe7f3 upstream. The "ie_len" is a value in the 1-255 range that comes from the user. We have to cap it to ensure that it's not too large or it could lead to memory corruption. Fixes: 9a

[PATCH 4.4 46/75] staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Dan Carpenter commit d4ac640322b06095128a5c45ba4a1e80929fe7f3 upstream. The "ie_len" is a value in the 1-255 range that comes from the user. We have to cap it to ensure that it's not too large or it could lead to memory corruption. Fixes: 9a

Re: [PATCH] rpadlpar: fix potential drc_name corruption in store functions

2021-03-14 Thread Michael Ellerman
Tyrel Datwyler writes: > On 3/13/21 1:17 AM, Michal Suchánek wrote: >> On Wed, Mar 10, 2021 at 04:30:21PM -0600, Tyrel Datwyler wrote: >>> Both add_slot_store() and remove_slot_store() try to fix up the drc_name >>> copied from the store buffer by placing a NULL terminator at nbyte + 1 >>> or in

Re: [PATCH] rpadlpar: fix potential drc_name corruption in store functions

2021-03-14 Thread Tyrel Datwyler
On 3/13/21 1:17 AM, Michal Suchánek wrote: > On Wed, Mar 10, 2021 at 04:30:21PM -0600, Tyrel Datwyler wrote: >> Both add_slot_store() and remove_slot_store() try to fix up the drc_name >> copied from the store buffer by placing a NULL terminator at nbyte + 1 >> or in place of a '\n' if present.

Re: [PATCH] rpadlpar: fix potential drc_name corruption in store functions

2021-03-13 Thread Michal Suchánek
On Wed, Mar 10, 2021 at 04:30:21PM -0600, Tyrel Datwyler wrote: > Both add_slot_store() and remove_slot_store() try to fix up the drc_name > copied from the store buffer by placing a NULL terminator at nbyte + 1 > or in place of a '\n' if present. However, the static buffer that we > copy the

[PATCH] rpadlpar: fix potential drc_name corruption in store functions

2021-03-10 Thread Tyrel Datwyler
Both add_slot_store() and remove_slot_store() try to fix up the drc_name copied from the store buffer by placing a NULL terminator at nbyte + 1 or in place of a '\n' if present. However, the static buffer that we copy the drc_name data into is not zeored and can contain anything past the n-th

Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption

2021-03-09 Thread Vlastimil Babka
On 3/9/21 7:14 PM, Georgi Djakov wrote: > Hi Vlastimil, > > Thanks for the comment! > > On 3/9/21 17:09, Vlastimil Babka wrote: >> On 3/9/21 2:47 PM, Georgi Djakov wrote: >>> Being able to stop the system immediately when a memory corruption >>> is de

Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption

2021-03-09 Thread Georgi Djakov
Hi Vlastimil, Thanks for the comment! On 3/9/21 17:09, Vlastimil Babka wrote: On 3/9/21 2:47 PM, Georgi Djakov wrote: Being able to stop the system immediately when a memory corruption is detected is crucial to finding the source of it. This is very useful when the memory can be inspected

Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption

2021-03-09 Thread Georgi Djakov
Hi Christoph, Thanks for the comments! On 3/9/21 16:56, Christoph Lameter wrote: On Tue, 9 Mar 2021, Georgi Djakov wrote: Being able to stop the system immediately when a memory corruption is detected is crucial to finding the source of it. This is very useful when the memory can

Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption

2021-03-09 Thread Vlastimil Babka
On 3/9/21 2:47 PM, Georgi Djakov wrote: > Being able to stop the system immediately when a memory corruption > is detected is crucial to finding the source of it. This is very > useful when the memory can be inspected with kdump or other tools. Is this in some testing scenarios where

Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption

2021-03-09 Thread Christoph Lameter
On Tue, 9 Mar 2021, Georgi Djakov wrote: > Being able to stop the system immediately when a memory corruption > is detected is crucial to finding the source of it. This is very > useful when the memory can be inspected with kdump or other tools. Hmmm ok. > static void restore_

[PATCH] mm/slub: Add slub_debug option to panic on memory corruption

2021-03-09 Thread Georgi Djakov
Being able to stop the system immediately when a memory corruption is detected is crucial to finding the source of it. This is very useful when the memory can be inspected with kdump or other tools. Let's add an option panic the kernel when slab debug catches an object or list corruption

Re: [PATCH v3] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-09 Thread Thomas Bogendoerfer
On Mon, Mar 08, 2021 at 10:24:47AM +0100, Thomas Bogendoerfer wrote: > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > with kernel_end") we started seeing BMIPS boards fail to boot with the > built-in

Re: [PATCH v3] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-08 Thread Serge Semin
Hi Thomas On Mon, Mar 08, 2021 at 10:24:47AM +0100, Thomas Bogendoerfer wrote: > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > with kernel_end") we started seeing BMIPS boards fail to boot with the

Re: [PATCH v3] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-08 Thread Thomas Bogendoerfer
On Mon, Mar 08, 2021 at 10:21:10AM -0800, Florian Fainelli wrote: > On 3/8/21 1:24 AM, Thomas Bogendoerfer wrote: > > BMIPS is one of the few platforms that do change the exception base. > > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > > with kernel_end") we started

Re: [PATCH v3] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-08 Thread Florian Fainelli
On 3/8/21 1:24 AM, Thomas Bogendoerfer wrote: > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > with kernel_end") we started seeing BMIPS boards fail to boot with the > built-in FDT being corrupted. >

Re: [PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-08 Thread Roman Gushchin
On Sat, Mar 06, 2021 at 09:29:09AM +0100, Thomas Bogendoerfer wrote: > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > with kernel_end") we started seeing BMIPS boards fail to boot with the > built-in

Re: [PATCH v3] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-08 Thread Mike Rapoport
On Mon, Mar 08, 2021 at 10:24:47AM +0100, Thomas Bogendoerfer wrote: > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > with kernel_end") we started seeing BMIPS boards fail to boot with the > built-in

list_add corruption in __percpu_counter_init

2021-03-08 Thread Marc Kleine-Budde
Hello, since updating one of our compile cluster machines from kernel 4.19+105+deb10u9 to 5.10.0-0.bpo.3-amd64 #1 Debian 5.10.13-1~bpo10+1 we're hit by this bug every 1...2 days: list_add corruption. next->prev should be prev (889a9840), but was . (next=9c3dcaf2a

[PATCH v3] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-08 Thread Thomas Bogendoerfer
BMIPS is one of the few platforms that do change the exception base. After commit 2dcb39645441 ("memblock: do not start bottom-up allocations with kernel_end") we started seeing BMIPS boards fail to boot with the built-in FDT being corrupted. Before the cited commit, early allocations would be in

Re: [PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-07 Thread Maciej W. Rozycki
On Mon, 8 Mar 2021, Serge Semin wrote: > > some of them are not R2 (SB1), others are. So best bet would be to > > simply reserve the first 0x1000 bytes for every CPU and special handling > > for the BMIPS case. Does this cover all cases ? > > I can't say for sure whether it will cover all the

Re: [PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-07 Thread Serge Semin
On Sun, Mar 07, 2021 at 10:20:01PM +0100, Thomas Bogendoerfer wrote: > On Sun, Mar 07, 2021 at 11:06:12PM +0300, Serge Semin wrote: > > > + > > > + if (cpu_has_mips_r2_r6) > > > + reserve_exception_space(0, 0x400); > > > > Are you sure it shouldn't be (!cpu_has_mips_r2_r6)?. What I see

Re: [PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-07 Thread Maciej W. Rozycki
On Sun, 7 Mar 2021, Thomas Bogendoerfer wrote: > > Are you sure all of them have "cpu_has_mips_r2_r6" macro returning > > true (false) in order to safely use the lowest region in accordance > > with the conditional statement you've added? > > some of them are not R2 (SB1), others are. For the

Re: [PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-07 Thread Thomas Bogendoerfer
On Sun, Mar 07, 2021 at 11:06:12PM +0300, Serge Semin wrote: > > + > > + if (cpu_has_mips_r2_r6) > > + reserve_exception_space(0, 0x400); > > Are you sure it shouldn't be (!cpu_has_mips_r2_r6)?. What I see here > contradicts to what is said in Changelog v2. d'oh, of course it has to

Re: [PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-07 Thread Serge Semin
Hi Thomas. I thought we'd discuss it in v1, but since you've sent v2 please see my comment below. On Sat, Mar 06, 2021 at 09:29:09AM +0100, Thomas Bogendoerfer wrote: > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start

Re: [PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-06 Thread Mike Rapoport
On Sat, Mar 06, 2021 at 09:29:09AM +0100, Thomas Bogendoerfer wrote: > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > with kernel_end") we started seeing BMIPS boards fail to boot with the > built-in

Re: [PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-06 Thread Florian Fainelli
On 3/6/2021 12:29 AM, Thomas Bogendoerfer wrote: > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > with kernel_end") we started seeing BMIPS boards fail to boot with the > built-in FDT being

[PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-06 Thread Thomas Bogendoerfer
BMIPS is one of the few platforms that do change the exception base. After commit 2dcb39645441 ("memblock: do not start bottom-up allocations with kernel_end") we started seeing BMIPS boards fail to boot with the built-in FDT being corrupted. Before the cited commit, early allocations would be in

[PATCH v4] mm/userfaultfd: fix memory corruption due to writeprotect

2021-03-04 Thread Nadav Amit
From: Nadav Amit Userfaultfd self-test fails occasionally, indicating a memory corruption. Analyzing this problem indicates that there is a real bug since mmap_lock is only taken for read in mwriteprotect_range() and defers flushes, and since there is insufficient consideration of concurrent

Re: [PATCH RESEND v3] mm/userfaultfd: fix memory corruption due to writeprotect

2021-03-03 Thread Nadav Amit
> On Mar 3, 2021, at 11:03 AM, Peter Xu wrote: > > On Wed, Mar 03, 2021 at 01:57:02AM -0800, Nadav Amit wrote: >> From: Nadav Amit >> >> Userfaultfd self-test fails occasionally, indicating a memory >> corruption. > > It's failing very constantly now

Re: [PATCH] MIPS: BMIPS: Reserve exception base to prevent corruption

2021-03-03 Thread Maciej W. Rozycki
On Wed, 3 Mar 2021, Thomas Bogendoerfer wrote: > > What's up with the R3k (the usual trigger for me) here? > > I've moved r3k cpu_probe() to it's own file and when moving ebase > reservation to cpu_probe(), I need to add it there as well. So just > a mechanic step, I've missed. Ah, right, I

Re: [PATCH] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-03 Thread Florian Fainelli
On 3/3/21 1:14 PM, Serge Semin wrote: > Hello Thomas, > Thanks for the patch. My comments are below. > > On Wed, Mar 03, 2021 at 07:57:13PM +0100, Thomas Bogendoerfer wrote: >> BMIPS is one of the few platforms that do change the exception base. >> After commit 2dcb39645441 ("memblock: do not

Re: [PATCH] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-03 Thread Serge Semin
Hello Thomas, Thanks for the patch. My comments are below. On Wed, Mar 03, 2021 at 07:57:13PM +0100, Thomas Bogendoerfer wrote: > BMIPS is one of the few platforms that do change the exception base. > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > with kernel_end") we

Re: [PATCH RESEND v3] mm/userfaultfd: fix memory corruption due to writeprotect

2021-03-03 Thread Peter Xu
On Wed, Mar 03, 2021 at 01:57:02AM -0800, Nadav Amit wrote: > From: Nadav Amit > > Userfaultfd self-test fails occasionally, indicating a memory > corruption. It's failing very constantly now for me after I got it run on a 40 cores system... While indeed not easy to fail

[PATCH] MIPS: kernel: Reserve exception base early to prevent corruption

2021-03-03 Thread Thomas Bogendoerfer
BMIPS is one of the few platforms that do change the exception base. After commit 2dcb39645441 ("memblock: do not start bottom-up allocations with kernel_end") we started seeing BMIPS boards fail to boot with the built-in FDT being corrupted. Before the cited commit, early allocations would be in

Re: [PATCH] MIPS: BMIPS: Reserve exception base to prevent corruption

2021-03-03 Thread Thomas Bogendoerfer
On Wed, Mar 03, 2021 at 06:45:52PM +0100, Maciej W. Rozycki wrote: > On Wed, 3 Mar 2021, Thomas Bogendoerfer wrote: > > > perfect, I only forgot about R3k... I'll submit a formal patch submission > > later today. > > What's up with the R3k (the usual trigger for me) here? I've moved r3k

  1   2   3   4   5   6   7   8   9   10   >