[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 >>> self

Re: tracing: user events UAF crash report

2024-07-22 Thread Ajay Kaher
testing if the parent was freed after > we released the mutex. If so, the function returns NULL. However, all > callers expect it to either return a valid pointer or an error pointer, > at least since commit 5264a2f4bb3b ("tracing: Fix a NULL vs IS_ERR() bug > in event_subsystem_dir()"). Returning NULL will therefore fail the error > condition check in the caller. > > Fix this by substituting the NULL return value with a fitting error > pointer. > > Fixes: 77a06c33a22d ("eventfs: Test for ei->is_freed when accessing > ei->dentry") > Cc: Dan Carpenter > Signed-off-by: Mathias Krause > --- > fs/tracefs/event_inode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c > index 5d88c184f0fc..a9c28a1d5dc8 100644 > --- a/fs/tracefs/event_inode.c > +++ b/fs/tracefs/event_inode.c > @@ -736,7 +736,7 @@ struct eventfs_inode *eventfs_create_dir(const char > *name, struct eventfs_inode > /* Was the parent freed? */ > if (list_empty(&ei->list)) { > cleanup_ei(ei); > - ei = NULL; > + ei = ERR_PTR(-EBUSY); > } > return ei; > } Must have. LGTM. Thanks. Reviewed-by: Ajay Kaher - Ajay

Re: tracing: user events UAF crash report

2024-07-25 Thread Ajay Kaher
On Mon, Jul 22, 2024 at 5:38 PM Mathias Krause wrote: > > On 22.07.24 13:13, Ajay Kaher wrote: > > On Sat, Jul 20, 2024 at 2:17 AM Mathias Krause > > wrote: > >> > >> I noticed, the user events ftrace selftest is crashing every now and > >> then

Re: tracing: user events UAF crash report

2024-07-25 Thread Ajay Kaher
On Mon, Jul 22, 2024 at 5:38 PM Mathias Krause wrote: > > On 22.07.24 13:13, Ajay Kaher wrote: > > On Sat, Jul 20, 2024 at 2:17 AM Mathias Krause > > wrote: > >> > >> I noticed, the user events ftrace selftest is crashing every now and > >> then

Re: tracing: user events UAF crash report

2024-07-25 Thread Ajay Kaher
On Thu, Jul 25, 2024 at 9:45 PM Ajay Kaher wrote: > > On Mon, Jul 22, 2024 at 5:38 PM Mathias Krause wrote: > > > > On 22.07.24 13:13, Ajay Kaher wrote: > > > On Sat, Jul 20, 2024 at 2:17 AM Mathias Krause > > > wrote: > > >> > > >>

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-26 Thread Ajay Kaher
On Fri, Jul 26, 2024 at 5:45 AM Steven Rostedt wrote: > > From: Steven Rostedt > > When eventfs was introduced, special care had to be done to coordinate the > freeing of the file meta data with the files that are exposed to user > space. The file meta data would have a ref count that is set when

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-29 Thread Ajay Kaher
On Fri, Jul 26, 2024 at 9:33 PM Steven Rostedt wrote: > > On Fri, 26 Jul 2024 18:00:18 +0530 > Ajay Kaher wrote: > > > Some doubt: > > Because of the same race condition, it may happen that kmem_cache_free(file) > > was executed while f_start() is waiting to get

[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 her

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

2019-10-08 Thread Ajay Kaher
d Cc: 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 1/8] mm: make page ref count overflow check tighter and more explicit

2019-10-08 Thread Ajay Kaher
ted code. ] 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

[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 3/8] mm: handle PTE-mapped tail pages in gerneric fast gup implementaiton

2019-10-08 Thread Ajay Kaher
einer Cc: 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/

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

2019-10-08 Thread Ajay Kaher
acon 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 --g

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

2019-10-08 Thread Ajay Kaher
s: Srivatsa: - Adapted try_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/lin

[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.

[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 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

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

2019-10-17 Thread Ajay Kaher
n 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 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 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 hy

[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 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

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. > &

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 v6 3/3] [v4.9.y] coredump: fix race condition between collapse_huge_page() and core dumping

2019-08-03 Thread Ajay Kaher
Signed-off-by: Greg Kroah-Hartman [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/l

[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
to Jason 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

[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 IB->m

[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: Peter Xu Reviewed-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 bi

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

2019-07-22 Thread Ajay Kaher
ted code. ] 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

[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 2/8]:

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

2019-07-22 Thread Ajay Kaher
s: Srivatsa: - Adapted try_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/lin

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

2019-07-22 Thread Ajay Kaher
d Cc: 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 5/8] mm, gup: ensure real head page is ref-counted when using hugepages

2019-07-22 Thread Ajay Kaher
acon 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 --g

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

2019-07-22 Thread Ajay Kaher
einer Cc: 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/

[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.

[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 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 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
to Jason 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: Peter Xu Reviewed-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 bi

[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 IB->m

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

2019-06-21 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 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: Peter Xu Reviewed-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 bi

[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
Signed-off-by: Greg Kroah-Hartman [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/l

[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 IB->m

[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
to Jason 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.

Re: [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
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.14.y] infiniband: fix race condition between infiniband mlx4, mlx5 driver and core dumping

2019-06-10 Thread Ajay Kaher
to Jason 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 st

[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: Peter Xu Reviewed-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 b

[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
to Jason 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

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

2019-07-01 Thread Ajay Kaher
Signed-off-by: Greg Kroah-Hartman [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/l

[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 IB->m

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: 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
his code 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  Da

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
ed "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-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-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

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: 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: 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() 

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 condition

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
 protection using 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
t;> >>> 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? >>  >

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

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

2020-09-27 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 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 scen

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&id=44cb51d5b4a736446b728bbde8407844d71843ef -Ajay

[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 --- a

[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 it

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

2020-09-06 Thread Ajay Kaher
-2020-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/vfi

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

2020-09-06 Thread Ajay Kaher
idate 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

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

2020-09-07 Thread Ajay Kaher
e can 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

[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 it

[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 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-09-07 Thread Ajay Kaher
rwise 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

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

2020-09-07 Thread Ajay Kaher
rwise 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

[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 it

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

2020-09-07 Thread Ajay Kaher
e can 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

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

2020-09-07 Thread Ajay Kaher
rwise 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

[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 2/3] vfio-pci: Fault mmaps to enable vma tracking

2020-09-07 Thread Ajay Kaher
e can 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

[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 it

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

2020-09-08 Thread Ajay Kaher
rwise 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

[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 it

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

2020-09-08 Thread Ajay Kaher
e can 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

[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

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] 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