[PATCH] usb: gadget: tcm_usb_gadget: stop format strings

2014-03-11 Thread Kees Cook
This makes sure that the name coming out of configfs cannot be used accidentally as a format string. Signed-off-by: Kees Cook keesc...@chromium.org --- drivers/usb/gadget/tcm_usb_gadget.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/tcm_usb_gadget.c

[PATCH v2] usb: gadget: tcm_usb_gadget: stop format strings

2014-03-11 Thread Kees Cook
This makes sure that the name coming out of configfs cannot be used accidentally as a format string. Signed-off-by: Kees Cook keesc...@chromium.org Cc: sta...@vger.kernel.org --- v2: - with stable cc; Felipe Balbi. --- drivers/usb/gadget/tcm_usb_gadget.c |2 +- 1 file changed, 1 insertion

Re: [PATCH 1/1] subsystem:usb

2016-09-07 Thread Kees Cook
driver */ > + dev_err(idev, "Not able to get a minor for this device.\n"); > + usb_set_intfdata (interface, NULL); > + goto error; > + } > + dev->minor = interface->minor; > + > + /* let the user kn

[PATCH v2 16/31] usb/phy-isp1301-omap: Remove .data assignment

2017-09-20 Thread Kees Cook
n <gre...@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Cc: linux-o...@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/phy/phy-isp1301-omap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/phy/phy-isp1301-omap.c b/drivers/usb/phy/phy-is

[PATCH v2 27/31] usb/gadget/snps_udc_core: Remove struct timer_list.data use

2017-09-20 Thread Kees Cook
Kroah-Hartman <gre...@linuxfoundation.org> Cc: Raviteja Garimella <raviteja.garime...@broadcom.com> Cc: Michal Nazarewicz <min...@mina86.com> Cc: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc..

[PATCH] usb: isp1301-omap: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
c: linux-usb@vger.kernel.org Cc: linux-o...@vger.kernel.org Cc: Thomas Gleixner <t...@linutronix.de> Signed-off-by: Kees Cook <keesc...@chromium.org> --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise

[PATCH] xhci: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
t; Cc: linux-usb@vger.kernel.org Cc: Thomas Gleixner <t...@linutronix.de> Signed-off-by: Kees Cook <keesc...@chromium.org> --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone. ---

[PATCH] HID: usbhid: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
soires <benjamin.tissoi...@redhat.com> Cc: linux-in...@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: Thomas Gleixner <t...@linutronix.de> Signed-off-by: Kees Cook <keesc...@chromium.org> --- This requires commit 686fef928bba ("timer: Prepare to change timer callback

[PATCH] net/usb/usbnet: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
org Cc: Thomas Gleixner <t...@linutronix.de> Signed-off-by: Kees Cook <keesc...@chromium.org> --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone. --- drivers/net/usb/usbnet.c | 12 +++

[PATCH] USB: serial: garmin_gps: Convert timers to use timer_setup()

2017-10-10 Thread Kees Cook
Hartman <gre...@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/serial/garmin_gps.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_

[PATCH] usb/gadget/snps_udc_core: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
com> Cc: Michal Nazarewicz <min...@mina86.com> Cc: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/gadget/udc/snps_udc_core.c | 19 ++- 1 file changed, 6 insert

[PATCH] usb: phy: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
c: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/phy/phy-mv-usb.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c index 0e315694adc9..fc9ed047d25d 100644

[PATCH] usb: isp1301-omap: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
c: linux-usb@vger.kernel.org Cc: linux-o...@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> Acked-by: Tony Lindgren <t...@atomide.com> --- drivers/usb/phy/phy-isp1301-omap.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/phy/phy-isp13

[PATCH 48/58] net: usb: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
...@mork.no> Cc: "Stefan BrĂ¼ns" <stefan.bru...@rwth-aachen.de> Cc: Alexey Dobriyan <adobri...@gmail.com> Cc: Greg Ungerer <g...@linux-m68k.org> Cc: linux-usb@vger.kernel.org Cc: net...@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/net/us

[PATCH] xhci: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
t; Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/host/xhci-mem.c | 4 ++-- drivers/usb/host/xhci-ring.c | 9 +++-- drivers/usb/host/xhci.h | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/usb/host/xhci-m

[PATCH 07/58] net/usb/usbnet: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/net/usb/usbnet.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 6510e5cc1817..80348b6a8646 100644 --- a/drivers/net/usb/usbnet.c +++ b/dri

Re: [PATCH 27/31] usb/gadget/snps_udc_core: Move timer initialization earlier

2017-09-06 Thread Kees Cook
On Sun, Sep 3, 2017 at 2:12 PM, Michal Nazarewicz <min...@mina86.com> wrote: > On Thu, Aug 31 2017, Kees Cook wrote: >> With timer initialization made earlier at the start, there is no reason >> to make del_timer_sync() calls conditionally, there by removing the >

Re: [PATCH v2] usb: gadget: configfs: Fix KASAN use-after-free

2017-09-01 Thread Kees Cook
ING_WITH_NULL_LEN, GFP_KERNEL); > + if (!str) > + return -ENOMEM; > + } > + strcpy(str, s); > if (str[ret - 1] == '\n') > str[ret - 1] = '\0'; > - kfree(copy); > *s_copy = str; > return 0; > } > -- > 2.7.4 > -Kees -- Kees Cook Pixel Security -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 16/31] usb/phy-isp1301-omap: Remove .data assignment

2017-08-31 Thread Kees Cook
n <gre...@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Cc: linux-o...@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/phy/phy-isp1301-omap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/phy/phy-isp1301-omap.c b/drivers/usb/phy/phy-is

[PATCH 27/31] usb/gadget/snps_udc_core: Move timer initialization earlier

2017-08-31 Thread Kees Cook
ja Garimella <raviteja.garime...@broadcom.com> Cc: Michal Nazarewicz <min...@mina86.com> Cc: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/gadget/udc/snps_udc_core.c | 16

Re: linux-next: manual merge of the usb-gadget tree with the usb tree

2017-10-18 Thread Kees Cook
> complex conflicts. FWIW, timer_setup() should be preferred over setup_timer(). -Kees -- Kees Cook Pixel Security -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: linux-next: manual merge of the usb-gadget tree with the usb tree

2017-10-18 Thread Kees Cook
conflicting tree to minimise any > particularly complex conflicts. FWIW, timer_setup() should be preferred over setup_timer(). -Kees -- Kees Cook Pixel Security -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] usb: gadget: zero: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
: Greg Kroah-Hartman <gre...@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/gadget/legacy/zero.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/legacy/zero.c b/drivers/usb/ga

[PATCH] usb: musb: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
structure for devices to use for their per-device timer. Cc: Bin Liu <b-...@ti.com> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/musb/am35x.c | 24 +++-

[PATCH] usb: isp1760: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
@embeddedor.com> Cc: Bhumika Goyal <bhumi...@gmail.com> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/isp1760/isp1760-hcd.c | 8 +--- drivers/usb/isp1760/isp1760-udc.c | 7 +++ 2 files changed, 8 insertions(+), 7 deletions(-)

[PATCH] usb: usbtest: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
gt; Cc: Felipe Balbi <felipe.ba...@linux.intel.com> Cc: Alan Stern <st...@rowland.harvard.edu> Cc: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/misc/usbtest.c | 22 ++

[PATCH] usb: r8a66597-hcd: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
: Greg Kroah-Hartman <gre...@linuxfoundation.org> Cc: Chris Brandt <chris.bra...@renesas.com> Cc: Julia Lawall <julia.law...@lip6.fr> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/host/r8a66597-hcd.c | 27 ++---

[PATCH] usb: usbatm: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
gt; Cc: Duncan Sands <duncan.sa...@free.fr> Cc: Allen Pais <allen.l...@gmail.com> Cc: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Cc: accessrunner-gene...@lists.sourceforge.net Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org&

[PATCH] usb: usbip: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
roah-Hartman <gre...@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/usbip/vudc_transfer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/usbip/vudc_transfer.c b/drivers/usb/usb

Re: [PATCH] usb: usbtest: Convert timers to use timer_setup()

2017-10-25 Thread Kees Cook
Sorry, I sent this one but forgot that timer_setup_on_stack() is in -next only. If it's okay, I can carry it in the timers tree. Thanks! -Kees On Tue, Oct 24, 2017 at 12:27 PM, Felipe Balbi <felipe.ba...@linux.intel.com> wrote: > Kees Cook <keesc...@chromium.org> writes: >

Re: [PATCH] usb: usbatm: Convert timers to use timer_setup()

2017-10-25 Thread Kees Cook
This also uses timer_setup_on_stack() (only in -next). If it's okay, I'll carry it in the timers tree. Thanks! -Kees On Tue, Oct 24, 2017 at 12:08 PM, Kees Cook <keesc...@chromium.org> wrote: > In preparation for unconditionally passing the struct timer_list pointer to > all tim

[PATCH] mmc: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
apouillou.net> Cc: Heiner Kallweit <hkallwe...@gmail.com> Cc: Shawn Lin <shawn@rock-chips.com> Cc: Arvind Yadav <arvind.yadav...@gmail.com> Cc: Allen <allen.l...@gmail.com> Cc: linux-...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-amlo..

Re: [PATCH] drivers/hid: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
On Tue, Oct 24, 2017 at 10:55 AM, Allen Pais <allen.p...@oracle.com> wrote: > Switch to using the new timer_setup() and from_timer() > for drivers/hid/* > > Cc: Kees Cook <keesc...@chromium.org> > Signed-off-by: Allen Pais <allen.p...@oracle.com> Yup, this matche

Re: [PATCH] usb: musb: dsps: remove the duplicated timer

2017-10-30 Thread Kees Cook
gt; > - del_timer_sync(>timer); > + del_timer_sync(>dev_timer); > usb_phy_shutdown(musb->xceiv); > phy_power_off(musb->phy); > phy_exit(musb->phy); > @@ -1028,7 +1027,7 @@ static int dsps_suspend(struct device *dev) >

Re: [PATCH v3 2/2] usb: dwc2: host: Convert hcd_queue to timer_setup

2017-10-30 Thread Kees Cook
d-by: Stefan Wahren <stefan.wah...@i2se.com> > Signed-off-by: Douglas Anderson <diand...@chromium.org> > Cc: Kees Cook <keesc...@chromium.org> Acked-by: Kees Cook <keesc...@chromium.org> This matches my automated Coccinelle output for this code. (Actually, it's better beca

[PATCH] USB: chaoskey: Use kasprintf() over strcpy()/strcat()

2018-02-16 Thread Kees Cook
Instead of kmalloc() with manually calculated values followed by multiple strcpy()/strcat() calls, just fold it all into a single kasprintf() call. Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/misc/chaoskey.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-)

Re: [PATCH v2] usb: isp1760: Use kasprintf

2018-03-07 Thread Kees Cook
-off-by: Himanshu Jha <himanshujha199...@gmail.com> Reviewed-by: Kees Cook <keesc...@chromium.org> -Kees > --- > drivers/usb/isp1760/isp1760-udc.c | 6 +- > 1 file changed, 1 insertion(+), 5 deletions(-) > > v2: >-removed the useless local variable devname. > > di

Re: [GIT PULL] USB/PHY driver patches for 4.17-rc1

2018-04-05 Thread Kees Cook
t the set_fs() usage? We've been try to eliminate it in the kernel. I thought there was a safer way to use iters now? -Kees -- Kees Cook Pixel Security -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More m

[PATCH 3/3] console: Expand dummy functions for CFI

2018-02-26 Thread Kees Cook
oogle.com> Signed-off-by: Kees Cook <keesc...@chromium.org> --- drivers/usb/misc/sisusbvga/sisusb_con.c | 67 +--- drivers/video/console/dummycon.c| 69 + drivers/video/console/newport_con.c | 10 ++--- drivers/vide

[PATCH 2/3] console: Fill in struct consw argument names

2018-02-26 Thread Kees Cook
. Signed-off-by: Kees Cook <keesc...@chromium.org> --- include/linux/console.h | 58 +++-- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/include/linux/console.h b/include/linux/console.h index b8920a031a3e..dfd6b0e97855 100644 --- a/i

[PATCH 0/3] console: Expand dummy functions for CFI

2018-02-26 Thread Kees Cook
This is a small series that cleans up struct consw a bit and prepares it for Control Flow Integrity checking (i.e. Clang's -fsanitize=cfi). Thanks! -Kees -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo

[PATCH 1/3] console: SisUSB2VGA: Drop dummy con_font_get()

2018-02-26 Thread Kees Cook
As done in commit: 724ba8b30b04 ("console/dummy: leave .con_font_get set to NULL") This drops the dummy .con_font_get(), as it could leave arguments uninitialized. Cc: Thomas Winischhofer <tho...@winischhofer.net> Signed-off-by: Kees Cook <keesc...@chromium.org>