lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 20 Sep 2010 11:27:27 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	m.nazarewicz@...sung.com
Cc:	dbrownell@...rs.sourceforge.net, gregkh@...e.de,
	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	eric.dumazet@...il.com
Subject: Re: [PATCH] usb: gadget: rndis: don't use dev_get_stats()

From: Michal Nazarewicz <m.nazarewicz@...sung.com>
Date: Mon, 20 Sep 2010 20:23:04 +0200

> This commit removes the call to dev_get_stats() from the
> gen_ndis_query_resp() function.  Since spin_lock_bh() was
> added to dev_txq_stats_fold() the call started causing
> warnings.  This is because gen_ndis_query_resp() can be
> (indirectly) called from rndis_command_complete() which is
> called with interrupts disabled.
> 
> While at it, this commit also changes the
> gen_ndis_query_resp() function so that "net" local variable is
> used instead of "rndis_per_dev_params[configNr].dev" in all
> places this is referenced.
> 
> Signed-off-by: Michal Nazarewicz <m.nazarewicz@...sung.com>

The way this works is dev_get_stats() takes that "temp" object the
caller provides, it writes the correct statistics into it (with any
necessary translations), and then passes back a pointer to it.

See net/core/dev.c:dev_get_stats()

You must use dev_get_stats() or else the statistics won't be properly
converted.

Like I originally suggested, you need to rearrange the code in this
driver such that the gen_ndis_query_resp() work happens in a tasklet,
workqueue, or some other non-hardware-irq context.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ