Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-22 Thread Bui Quang Minh
On Mon, Mar 22, 2021 at 03:00:37PM +0200, Mike Rapoport wrote: > On Mon, Mar 22, 2021 at 11:14:37AM +0100, Michal Hocko wrote: > > Le'ts Andrea and Mike > > > > On Fri 19-03-21 22:24:28, Bui Quang Minh wrote: > > > userfaultfd_writeprotect() use change_p

[PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-19 Thread Bui Quang Minh
entry in missing page table entry page fault path. Signed-off-by: Bui Quang Minh --- mm/huge_memory.c | 12 mm/memory.c | 10 ++ 2 files changed, 22 insertions(+) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index ae907a9c2050..9bb16a55a48c 100644 --- a/mm/huge_me

[PATCH] bpf: Check for integer overflow when using roundup_pow_of_two()

2021-01-26 Thread Bui Quang Minh
On 32-bit architecture, roundup_pow_of_two() can return 0 when the argument has upper most bit set due to resulting 1UL << 32. Add a check for this case. Fixes: d5a3b1f ("bpf: introduce BPF_MAP_TYPE_STACK_TRACE") Signed-off-by: Bui Quang Minh --- kernel/bpf/stackmap.c | 2 ++ 1

Re: [PATCH] bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc

2021-01-26 Thread Bui Quang Minh
On Wed, Jan 27, 2021 at 11:23:41AM +0700, Bui Quang Minh wrote: > > * Seems like there are quite a few similar calls scattered around > > (cpumap, etc.). Did you audit these as well? > > I spotted another bug after re-auditting. In hashtab, there ares 2 places > u

Re: [PATCH] bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc

2021-01-26 Thread Bui Quang Minh
On Tue, Jan 26, 2021 at 09:36:57AM +, Lorenz Bauer wrote: > On Tue, 26 Jan 2021 at 08:26, Bui Quang Minh wrote: > > > > In 32-bit architecture, the result of sizeof() is a 32-bit integer so > > the expression becomes the multiplication between 2 32-bit integer which >

[PATCH] bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc

2021-01-26 Thread Bui Quang Minh
. Signed-off-by: Bui Quang Minh --- kernel/bpf/devmap.c | 4 ++-- net/core/sock_map.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index f6e9c68afdd4..e849c3e8a49f 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -92,7

Re: [PATCH v2] can: mcba_usb: Fix memory leak when cancelling urb

2021-01-21 Thread Bui Quang Minh
On Tue, Jan 12, 2021 at 01:42:33PM +0700, Minh Bùi Quang wrote: > On Mon, Jan 11, 2021 at 9:31 PM Bui Quang Minh > wrote: > > > > On Mon, Jan 11, 2021 at 01:00:31PM +0100, Oliver Neukum wrote: > > > Am Montag, den 11.01.2021, 10:49 +

[no subject]

2021-01-21 Thread Bui Quang Minh
Bcc: Subject: Re: [PATCH v2] can: mcba_usb: Fix memory leak when cancelling urb Reply-To: In-Reply-To: On Tue, Jan 12, 2021 at 01:42:33PM +0700, Minh Bùi Quang wrote: > On Mon, Jan 11, 2021 at 9:31 PM Bui Quang Minh > wrote: > > > > On Mon, Jan 11, 2021 at 01:00:31PM +0

[PATCH v3] can: mcba_usb: Fix memory leak when cancelling urb

2021-01-11 Thread Bui Quang Minh
and free them later. Reported-by: syzbot+57281c762a3922e14...@syzkaller.appspotmail.com Signed-off-by: Bui Quang Minh --- v1: add memory leak fix when not resubmitting urb v2: add memory leak fix when failing to resubmit urb v3: remove usb_free_coherent() calls in interrupt context drivers/net

Re: [PATCH v2] can: mcba_usb: Fix memory leak when cancelling urb

2021-01-11 Thread Bui Quang Minh
On Mon, Jan 11, 2021 at 01:00:31PM +0100, Oliver Neukum wrote: > Am Montag, den 11.01.2021, 10:49 + schrieb Bui Quang Minh: > > In mcba_usb_read_bulk_callback(), when we don't resubmit or fails to > > resubmit the urb, we need to deallocate the transfer buffer that i

[PATCH v2] can: mcba_usb: Fix memory leak when cancelling urb

2021-01-11 Thread Bui Quang Minh
In mcba_usb_read_bulk_callback(), when we don't resubmit or fails to resubmit the urb, we need to deallocate the transfer buffer that is allocated in mcba_usb_start(). Reported-by: syzbot+57281c762a3922e14...@syzkaller.appspotmail.com Signed-off-by: Bui Quang Minh --- v1: add memory leak fix

Re: memory leak in mcba_usb_probe

2021-01-10 Thread Bui Quang Minh
#syz test: https://github.com/minhbq-99/linux.git 080e743dff190ee8ebec63a13ac33fe8b7e4fc9e

[PATCH] can: mcba_usb: Fix memory leak when cancelling urb

2021-01-10 Thread Bui Quang Minh
In mcba_usb_read_bulk_callback(), when we don't resubmit the urb, we need to deallocate the transfer buffer that is allocated in mcba_usb_start(). Reported-by: syzbot+57281c762a3922e14...@syzkaller.appspotmail.com Signed-off-by: Bui Quang Minh --- drivers/net/can/usb/mcba_usb.c | 2 ++ 1 file

Re: [PATCH] USB: dummy-hcd: Fix uninitialized array use in init()

2020-12-06 Thread Bui Quang Minh
On Sat, Dec 05, 2020 at 10:15:11AM -0500, Alan Stern wrote: > On Sat, Dec 05, 2020 at 07:47:01PM +0700, Minh Bùi Quang wrote: > > Vào Th 6, 4 thg 12, 2020 vào lúc 23:12 Alan Stern > > đã viết: > > > Does this initialization end up using less memory than an explicit > > > memset() call? > > > >

[PATCH] USB: dummy-hcd: Fix uninitialized array use in init()

2020-12-03 Thread Bui Quang Minh
This error path err_add_pdata: for (i = 0; i < mod_data.num; i++) kfree(dum[i]); can be triggered when not all dum's elements are initialized. Fix this by initializing all dum's elements to NULL. Signed-off-by: Bui Quang Minh --- drivers/