Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1571042

Re: [PATCH] r8152: Allocate interrupt buffer as part of struct r8152

From Eric Dumazet <eric.dumazet@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] r8152: Allocate interrupt buffer as part of struct r8152
Date 2017-01-31 21:00 +0100
Message-ID <t5MKR-4Js-1@gated-at.bofh.it> (permalink)
References <t5LYt-4tk-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 2017-01-31 at 11:06 -0800, Guenter Roeck wrote:
> When unloading the r8152 driver using the 'unbind' sysfs attribute
> in a system with KASAN enabled, the following error message is seen
> on a regular basis.

>  
>  static int alloc_all_mem(struct r8152 *tp)
> @@ -1423,10 +1420,6 @@ static int alloc_all_mem(struct r8152 *tp)
>  	if (!tp->intr_urb)
>  		goto err1;
>  
> -	tp->intr_buff = kmalloc(INTBUFSIZE, GFP_KERNEL);
> -	if (!tp->intr_buff)
> -		goto err1;
> -
>  	tp->intr_interval = (int)ep_intr->desc.bInterval;
>  	usb_fill_int_urb(tp->intr_urb, tp->udev, usb_rcvintpipe(tp->udev, 3),
>  			 tp->intr_buff, INTBUFSIZE, intr_callback,

This might lead to intr_buff being backed by vzalloc() instead of
kzalloc() (check alloc_netdev_mqs())

It looks like it could cause a bug.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] r8152: Allocate interrupt buffer as part of struct r8152 Guenter Roeck <linux@roeck-us.net> - 2017-01-31 20:10 +0100
  Re: [PATCH] r8152: Allocate interrupt buffer as part of struct r8152 Eric Dumazet <eric.dumazet@gmail.com> - 2017-01-31 21:00 +0100
    Re: [PATCH] r8152: Allocate interrupt buffer as part of struct r8152 Guenter Roeck <linux@roeck-us.net> - 2017-01-31 23:20 +0100
  Re: [PATCH] r8152: Allocate interrupt buffer as part of struct r8152 Alan Stern <stern@rowland.harvard.edu> - 2017-01-31 21:00 +0100
    Re: [PATCH] r8152: Allocate interrupt buffer as part of struct r8152 Guenter Roeck <linux@roeck-us.net> - 2017-01-31 23:20 +0100
    Re: [PATCH] r8152: Allocate interrupt buffer as part of struct r8152 Guenter Roeck <linux@roeck-us.net> - 2017-02-03 22:30 +0100

csiph-web