[PATCH v6.1.y-v4.19.y] vhost: use kzalloc() instead of kmalloc() followed by memset()

2024-02-04 Thread Ajay Kaher
ia2...@gmail.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella [Ajay: This is a security fix as per CVE-2024-0340] Signed-off-by: Ajay Kaher --- drivers/vhost/vhost.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/v

Re: [PATCH v5] eventfs: Remove eventfs_file and just use eventfs_inode

2023-11-23 Thread Ajay Kaher
> On 23-Nov-2023, at 4:55 PM, Heiko Carstens wrote: > > !! External Email > > On Fri, Nov 17, 2023 at 03:38:29PM +0100, Heiko Carstens wrote: >> On Fri, Nov 17, 2023 at 03:23:35PM +0100, Heiko Carstens wrote: >>> I think this patch causes from time to time crashes when running ftrace >>>

[PATCH 4.4 20/46] fbcon: remove soft scrollback code

2020-09-28 Thread Ajay Kaher
> @@ -3378,7 +3054,6 @@ static const struct consw fb_con = { > .con_font_default = fbcon_set_def_font, > .con_font_copy = fbcon_copy_font, > .con_set_palette= fbcon_set_palette, > - .con_scrolldelta= fbcon_scrolldelta, > .con_set_origin

[PATCH v2 v4.14.y 1/3] vfio/type1: Support faulting PFNMAP vmas

2020-09-08 Thread Ajay Kaher
(). Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.14] Signed-off-by: Ajay Kaher --- drivers/vfio/vfio_iommu_type1.c | 36 +--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers

[PATCH v2 v4.14.y 0/3] vfio: Fix for CVE-2020-12888

2020-09-08 Thread Ajay Kaher
CVE-2020-12888 Kernel: vfio: access to disabled MMIO space of some devices may lead to DoS scenario The VFIO modules allow users (guest VMs) to enable or disable access to the devices' MMIO memory address spaces. If a user attempts to access (read/write) the devices' MMIO address space when

[PATCH v2 v4.14.y 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-09-08 Thread Ajay Kaher
later use to invalidate those mappings. The open callback invalidates the vma range so that all tracking is inserted in the fault handler and removed in the close handler. Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.14] Signed-off-by: Ajay Kaher

[PATCH v2 v4.14.y 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-09-08 Thread Ajay Kaher
occur. Fixes: CVE-2020-12888 Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.14] Signed-off-by: Ajay Kaher --- drivers/vfio/pci/vfio_pci.c | 294 +++- drivers/vfio/pci/vfio_pci_config.c | 36 - drivers/vfio

[PATCH v4.9.y 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-09-07 Thread Ajay Kaher
later use to invalidate those mappings. The open callback invalidates the vma range so that all tracking is inserted in the fault handler and removed in the close handler. Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.9] Signed-off-by: Ajay Kaher

[PATCH v4.9.y 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-09-07 Thread Ajay Kaher
occur. Fixes: CVE-2020-12888 Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.9] Signed-off-by: Ajay Kaher --- drivers/vfio/pci/vfio_pci.c | 294 +++- drivers/vfio/pci/vfio_pci_config.c | 36 - drivers/vfio

[PATCH v4.9.y 1/3] vfio/type1: Support faulting PFNMAP vmas

2020-09-07 Thread Ajay Kaher
(). Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.9] Signed-off-by: Ajay Kaher --- drivers/vfio/vfio_iommu_type1.c | 36 +--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers

[PATCH v4.9.y 0/3] vfio: Fix for CVE-2020-12888

2020-09-07 Thread Ajay Kaher
CVE-2020-12888 Kernel: vfio: access to disabled MMIO space of some devices may lead to DoS scenario The VFIO modules allow users (guest VMs) to enable or disable access to the devices' MMIO memory address spaces. If a user attempts to access (read/write) the devices' MMIO address space when

[PATCH v4.14.y 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-09-07 Thread Ajay Kaher
occur. Fixes: CVE-2020-12888 Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.14] Signed-off-by: Ajay Kaher --- drivers/vfio/pci/vfio_pci.c | 294 +++- drivers/vfio/pci/vfio_pci_config.c | 36 - drivers/vfio

[PATCH v4.14.y 1/3] vfio/type1: Support faulting PFNMAP vmas

2020-09-07 Thread Ajay Kaher
(). Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.14] Signed-off-by: Ajay Kaher --- drivers/vfio/vfio_iommu_type1.c | 36 +--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers

[PATCH v4.14.y 0/3] vfio: Fix for CVE-2020-12888

2020-09-07 Thread Ajay Kaher
CVE-2020-12888 Kernel: vfio: access to disabled MMIO space of some devices may lead to DoS scenario The VFIO modules allow users (guest VMs) to enable or disable access to the devices' MMIO memory address spaces. If a user attempts to access (read/write) the devices' MMIO address space when

[PATCH v4.14.y 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-09-07 Thread Ajay Kaher
later use to invalidate those mappings. The open callback invalidates the vma range so that all tracking is inserted in the fault handler and removed in the close handler. Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.14] Signed-off-by: Ajay Kaher

[PATCH v4.19.y 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-09-07 Thread Ajay Kaher
occur. Fixes: CVE-2020-12888 Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.19] Signed-off-by: Ajay Kaher --- drivers/vfio/pci/vfio_pci.c | 291 drivers/vfio/pci/vfio_pci_config.c | 36 - drivers/vfio

[PATCH v4.19.y 1/3] vfio/type1: Support faulting PFNMAP vmas

2020-09-07 Thread Ajay Kaher
(). Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.19] Signed-off-by: Ajay Kaher --- drivers/vfio/vfio_iommu_type1.c | 36 +--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers

[PATCH v4.19.y 0/3] vfio: Fix for CVE-2020-12888

2020-09-07 Thread Ajay Kaher
CVE-2020-12888 Kernel: vfio: access to disabled MMIO space of some devices may lead to DoS scenario The VFIO modules allow users (guest VMs) to enable or disable access to the devices' MMIO memory address spaces. If a user attempts to access (read/write) the devices' MMIO address space when

[PATCH v4.19.y 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-09-07 Thread Ajay Kaher
later use to invalidate those mappings. The open callback invalidates the vma range so that all tracking is inserted in the fault handler and removed in the close handler. Reviewed-by: Peter Xu Signed-off-by: Alex Williamson [Ajay: Regenerated the patch for v4.19] Signed-off-by: Ajay Kaher

[PATCH v5.4.y 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-09-06 Thread Ajay Kaher
those mappings. The open callback invalidates the vma range so that all tracking is inserted in the fault handler and removed in the close handler. Reviewed-by: Peter Xu Signed-off-by: Alex Williamson Signed-off-by: Ajay Kaher --- drivers/vfio/pci/vfio_pci.c | 76

[PATCH v5.4.y 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-09-06 Thread Ajay Kaher
-12888 Reviewed-by: Peter Xu Signed-off-by: Alex Williamson Signed-off-by: Ajay Kaher --- drivers/vfio/pci/vfio_pci.c | 291 drivers/vfio/pci/vfio_pci_config.c | 36 - drivers/vfio/pci/vfio_pci_intrs.c | 14 ++ drivers/vfio/pci

[PATCH v5.4.y 0/3] vfio: Fix for CVE-2020-12888

2020-09-06 Thread Ajay Kaher
CVE-2020-12888 Kernel: vfio: access to disabled MMIO space of some devices may lead to DoS scenario The VFIO modules allow users (guest VMs) to enable or disable access to the devices' MMIO memory address spaces. If a user attempts to access (read/write) the devices' MMIO address space when

[PATCH v5.4.y 1/3] vfio/type1: Support faulting PFNMAP vmas

2020-09-06 Thread Ajay Kaher
-off-by: Alex Williamson Signed-off-by: Ajay Kaher --- drivers/vfio/vfio_iommu_type1.c | 36 +--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 6cc47af..d679996 100644

Re: [PATCH v3] mm: Fix mremap not considering huge pmd devmap

2020-06-05 Thread Ajay Kaher
Thanks Fan, this scenario works to reproduce on v4.9. And following fix works for v4.9: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?h=linux-4.9.y=44cb51d5b4a736446b728bbde8407844d71843ef -Ajay

[PATCH v3] mm: Fix mremap not considering huge pmd devmap

2020-06-04 Thread Ajay Kaher
Hi Fan, Able to reproduce this issue on v4.19.y using your test program. And as per commit message it fixes commit 5c7fb56e5e3f ("mm, dax: dax-pmd vs thp-pmd vs hugetlbfs-pm”) at kernel version v4.5. So, v4.9.y should be vulnerable, however not able to reproduce on v4.9.y. Does any specific

Re: [PATCH v2 6/8] mm: prevent get_user_pages() from overflowing page refcount

2019-10-17 Thread Ajay Kaher
ow_hugetlb_page() >> from 2be7cfed995e, to resolve compilation error >> Srivatsa: Replaced call to get_page_foll() with try_get_page_foll() ] >> Signed-off-by: Srivatsa S. Bhat (VMware) >> Signed-off-by: Ajay Kaher >> --- >> mm/gup.c | 43

[PATCH 4.9.y] Revert "net: sit: fix memory leak in sit_init_net()"

2019-10-16 Thread Ajay Kaher
Cc: David S. Miller Cc: Greg Kroah-Hartman Signed-off-by: Ajay Kaher --- net/ipv6/sit.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 47ca2a2..16eba7b 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -1856,7 +1856,6 @@ static int __net_init

[PATCH v2 8/8] fs: prevent page refcount overflow in pipe_buf_get

2019-10-08 Thread Ajay Kaher
09cbfeaf1a5a6 "mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros" for context. ] Signed-off-by: Ajay Kaher Reviewed-by: Srivatsa S. Bhat (VMware) --- fs/fuse/dev.c | 12 ++-- fs/pipe.c | 4 ++-- fs/splice.c

[PATCH v2 1/8] mm: make page ref count overflow check tighter and more explicit

2019-10-08 Thread Ajay Kaher
Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Ajay Kaher --- include/linux/mm.h | 6 +- mm/internal.h | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index ed653ba..701088e 100644 --- a/include/linux/mm.h +++ b/include/

[PATCH v2 7/8] pipe: add pipe_buf_get() helper

2019-10-08 Thread Ajay Kaher
From: Miklos Szeredi commit 7bf2d1df80822ec056363627e2014990f068f7aa upstream. Signed-off-by: Miklos Szeredi Signed-off-by: Al Viro Signed-off-by: Ajay Kaher Reviewed-by: Srivatsa S. Bhat (VMware) --- fs/fuse/dev.c | 2 +- fs/splice.c | 4 ++-- include/linux

[PATCH v2 5/8] mm, gup: ensure real head page is ref-counted when using hugepages

2019-10-08 Thread Ajay Kaher
Cc: Naoya Horiguchi Cc: Mark Rutland Cc: Hillf Danton Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Ajay Kaher Reviewed-by: Srivatsa S. Bhat (VMware) --- mm/gup.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/

[PATCH v2 2/8] mm: add 'try_get_page()' helper function

2019-10-08 Thread Ajay Kaher
_get_page() to match the get_page() implementation in 4.4.y, except for the refcount check. - Added try_get_page_foll() which will be needed in a subsequent patch. ] Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Ajay Kaher --- include/linux/mm.h | 12 mm/

[PATCH v2 6/8] mm: prevent get_user_pages() from overflowing page refcount

2019-10-08 Thread Ajay Kaher
local variable 'err' with-in follow_hugetlb_page() from 2be7cfed995e, to resolve compilation error Srivatsa: Replaced call to get_page_foll() with try_get_page_foll() ] Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Ajay Kaher --- mm/gup.c | 43

[PATCH v2 4/8] mm, gup: remove broken VM_BUG_ON_PAGE compound check for hugepages

2019-10-08 Thread Ajay Kaher
: Hillf Danton Cc: Michal Hocko Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Ajay Kaher --- mm/gup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 45c544b..6e7cfaa 100644

[PATCH v2 3/8] mm: handle PTE-mapped tail pages in gerneric fast gup implementaiton

2019-10-08 Thread Ajay Kaher
Michal Hocko Cc: Christoph Lameter Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Ajay Kaher --- mm/gup.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 2cd3b31..45c544b 100644 --- a/mm/gup.c +

[PATCH v2 0/8] Backported fixes for 4.4 stable tree

2019-10-08 Thread Ajay Kaher
These patches include few backported fixes for the 4.4 stable tree. I would appreciate if you could kindly consider including them in the next release. Ajay --- [Changes from v1]: No changes, only answering Greg's below queries: >> Why are these needed? From what I remember, the last patch

[PATCH v6 2/3][v4.9.y] infiniband: fix race condition between infiniband mlx4, mlx5 driver and core dumping

2019-08-03 Thread Ajay Kaher
son for pointing this. Signed-off-by: Ajay Kaher Reviewed-by: Jason Gunthorpe --- drivers/infiniband/hw/mlx4/main.c | 4 +++- drivers/infiniband/hw/mlx5/main.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/m

[PATCH v6 0/3] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-08-03 Thread Ajay Kaher
coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping [PATCH v5 1/3]: Backporting of commit 04f5866e41fb70690e28397487d8bd8eea7d712a upstream. [PATCH v5 2/3]: Extension of commit 04f5866e41fb to fix the race condition between get_task_mm() and core dumping for

[PATCH v6 1/3] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-08-03 Thread Ajay Kaher
-by: Mike Rapoport Reviewed-by: Oleg Nesterov Reviewed-by: Jann Horn Acked-by: Jason Gunthorpe Acked-by: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman [aka...@vmware.com: stable 4.9 backport - handle binder_update_page_range -

[PATCH v6 3/3] [v4.9.y] coredump: fix race condition between collapse_huge_page() and core dumping

2019-08-03 Thread Ajay Kaher
man [Ajay: Just adjusted to apply on v4.9] Signed-off-by: Ajay Kaher --- include/linux/mm.h | 4 mm/khugepaged.c| 3 +++ 2 files changed, 7 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index c239984..8852158 100644 --- a/include/linux/mm.h +++ b/include/linux/

[PATCH 7/8] pipe: add pipe_buf_get() helper

2019-07-22 Thread Ajay Kaher
From: Miklos Szeredi commit 7bf2d1df80822ec056363627e2014990f068f7aa upstream. Signed-off-by: Miklos Szeredi Signed-off-by: Al Viro Signed-off-by: Ajay Kaher Reviewed-by: Srivatsa S. Bhat (VMware) --- fs/fuse/dev.c | 2 +- fs/splice.c | 4 ++-- include/linux

[PATCH 8/8] fs: prevent page refcount overflow in pipe_buf_get

2019-07-22 Thread Ajay Kaher
09cbfeaf1a5a6 "mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros" for context. ] Signed-off-by: Ajay Kaher Reviewed-by: Srivatsa S. Bhat (VMware) --- fs/fuse/dev.c | 12 ++-- fs/pipe.c | 4 ++-- fs/splice.c

[PATCH 6/8] mm: prevent get_user_pages() from overflowing page refcount

2019-07-22 Thread Ajay Kaher
local variable 'err' with-in follow_hugetlb_page() from 2be7cfed995e, to resolve compilation error Srivatsa: Replaced call to get_page_foll() with try_get_page_foll() ] Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Ajay Kaher --- mm/gup.c | 43

[PATCH 4/8] mm, gup: remove broken VM_BUG_ON_PAGE compound check for hugepages

2019-07-22 Thread Ajay Kaher
: Hillf Danton Cc: Michal Hocko Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Ajay Kaher --- mm/gup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 45c544b..6e7cfaa 100644

[PATCH 3/8] mm: handle PTE-mapped tail pages in gerneric fast gup implementaiton

2019-07-22 Thread Ajay Kaher
Michal Hocko Cc: Christoph Lameter Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Ajay Kaher --- mm/gup.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 2cd3b31..45c544b 100644 --- a/mm/gup.c +

[PATCH 5/8] mm, gup: ensure real head page is ref-counted when using hugepages

2019-07-22 Thread Ajay Kaher
Cc: Naoya Horiguchi Cc: Mark Rutland Cc: Hillf Danton Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Ajay Kaher Reviewed-by: Srivatsa S. Bhat (VMware) --- mm/gup.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/

[PATCH 2/8] mm: add 'try_get_page()' helper function

2019-07-22 Thread Ajay Kaher
_get_page() to match the get_page() implementation in 4.4.y, except for the refcount check. - Added try_get_page_foll() which will be needed in a subsequent patch. ] Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Ajay Kaher --- include/linux/mm.h | 12 mm/

[PATCH 0/8] Backported fixes for 4.4 stable tree

2019-07-22 Thread Ajay Kaher
These patches include few backported fixes for the 4.4 stable tree. I would appreciate if you could kindly consider including them in the next release. Ajay --- [PATCH 1/8]: Backporting of upstream commit f958d7b528b1: mm: make page ref count overflow check tighter and more explicit [PATCH

[PATCH 1/8] mm: make page ref count overflow check tighter and more explicit

2019-07-22 Thread Ajay Kaher
Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Ajay Kaher --- include/linux/mm.h | 6 +- mm/internal.h | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index ed653ba..701088e 100644 --- a/include/linux/mm.h +++ b/include/

Re: [PATCH v5 0/3] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-07-12 Thread Ajay Kaher
Greg, I hope you would like to include these patches in next release. In case any review comment please let me know. - Ajay On 01/07/19, 4:03 PM, "Ajay Kaher" wrote: > coredump: fix race condition between mmget_not_zero()/get_task_mm() > and core dumping > [PATCH v5

[PATCH v5 0/3] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-07-01 Thread Ajay Kaher
coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping [PATCH v5 1/3]: Backporting of commit 04f5866e41fb70690e28397487d8bd8eea7d712a upstream. [PATCH v5 2/3]: Extension of commit 04f5866e41fb to fix the race condition between get_task_mm() and core dumping for

[PATCH v5 2/3][v4.9.y] infiniband: fix race condition between infiniband mlx4, mlx5 driver and core dumping

2019-07-01 Thread Ajay Kaher
son for pointing this. Signed-off-by: Ajay Kaher Reviewed-by: Jason Gunthorpe --- drivers/infiniband/hw/mlx4/main.c | 4 +++- drivers/infiniband/hw/mlx5/main.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/m

[PATCH v5 3/3] [v4.9.y] coredump: fix race condition between collapse_huge_page() and core dumping

2019-07-01 Thread Ajay Kaher
man [Ajay: Just adjusted to apply on v4.9] Signed-off-by: Ajay Kaher --- include/linux/mm.h | 4 mm/khugepaged.c| 3 +++ 2 files changed, 7 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index c239984..8852158 100644 --- a/include/linux/mm.h +++ b/include/linux/

[PATCH v5 1/3] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-07-01 Thread Ajay Kaher
-by: Mike Rapoport Reviewed-by: Oleg Nesterov Reviewed-by: Jann Horn Acked-by: Jason Gunthorpe Acked-by: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman [aka...@vmware.com: stable 4.9 backport - handle binder_update_page_range -

Re: [PATCH v4 0/3] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-25 Thread Ajay Kaher
On 25/06/19, 1:51 AM, "Sasha Levin" wrote: > On Tue, Jun 25, 2019 at 02:33:06AM +0530, Ajay Kaher wrote: > > coredump: fix race condition between mmget_not_zero()/get_task_mm() > > and core dumping > > > > [PATCH v4 1/3]: > > Backporting of comm

[PATCH v4 2/3][v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-24 Thread Ajay Kaher
son for pointing this. Signed-off-by: Ajay Kaher --- drivers/infiniband/hw/mlx4/main.c | 4 +++- drivers/infiniband/hw/mlx5/main.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 8d59a59

[PATCH v4 0/3] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-24 Thread Ajay Kaher
coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping [PATCH v4 1/3]: Backporting of commit 04f5866e41fb70690e28397487d8bd8eea7d712a upstream. [PATCH v4 2/3]: Extension of commit 04f5866e41fb to fix the race condition between get_task_mm() and core dumping for

[PATCH v4 3/3] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-24 Thread Ajay Kaher
man [Ajay: Just adjusted to apply on v4.9] Signed-off-by: Ajay Kaher --- include/linux/mm.h | 4 mm/khugepaged.c| 3 +++ 2 files changed, 7 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index c239984..8852158 100644 --- a/include/linux/mm.h +++ b/include/linux/

[PATCH v4 1/3] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-24 Thread Ajay Kaher
-by: Mike Rapoport Reviewed-by: Oleg Nesterov Reviewed-by: Jann Horn Acked-by: Jason Gunthorpe Acked-by: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman [aka...@vmware.com: stable 4.9 backport - handle binder_update_page_range -

Re: [PATCH stable-4.4 v3] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-22 Thread Ajay Kaher
> On Mon, Jun 17, 2019 at 08:58:24AM +0200, Michal Hocko wrote: > > From: Andrea Arcangeli > > > > Upstream 04f5866e41fb70690e28397487d8bd8eea7d712a commit. > > > > Signed-off-by: Michal Hocko > > --- > > drivers/android/binder.c | 6 ++ > > drivers/infiniband/hw/mlx4/main.c |

[PATCH v3 0/2] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-21 Thread Ajay Kaher
coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping [PATCH v3 1/2]: Backporting of commit 04f5866e41fb70690e28397487d8bd8eea7d712a upstream. [PATCH v3 2/2]: Extension of commit 04f5866e41fb to fix the race condition between get_task_mm() and core dumping for

[PATCH v3 2/2][v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-21 Thread Ajay Kaher
son for pointing this. Signed-off-by: Ajay Kaher --- drivers/infiniband/hw/mlx4/main.c | 4 +++- drivers/infiniband/hw/mlx5/main.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 8d59a59

[PATCH v3 1/2] [v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-21 Thread Ajay Kaher
-by: Mike Rapoport Reviewed-by: Oleg Nesterov Reviewed-by: Jann Horn Acked-by: Jason Gunthorpe Acked-by: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman [aka...@vmware.com: stable 4.9 backport - handle binder_update_page_range -

Re: [PATCH] [v4.14.y] infiniband: fix race condition between infiniband mlx4, mlx5 driver and core dumping

2019-06-14 Thread Ajay Kaher
On 10/06/19, 6:22 PM, "Ajay Kaher" wrote: > This patch is the extension of following upstream commit to fix > the race condition between get_task_mm() and core dumping > for IB->mlx4 and IB->mlx5 drivers: > > commit 04f5866e41fb ("coredump: fix rac

[PATCH] [v4.14.y] infiniband: fix race condition between infiniband mlx4, mlx5 driver and core dumping

2019-06-10 Thread Ajay Kaher
son for pointing this. Signed-off-by: Ajay Kaher --- drivers/infiniband/hw/mlx4/main.c | 4 +++- drivers/infiniband/hw/mlx5/main.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index e2beb18

Re: [RFC PATCH stable-4.4] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-06 Thread Ajay Kaher
> From: Andrea Arcangeli > > Upstream 04f5866e41fb70690e28397487d8bd8eea7d712a commit. > > > Signed-off-by: Michal Hocko > --- > Hi, > this is based on the backport I have done for out 4.4 based distribution > kernel. Please double check that I haven't missed anything before > applying to the

Re: [PATCH 3/3] PCI: hv: Use vPCI protocol version 1.2 for v4.9

2019-01-18 Thread Ajay Kaher
> On 17/01/19, 8:37 PM, "Bjorn Helgaas" wrote: > > > On Fri, Jan 18, 2019 at 02:17:18AM +0530, Ajay Kaher wrote: > > Update the Hyper-V vPCI driver to use the Server-2016 version of the vPCI > > protocol, fixing MSI creation and retargeting issues. > &

[PATCH 3/3] PCI: hv: Use vPCI protocol version 1.2 for v4.9

2019-01-17 Thread Ajay Kaher
Helgaas Reviewed-by: K. Y. Srinivasan Acked-by: K. Y. Srinivasan Signed-off-by: Ajay Kaher --- drivers/pci/host/pci-hyperv.c | 300 ++ 1 file changed, 246 insertions(+), 54 deletions(-) diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci

[PATCH 1/3] PCI: hv: Allocate physically contiguous hypercall params buffer

2019-01-17 Thread Ajay Kaher
. Y. Srinivasan Signed-off-by: Ajay Kaher --- drivers/pci/host/pci-hyperv.c | 29 +++-- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index b4d8ccf..9e44adf 100644 --- a/drivers/pci/host/pci

[PATCH 0/3] PCI: hv: Use vPCI protocol version 1.2 for v4.9

2019-01-17 Thread Ajay Kaher
For now, please consider these patches for review and suggest if these can be merged to mainline kernel v4.9. These patches add support for vPCI protocol version 1.2, by baqkpotring from v4.14 to v4.9. Individual patches are summarised below: Patch 1: PCI: hv: Allocate physically contiguous

[PATCH 2/3] PCI: hv: Add vPCI version protocol negotiation

2019-01-17 Thread Ajay Kaher
Hyper-V vPCI offers different protocol versions. Add the infra for negotiating the one to use. Signed-off-by: Jork Loeser Signed-off-by: Bjorn Helgaas Reviewed-by: K. Y. Srinivasan Acked-by: K. Y. Srinivasan Signed-off-by: Ajay Kaher --- drivers/pci/host/pci-hyperv.c | 72

[PATCH v4] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-28 Thread Ajay Kaher
ng has been added in init_usb_class() and destroy_usb_class(). As pointed by Alan, removed "if (usb_class)" test from destroy_usb_class() because usb_class can never be NULL there. Signed-off-by: Ajay Kaher <ajay.ka...@samsung.com> Acked-by: Alan Stern <st...@rowland.harvard.e

[PATCH v4] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-28 Thread Ajay Kaher
ng has been added in init_usb_class() and destroy_usb_class(). As pointed by Alan, removed "if (usb_class)" test from destroy_usb_class() because usb_class can never be NULL there. Signed-off-by: Ajay Kaher Acked-by: Alan Stern --- drivers/usb/core/file.c | 9 +++-- 1 file changed, 7

FW: Re: [PATCH v4] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-21 Thread Ajay Kaher
register_dev->init_usb_class > > To solve this, mutex locking has been added in init_usb_class() and > destroy_usb_class(). > > As pointed by Alan, removed "if (usb_class)" test from destroy_usb_class() > because usb_class can never be NULL there. Signed-off-by: Ajay Ka

FW: Re: [PATCH v4] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-21 Thread Ajay Kaher
register_dev->init_usb_class > > To solve this, mutex locking has been added in init_usb_class() and > destroy_usb_class(). > > As pointed by Alan, removed "if (usb_class)" test from destroy_usb_class() > because usb_class can never be NULL there. Signed-off-by: Ajay Ka

Re: [PATCH v4] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-17 Thread Ajay Kaher
emoved "if (usb_class)" test from destroy_usb_class() because usb_class can never be NULL there. Signed-off-by: Ajay Kaher <ajay.ka...@samsung.com> Acked-by: Alan Stern <st...@rowland.harvard.edu> --- drivers/usb/core/file.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(

Re: [PATCH v4] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-17 Thread Ajay Kaher
emoved "if (usb_class)" test from destroy_usb_class() because usb_class can never be NULL there. Signed-off-by: Ajay Kaher Acked-by: Alan Stern --- drivers/usb/core/file.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file

Re: Subject: [PATCH v4] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-09 Thread Ajay Kaher
From febeb10887d5026a489658fd9e911656e76038ac Mon Sep 17 00:00:00 2001 From: Ajay Kaher <ajay.ka...@samsung.com> Date: Thu, 9 Mar 2017 16:07:54 +0530 Subject: [PATCH v4] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultan

Re: Subject: [PATCH v4] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-09 Thread Ajay Kaher
From febeb10887d5026a489658fd9e911656e76038ac Mon Sep 17 00:00:00 2001 From: Ajay Kaher Date: Thu, 9 Mar 2017 16:07:54 +0530 Subject: [PATCH v4] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously There is race condition when

Re: Subject: [PATCH v4] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-06 Thread Ajay Kaher
      > On Fri, 3 Mar 2017, Ajay Kaher wrote: >  > > > usb_class->kref is not accessible outside the file.c > > > as usb_class is _static_ inside the file.c and > > > pointer of usb_class->kref is not passed anywhere. > > >  > > > Hence 

Re: Subject: [PATCH v4] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-06 Thread Ajay Kaher
      > On Fri, 3 Mar 2017, Ajay Kaher wrote: >  > > > usb_class->kref is not accessible outside the file.c > > > as usb_class is _static_ inside the file.c and > > > pointer of usb_class->kref is not passed anywhere. > > >  > > > Hence 

FW: FW: RE: Re: FW: RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-03 Thread Ajay Kaher
> On Thr, 2 Mar 2017, Ajay Kaher wrote: >> On Wed, 1 Mar 2017, Alan Stern wrote: >>> On Wed, 1 Mar 2017, Ajay Kaher wrote: >>>> On Mon, 22 Feb 2017, Ajay Kaher wrote: >>>>  >>>>>  >>>>>> Alan, as per my understanding I

FW: FW: RE: Re: FW: RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-03 Thread Ajay Kaher
> On Thr, 2 Mar 2017, Ajay Kaher wrote: >> On Wed, 1 Mar 2017, Alan Stern wrote: >>> On Wed, 1 Mar 2017, Ajay Kaher wrote: >>>> On Mon, 22 Feb 2017, Ajay Kaher wrote: >>>>  >>>>>  >>>>>> Alan, as per my understanding I

FW: RE: Re: FW: RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-02 Thread Ajay Kaher
> On Wed, 1 Mar 2017, Alan Stern wrote: >> On Wed, 1 Mar 2017, Ajay Kaher wrote: >>> On Mon, 22 Feb 2017, Ajay Kaher wrote: >>>  >>>>  >>>>> Alan, as per my understanding I have shifted the lock from >>>>> release_usb_class() 

FW: RE: Re: FW: RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-02 Thread Ajay Kaher
> On Wed, 1 Mar 2017, Alan Stern wrote: >> On Wed, 1 Mar 2017, Ajay Kaher wrote: >>> On Mon, 22 Feb 2017, Ajay Kaher wrote: >>>  >>>>  >>>>> Alan, as per my understanding I have shifted the lock from >>>>> release_usb_class() 

FW: RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-01 Thread Ajay Kaher
> On Mon, 22 Feb 2017, Ajay Kaher wrote: >  >> On Mon, 20 Feb 2017, Ajay Kaher wrote: >>  >>> Alan, as per my understanding I have shifted the lock from >>> release_usb_class() to destroy_usb_class() in patch v3.  >>> If it is not right, please expl

FW: RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-01 Thread Ajay Kaher
> On Mon, 22 Feb 2017, Ajay Kaher wrote: >  >> On Mon, 20 Feb 2017, Ajay Kaher wrote: >>  >>> Alan, as per my understanding I have shifted the lock from >>> release_usb_class() to destroy_usb_class() in patch v3.  >>> If it is not right, please expl

RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-22 Thread Ajay Kaher
On Tue, 21 Feb 2017, Alan Stern wrote:    > On Mon, 20 Feb 2017, Ajay Kaher wrote:   >> Alan, as per my understanding I have shifted the lock from >> release_usb_class() to destroy_usb_class() in patch v3.  >> If it is not right, please explain in detail which race condi

RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-22 Thread Ajay Kaher
On Tue, 21 Feb 2017, Alan Stern wrote:    > On Mon, 20 Feb 2017, Ajay Kaher wrote:   >> Alan, as per my understanding I have shifted the lock from >> release_usb_class() to destroy_usb_class() in patch v3.  >> If it is not right, please explain in detail which race condi

Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-20 Thread Ajay Kaher
  On Thu, 16 Feb 2017, Alan Stern wrote:  > On Thu, 16 Feb 2017, Ajay Kaher wrote: >  >> > On Thu, 14 Feb 2017, Alan Stern wrote: >> >  >> > I think Ajay's argument is correct and a patch is needed.  But this >> > patch misses the race betw

Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-20 Thread Ajay Kaher
  On Thu, 16 Feb 2017, Alan Stern wrote:  > On Thu, 16 Feb 2017, Ajay Kaher wrote: >  >> > On Thu, 14 Feb 2017, Alan Stern wrote: >> >  >> > I think Ajay's argument is correct and a patch is needed.  But this >> > patch misses the race betw

RE: RE: Re: Re: Re: Subject: [PATCH v2] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-16 Thread Ajay Kaher
ng init_usb_class_mutex lock  >>requires. >> Don't you think so? >>  >> >>>> And because of the following code path race condition happens: >> >>>> probe->usb_register_dev->init_usb_class >> >>> >> >

RE: RE: Re: Re: Re: Subject: [PATCH v2] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-16 Thread Ajay Kaher
ng init_usb_class_mutex lock  >>requires. >> Don't you think so? >>  >> >>>> And because of the following code path race condition happens: >> >>>> probe->usb_register_dev->init_usb_class >> >>> >> >

RE: Re: Re: Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-14 Thread Ajay Kaher
Why is this just showing up now, and hasn't been an issue for the decade >>> or so this code has been around?  What changed? >>> >>>> Tested with these changes, and problem has been solved. >>> >>> What changes? >>  >> Tested with my patc

RE: Re: Re: Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-14 Thread Ajay Kaher
Why is this just showing up now, and hasn't been an issue for the decade >>> or so this code has been around?  What changed? >>> >>>> Tested with these changes, and problem has been solved. >>> >>> What changes? >>  >> Tested with my patc

RE: Re: Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-01 Thread Ajay Kaher
ode has been around? What changed? > >> Tested with these changes, and problem has been solved. > >What changes? Tested with my patch (i.e. locking with init_usb_class_mutex). thanks, ajay kaher   - Original Message - Sender : gre...@linuxfoundation.org <gre.

RE: Re: Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-01 Thread Ajay Kaher
ode has been around? What changed? > >> Tested with these changes, and problem has been solved. > >What changes? Tested with my patch (i.e. locking with init_usb_class_mutex). thanks, ajay kaher   - Original Message - Sender : gre...@linuxfoundation.org  Date

RE: Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-01-30 Thread Ajay Kaher
  At boot time, probe function of multiple connected devices (proprietary devices) execute simultaneously. And because of the following code path race condition happens: probe->usb_register_dev->init_usb_class Tested with these changes, and problem has been solved. thanks, ajay

RE: Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-01-30 Thread Ajay Kaher
  At boot time, probe function of multiple connected devices (proprietary devices) execute simultaneously. And because of the following code path race condition happens: probe->usb_register_dev->init_usb_class Tested with these changes, and problem has been solved. thanks, ajay