Re: [PATCH] staging: rtl8712: uninitialized memory in read_bbreg_hdl()

2019-03-20 Thread Dan Carpenter
On Thu, Mar 21, 2019 at 09:26:38AM +0300, Dan Carpenter wrote: > Colin King reported a bug in read_bbreg_hdl(): > > memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz); > > The problem is that "val" is uninitialized. > > This code is obviously not useful, but so far as I can tell > "pcmd->cmdcode"

[PATCH] staging: rtl8712: uninitialized memory in read_bbreg_hdl()

2019-03-20 Thread Dan Carpenter
Colin King reported a bug in read_bbreg_hdl(): memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz); The problem is that "val" is uninitialized. This code is obviously not useful, but so far as I can tell "pcmd->cmdcode" is never GEN_CMD_CODE(_Read_BBREG) so it's not harmful either. For now the e

RE: [PATCH 3/3] PCI: hv: Add pci_destroy_slot() in pci_devices_present_work(), if necessary

2019-03-20 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Dexuan Cui > > ... > > Patch 2 in this series does set it to NULL, but this code does not. > In Patch2, i.e. in the code path hv_pci_remove() -> hv_pci_remove_slots(), > we must set hpdev->pci_slot to NULL, otherwise, later, due to > hv_pci

RE: [PATCH 3/3] PCI: hv: Add pci_destroy_slot() in pci_devices_present_work(), if necessary

2019-03-20 Thread Dexuan Cui
> From: Michael Kelley > Sent: Wednesday, March 20, 2019 2:44 PM > To: Dexuan Cui ; lorenzo.pieral...@arm.com; > bhelg...@google.com; linux-...@vger.kernel.org; KY Srinivasan > > ... > > diff --git a/drivers/pci/controller/pci-hyperv.c > > @@ -1776,6 +1776,10 @@ static void pci_devices_present_wor

RE: [PATCH 1/3] PCI: hv: Fix a memory leak in hv_eject_device_work()

2019-03-20 Thread Dexuan Cui
> From: Michael Kelley > Sent: Wednesday, March 20, 2019 2:38 PM > > From: Dexuan Cui > > > > After a device is just created in new_pcichild_device(), hpdev->refs is set > > to 2 (i.e. the initial value of 1 plus the get_pcichild()). > > > > When we hot remove the device from the host, in Linux

Re: v5.1-rc1 binder_alloc_do_buffer_copy() BUG_ON triggered by selinux-testsuite

2019-03-20 Thread Paul Moore
On Wed, Mar 20, 2019 at 7:26 PM Todd Kjos wrote: > I can send you a patch tomorrow (I won't be able to test it though). I may not know much about binder, but I do know how to run the test suite :) Thanks Todd. > On Wed, Mar 20, 2019 at 4:23 PM Paul Moore wrote: > > > > On Wed, Mar 20, 2019 at

Re: v5.1-rc1 binder_alloc_do_buffer_copy() BUG_ON triggered by selinux-testsuite

2019-03-20 Thread Todd Kjos
I can send you a patch tomorrow (I won't be able to test it though). On Wed, Mar 20, 2019 at 4:23 PM Paul Moore wrote: > > On Wed, Mar 20, 2019 at 3:50 PM Todd Kjos wrote: > > > > Paul, > > > > Looking at main() in test_binder.c... > > > > int main(int argc, char **argv) > > { > > > > [...] > >

Re: v5.1-rc1 binder_alloc_do_buffer_copy() BUG_ON triggered by selinux-testsuite

2019-03-20 Thread Paul Moore
On Wed, Mar 20, 2019 at 3:50 PM Todd Kjos wrote: > > Paul, > > Looking at main() in test_binder.c... > > int main(int argc, char **argv) > { > > [...] > > // Line 493 > struct binder_write_read bwr; > struct flat_binder_object obj; > struct { > uint32_t cmd; > struct binder_transac

[PATCH] binder: fix BUG_ON found by selinux-testsuite

2019-03-20 Thread Todd Kjos
The selinux-testsuite found an issue resulting in a BUG_ON() where a conditional relied on a size_t going negative when checking the validity of a buffer offset. Fixes: 7a67a39320df ("binder: add function to copy binder object from buffer") Reported-by: Paul Moore Tested-by: Paul Moore Signed-of

Re: v5.1-rc1 binder_alloc_do_buffer_copy() BUG_ON triggered by selinux-testsuite

2019-03-20 Thread Todd Kjos
On Wed, Mar 20, 2019 at 3:25 PM Paul Moore wrote: > > On Wed, Mar 20, 2019 at 11:54 AM Todd Kjos wrote: > > So, then it sounds like the test is not running properly ... > > Yes, the test is almost surely broken to some extent, although the > kernel hitting the BUG_ON() was clearly a bug too :) A

Re: v5.1-rc1 binder_alloc_do_buffer_copy() BUG_ON triggered by selinux-testsuite

2019-03-20 Thread Paul Moore
On Wed, Mar 20, 2019 at 11:54 AM Todd Kjos wrote: > So, then it sounds like the test is not running properly ... Yes, the test is almost surely broken to some extent, although the kernel hitting the BUG_ON() was clearly a bug too :) > Can I add a "Tested-by: Paul Moore " on my patch > submission

RE: [PATCH 2/3] PCI: hv: Add hv_pci_remove_slots() when we unload the driver

2019-03-20 Thread Michael Kelley
From: Dexuan Cui Sent: Monday, March 4, 2019 1:35 PM > > When we unload pci-hyperv, the host doesn't send us a PCI_EJECT message. > In this case we also need to make sure the sysfs pci slot directory > is removed, otherwise "cat /sys/bus/pci/slots/2/address" will trigger > "BUG: unable to handle

RE: [PATCH 1/3] PCI: hv: Fix a memory leak in hv_eject_device_work()

2019-03-20 Thread Michael Kelley
From: Dexuan Cui > > After a device is just created in new_pcichild_device(), hpdev->refs is set > to 2 (i.e. the initial value of 1 plus the get_pcichild()). > > When we hot remove the device from the host, in Linux VM we first call > hv_pci_eject_device(), which increases hpdev->refs by get_pci

RE: [PATCH 3/3] PCI: hv: Add pci_destroy_slot() in pci_devices_present_work(), if necessary

2019-03-20 Thread Michael Kelley
From: Dexuan Cui Sent: Monday, March 4, 2019 1:35 PM > > diff --git a/drivers/pci/controller/pci-hyperv.c > b/drivers/pci/controller/pci-hyperv.c > index b489412e3502..82acd6155adf 100644 > --- a/drivers/pci/controller/pci-hyperv.c > +++ b/drivers/pci/controller/pci-hyperv.c > @@ -1776,6 +1776,

Re: Staging status of speakup

2019-03-20 Thread Okash Khawaja
On Tue, 19 Mar 2019 16:31:21 + Alan Cox wrote: > On Sat, 16 Mar 2019 10:35:43 +0100 > Samuel Thibault wrote: > > > Chris Brannon, le ven. 15 mars 2019 18:19:39 -0700, a ecrit: > > > Okash Khawaja writes: > > > > Finally there is an issue where text in output buffer sometimes > > > >

Re: [PATCH v3] staging: rtlwifi: rtl8822b: fix to avoid NULL pointer dereference

2019-03-20 Thread Mukesh Ojha
On 3/20/2019 10:32 PM, Aditya Pakki wrote: skb allocated via dev_alloc_skb can fail and return a NULL pointer. This patch avoids such a scenario and returns, consistent with other invocations. Signed-off-by: Aditya Pakki --- v2: Move signed off above the version change log v1: Patch collisio

Re: [PATCH v3] staging: rtl8188eu: Fix potential NULL pointer dereference of kcalloc

2019-03-20 Thread Mukesh Ojha
On 3/20/2019 10:51 PM, Aditya Pakki wrote: hwxmits is allocated via kcalloc and not checked for failure before its No need to mentionĀ  kcalloc as the other place allocates the memory through kmalloc. Otherwise looks good. Acked-by: Mukesh Ojha dereference. The patch fixes this problem by

Re: v5.1-rc1 binder_alloc_do_buffer_copy() BUG_ON triggered by selinux-testsuite

2019-03-20 Thread Todd Kjos
Paul, Looking at main() in test_binder.c... int main(int argc, char **argv) { [...] // Line 493 struct binder_write_read bwr; struct flat_binder_object obj; struct { uint32_t cmd; struct binder_transaction_data txn; } __attribute__((packed)) writebuf; unsigned int readbuf[32

Re: [PATCH] staging: r8188eu: refactor recvframe_defrag()

2019-03-20 Thread Hans de Goede
Hi, On 20-03-19 15:31, Ivan Safonov wrote: Local variables pfhdr and prframe always have a same value, so one of them is unnecessary. Signed-off-by: Ivan Safonov Patch look good to me: Reviewed-by: Hans de Goede Regards, Hans --- drivers/staging/rtl8188eu/core/rtw_recv.c | 13 +

Re: [PATCH v3] staging: rtl8188eu: Fix potential NULL pointer dereference of kcalloc

2019-03-20 Thread Hans de Goede
Hi, On 20-03-19 18:21, Aditya Pakki wrote: hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem by returning error upstream in rtl8723bs, rtl8188eu. Signed-off-by: Aditya Pakki Patch look good to me: Reviewed-by: Hans de Goede R

Re: [PATCH v3] staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc

2019-03-20 Thread Mukesh Ojha
On 3/20/2019 9:12 PM, Aditya Pakki wrote: phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario by returning 0, consistent with the failure case. Signed-off-by: Aditya Pakki --- v2: Move the signed off line a

Re: pidfd design

2019-03-20 Thread Joel Fernandes
On Wed, Mar 20, 2019 at 07:51:57PM +0100, Christian Brauner wrote: [snip] > > > translate_pid() should just return you a pidfd. Having it return a pidfd > > > and a status fd feels like stuffing too much functionality in there. If > > > you're fine with it I'll finish prototyping what I had in mind

Re: pidfd design

2019-03-20 Thread Christian Brauner
On Wed, Mar 20, 2019 at 11:58:57AM -0700, Andy Lutomirski wrote: > On Wed, Mar 20, 2019 at 11:52 AM Christian Brauner > wrote: > > > > You're misunderstanding. Again, I said in my previous mails it should > > accept pidfds optionally as arguments, yes. But I don't want it to > > return the status

Re: pidfd design

2019-03-20 Thread Joel Fernandes
On Wed, Mar 20, 2019 at 07:26:50PM +0100, Christian Brauner wrote: > On Wed, Mar 20, 2019 at 07:33:51AM -0400, Joel Fernandes wrote: > > > > > > On March 20, 2019 3:02:32 AM EDT, Daniel Colascione > > wrote: > > >On Tue, Mar 19, 2019 at 8:59 PM Christian Brauner > > > wrote: > > >> > > >> On Tu

Re: pidfd design

2019-03-20 Thread Christian Brauner
On Wed, Mar 20, 2019 at 11:38:35AM -0700, Daniel Colascione wrote: > On Wed, Mar 20, 2019 at 11:26 AM Christian Brauner > wrote: > > On Wed, Mar 20, 2019 at 07:33:51AM -0400, Joel Fernandes wrote: > > > > > > > > > On March 20, 2019 3:02:32 AM EDT, Daniel Colascione > > > wrote: > > > >On Tue,

Re: pidfd design

2019-03-20 Thread Andy Lutomirski
On Wed, Mar 20, 2019 at 11:52 AM Christian Brauner wrote: > > You're misunderstanding. Again, I said in my previous mails it should > accept pidfds optionally as arguments, yes. But I don't want it to > return the status fds that you previously wanted pidfd_wait() to return. > I really want to see

Re: pidfd design

2019-03-20 Thread Christian Brauner
On Wed, Mar 20, 2019 at 07:33:51AM -0400, Joel Fernandes wrote: > > > On March 20, 2019 3:02:32 AM EDT, Daniel Colascione wrote: > >On Tue, Mar 19, 2019 at 8:59 PM Christian Brauner > > wrote: > >> > >> On Tue, Mar 19, 2019 at 07:42:52PM -0700, Daniel Colascione wrote: > >> > On Tue, Mar 19, 201

[PATCH v3] staging: rtl8188eu: Fix potential NULL pointer dereference of kcalloc

2019-03-20 Thread Aditya Pakki
hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem by returning error upstream in rtl8723bs, rtl8188eu. Signed-off-by: Aditya Pakki --- v2: Move signed off above version change log. v1: Return error and remove print in case of failur

[PATCH v3] staging: rtlwifi: rtl8822b: fix to avoid NULL pointer dereference

2019-03-20 Thread Aditya Pakki
skb allocated via dev_alloc_skb can fail and return a NULL pointer. This patch avoids such a scenario and returns, consistent with other invocations. Signed-off-by: Aditya Pakki --- v2: Move signed off above the version change log v1: Patch collision with rtl_phydm.c, fix as per Greg --- driver

Re: v5.1-rc1 binder_alloc_do_buffer_copy() BUG_ON triggered by selinux-testsuite

2019-03-20 Thread Todd Kjos
On Tue, Mar 19, 2019 at 8:04 PM Paul Moore wrote: > > On Tue, Mar 19, 2019 at 9:08 PM Todd Kjos wrote: > > Paul, > > > > Looking at a snippet of the test output: > > > > Service Provider read_consumed: 8 > > Service Provider command: BR_NOOP > > Service Provider command: BR_FAILED_REP

[PATCH v3] staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc

2019-03-20 Thread Aditya Pakki
phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario by returning 0, consistent with the failure case. Signed-off-by: Aditya Pakki --- v2: Move the signed off line above v1: Patch collision with different thing

Re: [PATCH] staging: rtlwifi: Fix potential NULL pointer dereference

2019-03-20 Thread Mukesh Ojha
On 3/13/2019 9:43 PM, Aditya Pakki wrote: phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/phydm/rtl_phydm.c | 3 +++ 1 file changed, 3 insertio

Re: [PATCH 1/1] staging: media: imx: imx7-mipi-csis: simplify getting .driver_data

2019-03-20 Thread Rui Miguel Silva
Hi Wolfram, Thanks for the patch. On Tue 19 Mar 2019 at 16:36, Wolfram Sang wrote: We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang Reviewed-by: Rui Miguel Silva --- Cheers, Rui ---

Re: [PATCH] driver : staging : ion: optimization for decreasing memory fragmentaion

2019-03-20 Thread Vlastimil Babka
You should have CC'd the ION maintainers/lists per ./scripts/get_maintainer.pl - CCing now. On 3/14/19 12:06 PM, Zhaoyang Huang wrote: > From: Zhaoyang Huang > > Two action for this patch: > 1. set a batch size for system heap's shrinker, which can have it buffer > reasonable page blocks in pool

[PATCH] staging: r8188eu: refactor recvframe_defrag()

2019-03-20 Thread Ivan Safonov
Local variables pfhdr and prframe always have a same value, so one of them is unnecessary. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/driv

Re: [PATCH] driver : staging : ion: optimization for decreasing memory fragmentaion

2019-03-20 Thread Laura Abbott
On 3/20/19 7:23 AM, Vlastimil Babka wrote: You should have CC'd the ION maintainers/lists per ./scripts/get_maintainer.pl - CCing now. On 3/14/19 12:06 PM, Zhaoyang Huang wrote: From: Zhaoyang Huang Two action for this patch: 1. set a batch size for system heap's shrinker, which can have it b

Re: [PATCH] staging: rtlwifi: Fix potential NULL pointer dereference

2019-03-20 Thread Mukesh Ojha
On 3/13/2019 9:43 PM, Aditya Pakki wrote: phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/phydm/rtl_phydm.c | 3 +++ 1 file changed, 3 inserti

[PATCH] staging: netlogic: replace skb_put/pull pair with skb_reserve

2019-03-20 Thread Ivan Safonov
The sequence skb_put(skb); skb_pull(skb); leads to the same result as skb_reserve(skb); but second is a little shorter and clearer. Signed-off-by: Ivan Safonov --- drivers/staging/netlogic/xlr_net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/sta

Re: [RESEND][PATCH 2/2] staging: sm750fb: trivial Camel Case removal for setDisplayControl().

2019-03-20 Thread Dan Carpenter
On Mon, Mar 04, 2019 at 12:55:32AM +0800, Yifeng Li wrote: > Rename the function setDisplayControl() to set_display_control(). > This fixes the following checkpatch.pl warning: > > CHECK: Avoid CamelCase: > > Suggested-by: Jin Chen > Signed-off-by: Jin Chen > [to...@tomli.me: resent as tri

Re: pidfd design

2019-03-20 Thread Joel Fernandes
On March 20, 2019 3:02:32 AM EDT, Daniel Colascione wrote: >On Tue, Mar 19, 2019 at 8:59 PM Christian Brauner > wrote: >> >> On Tue, Mar 19, 2019 at 07:42:52PM -0700, Daniel Colascione wrote: >> > On Tue, Mar 19, 2019 at 6:52 PM Joel Fernandes > wrote: >> > > >> > > On Wed, Mar 20, 2019 at 12:1

Re: [PATCH] staging: rtlwifi: Fix potential NULL pointer dereference

2019-03-20 Thread Dan Carpenter
On Wed, Mar 13, 2019 at 11:13:34AM -0500, Aditya Pakki wrote: > phydm.internal is allocated using kzalloc which is used multiple > times without a check for NULL pointer. This patch avoids such a > scenario. > > Signed-off-by: Aditya Pakki > --- > drivers/staging/rtlwifi/phydm/rtl_phydm.c | 3 ++

Re: static analysis bug report: staging r8712u memcpy of uninitialized variable

2019-03-20 Thread Dan Carpenter
On Mon, Mar 18, 2019 at 11:20:51AM +, Colin Ian King wrote: > Hi, > > Static analysis with cppcheck found a couple of interesting issues with > memcpy'ing of an uninitialized variable. Two occurrences of the same > issue are found in drivers/staging/rtl8712/rtl8712_cmd.c in functions > read_bb

[PATCH] staging: rtl8188eu: remove unused WFD defines

2019-03-20 Thread Michael Straube
All defined WFD* in wifi.h are unused in the driver code, so remove them. Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/include/wifi.h | 20 1 file changed, 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu/inc

Re: [PATCH] x86/Hyper-V: Fix definition HV_MAX_FLUSH_REP_COUNT

2019-03-20 Thread Thomas Gleixner
On Fri, 15 Mar 2019, Paolo Bonzini wrote: > On 22/02/19 11:48, lantianyu1...@gmail.com wrote: > > From: Lan Tianyu > > > > The max flush rep count of HvFlushGuestPhysicalAddressList hypercall > > is equal with how many entries of union hv_gpa_page_range can be populated > > into the input parame

Re: [PATCH 3/3] staging: iio: ad7780: Add parentheses to macros

2019-03-20 Thread Dan Carpenter
On Sun, Mar 17, 2019 at 11:53:12PM +0300, Vladimir Petrigo wrote: > - Fix CHECK Macro argument 'wordsize' may be better as '(wordsize)' to avoid > precedence issues > - Fix CHECK Macro argument reuse 'bits' - possible side-effects? > > Signed-off-by: Vladimir Petrigo > --- > drivers/staging/iio

Re: [PATCH 2/3] staging: iio: ad7280a: Add parentheses to macros

2019-03-20 Thread Dan Carpenter
On Sun, Mar 17, 2019 at 11:53:11PM +0300, Vladimir Petrigo wrote: > Fix CHECK Macro argument 'c' may be better as '(c)' to > avoid precedence issues > > Signed-off-by: Vladimir Petrigo > > diff --git a/drivers/staging/iio/adc/ad7280a.c > b/drivers/staging/iio/adc/ad7280a.c index d9df126..98cf876

Re: [PATCH v2] staging: rtl8188eu: Fix potential NULL pointer dereference

2019-03-20 Thread Greg Kroah-Hartman
On Tue, Mar 19, 2019 at 04:07:54PM -0500, Aditya Pakki wrote: > hwxmits is allocated via kcalloc and not checked for failure before its > dereference. The patch fixes this problem by returning an error in > rtl8723bs. > > --- > v1: Return error and remove print in case of failure, per Greg > Signe

Re: [PATCH v2] staging: rtlwifi: rtl8822b: fix to avoid NULL pointer dereference

2019-03-20 Thread Greg Kroah-Hartman
On Tue, Mar 19, 2019 at 03:21:25PM -0500, Aditya Pakki wrote: > skb allocated via dev_alloc_skb can fail and return a NULL pointer. > This patch avoids such a scenario and returns, consistent with other > invocations. > > --- > v1: Patch collision with rtl_phydm.c, fix as per Greg > Signed-off-by:

Re: [PATCH v2] staging: rtlwifi: rtl8822b: fix to avoid NULL pointer dereference

2019-03-20 Thread Greg Kroah-Hartman
On Tue, Mar 19, 2019 at 03:21:25PM -0500, Aditya Pakki wrote: > skb allocated via dev_alloc_skb can fail and return a NULL pointer. > This patch avoids such a scenario and returns, consistent with other > invocations. > > --- > v1: Patch collision with rtl_phydm.c, fix as per Greg > Signed-off-by:

Re: [PATCH v2] staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc

2019-03-20 Thread Greg Kroah-Hartman
On Tue, Mar 19, 2019 at 03:15:08PM -0500, Aditya Pakki wrote: > phydm.internal is allocated using kzalloc which is used multiple > times without a check for NULL pointer. This patch avoids such a > scenario. > > -- > v1: Patch collision with different things, fix as per Greg > Signed-off-by: Adity

Re: [PATCH] staging: emxx_udc: fix various indentation issues

2019-03-20 Thread Dan Carpenter
On Sun, Mar 17, 2019 at 04:14:11PM +0100, Emiliano Ingrassia wrote: > This patch fixes various indentation and coding style issues in > EMXX UDC device controller driver. > Only fix one thing at a time, not "various". No signed-off-by line. regards, dan carpenter __

Re: pidfd design

2019-03-20 Thread Daniel Colascione
On Tue, Mar 19, 2019 at 8:59 PM Christian Brauner wrote: > > On Tue, Mar 19, 2019 at 07:42:52PM -0700, Daniel Colascione wrote: > > On Tue, Mar 19, 2019 at 6:52 PM Joel Fernandes > > wrote: > > > > > > On Wed, Mar 20, 2019 at 12:10:23AM +0100, Christian Brauner wrote: > > > > On Tue, Mar 19, 201