<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/firewire/fw-cdev.c, branch v2.6.26</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.26</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.26'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2008-06-18T22:12:35Z</updated>
<entry>
<title>firewire: fill_bus_reset_event needs lock protection</title>
<updated>2008-06-18T22:12:35Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2008-06-06T20:11:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5cb84067d646fa3889463129dad8b218806b4698'/>
<id>urn:sha1:5cb84067d646fa3889463129dad8b218806b4698</id>
<content type='text'>
Callers of fill_bus_reset_event() have to take card-&gt;lock.  Otherwise
access to node data may oops if node removal is in progress.

A lockless alternative would be

-	event-&gt;local_node_id = card-&gt;local_node-&gt;node_id;
+	tmp = fw_node_get(card-&gt;local_node);
+	event-&gt;local_node_id = tmp-&gt;node_id;
+	fw_node_put(tmp);

and ditto with the other node pointers which fill_bus_reset_event()
accesses.  But I went the locked route because one of the two callers
already holds the lock.  As a bonus, we don't need the memory barrier
anymore because device-&gt;generation and device-&gt;node_id are written in
a card-&gt;lock protected section.

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Kristian Høgsberg &lt;krh@redhat.com&gt;
</content>
</entry>
<entry>
<title>firewire: prevent userspace from accessing shut down devices</title>
<updated>2008-05-20T16:24:17Z</updated>
<author>
<name>Jay Fenlason</name>
<email>fenlason@redhat.com</email>
</author>
<published>2008-05-16T15:15:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=551f4cb9de716ffcdaf968c99a450c22ff12e8c3'/>
<id>urn:sha1:551f4cb9de716ffcdaf968c99a450c22ff12e8c3</id>
<content type='text'>
If userspace ignores the POLLERR bit from poll(), and only attempts to
read() the device when POLLIN is set, it can still make ioctl() calls on
a device that has been removed from the system.  The node_id and
generation returned by GET_INFO will be outdated, but INITIATE_BUS_RESET
would still cause a bus reset, and GET_CYCLE_TIMER will return data.
And if you guess the correct generation to use, you can send requests to
a different device on the bus, and get responses back.

This patch prevents open, ioctl, compat_ioctl, and mmap against shutdown
devices.

Signed-off-by: Jay Fenlason &lt;fenlason@redhat.com&gt;
Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: reread config ROM when device reset the bus</title>
<updated>2008-04-18T15:55:36Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2008-03-24T19:54:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c9755e14a01987ada4063e8b4c50c2b6738d879e'/>
<id>urn:sha1:c9755e14a01987ada4063e8b4c50c2b6738d879e</id>
<content type='text'>
When a device changes its configuration ROM, it announces this with a
bus reset.  firewire-core has to check which node initiated a bus reset
and whether any unit directories went away or were added on this node.

Tested with an IOI FWB-IDE01AB which has its link-on bit set if bus
power is available but does not respond to ROM read requests if self
power is off.  This implements
  - recognition of the units if self power is switched on after fw-core
    gave up the initial attempt to read the config ROM,
  - shutdown of the units when self power is switched off.

Also tested with a second PC running Linux/ieee1394.  When the eth1394
driver is inserted and removed on that node, fw-core now notices the
addition and removal of the IPv4 unit on the ieee1394 node.

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: fix NULL pointer deref. and resource leak</title>
<updated>2008-02-21T18:05:56Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2008-02-20T20:10:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fae603121428ba83b7343c88e68a7144525ab3eb'/>
<id>urn:sha1:fae603121428ba83b7343c88e68a7144525ab3eb</id>
<content type='text'>
By supplying ioctl()s in the wrong order, a userspace client was able to
trigger NULL pointer dereferences.  Furthermore, by calling
ioctl_create_iso_context more than once, new contexts could be created
without ever freeing the previously created contexts.

Thanks to Anders Blomdell for the report.

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: fix "kobject_add failed for fw* with -EEXIST"</title>
<updated>2008-02-16T14:40:33Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2008-02-02T14:01:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=96b19062e741b715cf399312c30e0672d8889569'/>
<id>urn:sha1:96b19062e741b715cf399312c30e0672d8889569</id>
<content type='text'>
There is a race between shutdown and creation of devices:  fw-core may
attempt to add a device with the same name of an already existing
device.  http://bugzilla.kernel.org/show_bug.cgi?id=9828

Impact of the bug:  Happens rarely (when shutdown of a device coincides
with creation of another), forces the user to unplug and replug the new
device to get it working.

The fix is obvious:  Free the minor number *after* instead of *before*
device_unregister().  This requires to take an additional reference of
the fw_device as long as the IDR tree points to it.

And while we are at it, we fix an additional race condition:
fw_device_op_open() took its reference of the fw_device a little bit too
late, hence was in danger to access an already invalid fw_device.

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: enforce access order between generation and node ID, fix "giving up on config rom"</title>
<updated>2008-01-30T21:22:27Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2008-01-25T17:57:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b5d2a5e04e6a26cb3f77af8cbc31e74c361d706c'/>
<id>urn:sha1:b5d2a5e04e6a26cb3f77af8cbc31e74c361d706c</id>
<content type='text'>
fw_device.node_id and fw_device.generation are accessed without mutexes.
We have to ensure that all readers will get to see node_id updates
before generation updates.

Fixes an inability to recognize devices after "giving up on config rom",
https://bugzilla.redhat.com/show_bug.cgi?id=429950

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;

Reviewed by Nick Piggin &lt;nickpiggin@yahoo.com.au&gt;.

Verified to fix 'giving up on config rom' issues on multiple system and
drive combinations that were previously affected.

Signed-off-by: Jarod Wilson &lt;jwilson@redhat.com&gt;
Signed-off-by: Kristian Høgsberg &lt;krh@redhat.com&gt;
</content>
</entry>
<entry>
<title>firewire: fw-cdev: use device generation, not card generation</title>
<updated>2008-01-30T21:22:27Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2008-01-24T00:53:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf5a56ac8083dd04ffe8b9b2ec7895e9bcff44bc'/>
<id>urn:sha1:cf5a56ac8083dd04ffe8b9b2ec7895e9bcff44bc</id>
<content type='text'>
We have to use the fw_device.generation here, not the fw_card.generation,
because the generation must never be newer than the node ID when we emit
a transaction.  This cannot be guaranteed with fw_card.generation.

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;

Verified in concert with subsequent memory barriers patch to fix 'giving
up on config rom' issues on multiple system and drive combinations that
were previously affected.

Signed-off-by: Jarod Wilson &lt;jwilson@redhat.com&gt;
</content>
</entry>
<entry>
<title>firewire: fw-cdev: reorder wakeup vs. spinlock</title>
<updated>2007-10-16T22:00:10Z</updated>
<author>
<name>Jay Fenlason</name>
<email>fenlason@redhat.com</email>
</author>
<published>2007-10-08T21:00:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=83431cba3d847fc2296d3f38ce7feb623a1cfc45'/>
<id>urn:sha1:83431cba3d847fc2296d3f38ce7feb623a1cfc45</id>
<content type='text'>
Signed-off-by: Jay Fenlason &lt;fenlason@redhat.com&gt;

Prompted by https://bugzilla.redhat.com/show_bug.cgi?id=323411

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: adopt read cycle timer ABI from raw1394</title>
<updated>2007-10-16T22:00:08Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2007-09-29T08:41:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a64408b96b5f67c2778958a230b5cfa3408a4a81'/>
<id>urn:sha1:a64408b96b5f67c2778958a230b5cfa3408a4a81</id>
<content type='text'>
This duplicates the read cycle timer feature of raw1394 (added in Linux
2.6.21) in firewire-core's userspace ABI.  The argument to the ioctl is
reordered though to ensure 32/64 bit compatibility.

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Kristian Høgsberg &lt;krh@redhat.com&gt;
</content>
</entry>
<entry>
<title>firewire: fw-core: local variable shadows a global one</title>
<updated>2007-10-16T22:00:01Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2007-08-03T18:56:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=930e4b7fe3b4e1c4e14b9c22e4c9c74dc8db75f3'/>
<id>urn:sha1:930e4b7fe3b4e1c4e14b9c22e4c9c74dc8db75f3</id>
<content type='text'>
Sparse warned about it although it was apparently harmless:

drivers/firewire/fw-cdev.c:624:23: warning: symbol 'interrupt' shadows an earlier one
include/asm/hw_irq.h:29:13: originally declared here

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
</feed>
