<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/firewire, branch v2.6.32.60</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/firewire?h=v2.6.32.60</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/firewire?h=v2.6.32.60'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2010-12-09T21:26:50Z</updated>
<entry>
<title>firewire: ohci: fix race in AR split packet handling</title>
<updated>2010-12-09T21:26:50Z</updated>
<author>
<name>Clemens Ladisch</name>
<email>clemens@ladisch.de</email>
</author>
<published>2010-10-25T09:42:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=263256d70931663c62b1699c007a853e3a6db2ea'/>
<id>urn:sha1:263256d70931663c62b1699c007a853e3a6db2ea</id>
<content type='text'>
commit a1f805e5e73a8fe166b71c6592d3837df0cd5e2e upstream.

When handling an AR buffer that has been completely filled, we assumed
that its descriptor will not be read by the controller and can be
overwritten.  However, when the last received packet happens to end at
the end of the buffer, the controller might not yet have moved on to the
next buffer and might read the branch address later.  If we overwrite
and free the page before that, the DMA context will either go dead
because of an invalid Z value, or go off into some random memory.

To fix this, ensure that the descriptor does not get overwritten by
using only the actual buffer instead of the entire page for reassembling
the split packet.  Furthermore, to avoid freeing the page too early,
move on to the next buffer only when some data in it guarantees that the
controller has moved on.

This should eliminate the remaining firewire-net problems.

Signed-off-by: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Tested-by: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firewire: ohci: fix buffer overflow in AR split packet handling</title>
<updated>2010-12-09T21:26:49Z</updated>
<author>
<name>Clemens Ladisch</name>
<email>clemens@ladisch.de</email>
</author>
<published>2010-10-25T09:41:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9cfed69ea337d0b811044aa3222baa7306dc78a9'/>
<id>urn:sha1:9cfed69ea337d0b811044aa3222baa7306dc78a9</id>
<content type='text'>
commit 85f7ffd5d2b320f73912b15fe8cef34bae297daf upstream.

When the controller had to split a received asynchronous packet into two
buffers, the driver tries to reassemble it by copying both parts into
the first page.  However, if size + rest &gt; PAGE_SIZE, i.e., if the yet
unhandled packets before the split packet, the split packet itself, and
any received packets after the split packet are together larger than one
page, then the memory after the first page would get overwritten.

To fix this, do not try to copy the data of all unhandled packets at
once, but copy the possibly needed data every time when handling
a packet.

This gets rid of most of the infamous crashes and data corruptions when
using firewire-net.

Signed-off-by: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Tested-by: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firewire: core: fix an information leak</title>
<updated>2010-12-09T21:26:49Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2010-02-19T20:00:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7098a32a0303c42e8b2db72fd8cf58c624a96a7e'/>
<id>urn:sha1:7098a32a0303c42e8b2db72fd8cf58c624a96a7e</id>
<content type='text'>
commit 137d9ebfdbaa45c01f9f0f6d5121ae6f1eb942bd upstream.

If a device exposes a sparsely populated configuration ROM,
firewire-core's sysfs interface and character device file interface
showed random data in the gaps between config ROM blocks.  Fix this by
zero-initialization of the config ROM reader's scratch buffer.

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Cc: maximilian attems &lt;max@stro.at&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firewire: cdev: fix information leak</title>
<updated>2010-12-09T21:26:48Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2010-04-07T06:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6f3fc70b17939b2b3786198d6d5f30c2066516c9'/>
<id>urn:sha1:6f3fc70b17939b2b3786198d6d5f30c2066516c9</id>
<content type='text'>
commit 9cac00b8f0079d5d3d54ec4dae453d58dec30e7c upstream.

A userspace client got to see uninitialized stack-allocated memory if it
specified an _IOC_READ type of ioctl and an argument size larger than
expected by firewire-core's ioctl handlers (but not larger than the
core's union ioctl_arg).

Fix this by clearing the requested buffer size to zero, but only at _IOR
ioctls.  This way, there is almost no runtime penalty to legitimate
ioctls.  The only legitimate _IOR is FW_CDEV_IOC_GET_CYCLE_TIMER with 12
or 16 bytes to memset.

[Another way to fix this would be strict checking of argument size (and
possibly direction) vs. command number.  However, we then need a lookup
table, and we need to allow for slight size deviations in case of 32bit
userland on 64bit kernel.]

Reported-by: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
[ Backported to 2.6.32 firewire core -maks ]
Signed-off-by: maximilian attems &lt;max@stro.at&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firewire: core: check for 1394a compliant IRM, fix inaccessibility of Sony camcorder</title>
<updated>2010-07-05T18:11:04Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2010-05-30T17:43:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2a6705430f6159a5e086cc58f9f173f2fdfcb3a5'/>
<id>urn:sha1:2a6705430f6159a5e086cc58f9f173f2fdfcb3a5</id>
<content type='text'>
commit 10389536742cefbedecb67a5b2906f155cf3a1c3 upstream.

Per IEEE 1394 clause 8.4.2.3, a contender for the IRM role shall check
whether the current IRM complies to 1394a-2000 or later.  If not force a
compliant node (e.g. itself) to become IRM.  This was implemented in the
older ieee1394 driver but not yet in firewire-core.

An older Sony camcorder (Sony DCR-TRV25) which implements 1394-1995 IRM
but neither 1394a-2000 IRM nor BM was now found to cause an
interoperability bug:
  - Camcorder becomes root node when plugged in, hence gets IRM role.
  - firewire-core successfully contends for BM role, proceeds to perform
    gap count optimization and resets the bus.
  - Sony camcorder ignores presence of a BM (against the spec, this is
    a firmware bug), performs its idea of gap count optimization and
    resets the bus.
  - Preceding two steps are repeated endlessly, bus never settles,
    regular I/O is practically impossible.
http://thread.gmane.org/gmane.linux.kernel.firewire.user/3913

This is an interoperability regression from the old to the new drivers.
Fix it indirectly by adding the 1394a IRM check.  The spec suggests
three and a half methods to determine 1394a compliance of a remote IRM;
we choose the method of testing the Config_ROM.Bus_Info.generation
field.  This is data that firewire-core should have readily available at
this point, i.e. does not require extra I/O.

Reported-by: Clemens Ladisch &lt;clemens@ladisch.de&gt; (missing 1394a check)
Reported-by: H. S. &lt;hs.samix@gmail.com&gt; (issue with Sony DCR-TRV25)
Tested-by: H. S. &lt;hs.samix@gmail.com&gt;
Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firewire: core: add_descriptor size check</title>
<updated>2010-02-09T12:50:52Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2010-01-29T20:25:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=80569f607b59fb59d0e7d86ae6467fefcab8e89b'/>
<id>urn:sha1:80569f607b59fb59d0e7d86ae6467fefcab8e89b</id>
<content type='text'>
Backport of commit e300839da40e99581581c5d053a95a172651fec8 upstream.

Presently, firewire-core only checks whether descriptors that are to be
added by userspace drivers to the local node's config ROM do not exceed
a size of 256 quadlets.  However, the sum of the bare minimum ROM plus
all descriptors (from firewire-core, from firewire-net, from userspace)
must not exceed 256 quadlets.

Otherwise, the bounds of a statically allocated buffer will be
overwritten.  If the kernel survives that, firewire-core will
subsequently be unable to parse the local node's config ROM.

(Note, userspace drivers can add descriptors only through device files
of local nodes.  These are usually only accessible by root, unlike
device files of remote nodes which may be accessible to lesser
privileged users.)

Therefore add a test which takes the actual present and required ROM
size into account for all descriptors of kernelspace and userspace
drivers.

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firewire: ohci: fix crashes with TSB43AB23 on 64bit systems</title>
<updated>2010-02-09T12:50:42Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2010-01-26T20:39:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=16a2ae6eb112b506ca1e464d848e684f6f90dadc'/>
<id>urn:sha1:16a2ae6eb112b506ca1e464d848e684f6f90dadc</id>
<content type='text'>
commit 7a481436787cbc932af6c407b317ac603969a242 upstream.

Unsurprisingly, Texas Instruments TSB43AB23 exhibits the same behaviour
as TSB43AB22/A in dual buffer IR DMA mode:  If descriptors are located
at physical addresses above the 31 bit address range (2 GB), the
controller will overwrite random memory.  With luck, this merely
prevents video reception.  With only a little less luck, the machine
crashes.

We use the same workaround here as with TSB43AB22/A:  Switch off the
dual buffer capability flag and use packet-per-buffer IR DMA instead.
Another possible workaround would be to limit the coherent DMA mask to
31 bits.

In Linux 2.6.33, this change serves effectively only as documentation
since dual buffer mode is not used for any controller anymore.  But
somebody might want to re-enable it in the future to make use of
features of dual buffer DMA that are not available in packet-per-buffer
mode.

In Linux 2.6.32 and older, this update is vital for anyone with this
controller, more than 2 GB RAM, a 64 bit kernel, and FireWire video or
audio applications.

We have at least four reports:
http://bugzilla.kernel.org/show_bug.cgi?id=13808
http://marc.info/?l=linux1394-user&amp;m=126154279004083
https://bugzilla.redhat.com/show_bug.cgi?id=552142
http://marc.info/?l=linux1394-user&amp;m=126432246128386

Reported-by: Paul Johnson
Reported-by: Ronneil Camara
Reported-by: G Zornetzer
Reported-by: Mark Thompson
Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firewire: ohci: handle receive packets with a data length of zero</title>
<updated>2009-12-18T22:02:57Z</updated>
<author>
<name>Jay Fenlason</name>
<email>fenlason@redhat.com</email>
</author>
<published>2009-12-11T19:23:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e39b7b492b646e803941117e5d879e49f40bb92f'/>
<id>urn:sha1:e39b7b492b646e803941117e5d879e49f40bb92f</id>
<content type='text'>
commit 8c0c0cc2d9f4c523fde04bdfe41e4380dec8ee54 upstream.

Queueing to receive an ISO packet with a payload length of zero
silently does nothing in dualbuffer mode, and crashes the kernel in
packet-per-buffer mode.  Return an error in dualbuffer mode, because
the DMA controller won't let us do what we want, and work correctly in
packet-per-buffer mode.

Signed-off-by: Jay Fenlason &lt;fenlason@redhat.com&gt;
Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6</title>
<updated>2009-11-30T21:58:23Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-11-30T21:58:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f8a2cee0911fca04dab114ebd961aa564b3e65c3'/>
<id>urn:sha1:f8a2cee0911fca04dab114ebd961aa564b3e65c3</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: ohci: pass correct iso xmit timestamps to core
  firewire: ohci: Make cycleMatch ISO transmission work
</content>
</entry>
<entry>
<title>firewire: ohci: pass correct iso xmit timestamps to core</title>
<updated>2009-11-20T23:56:47Z</updated>
<author>
<name>Jay Fenlason</name>
<email>fenlason@redhat.com</email>
</author>
<published>2009-11-20T23:05:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=31769cef2e973544164aa7d0db2e2024660d5e21'/>
<id>urn:sha1:31769cef2e973544164aa7d0db2e2024660d5e21</id>
<content type='text'>
Here is the final set of patches I used to get ffado to work with the
new firewire stack.  With these patches, I was able to start ardour
and record from and playback to my PreSonus Inspire1394 from a
(mostly) Fedora 12 system.

Signed-off-by: Jay Fenlason &lt;fenlason@redhat.com&gt;

Until now, firewire-ohci exposed only the transmit cycle of the last
transmitted packet at each isochronous transmit complete event.  This
made it impossible for FFADO (FireWire audio drivers in userspace) to
synchronize audio-out streams.  The fix is to store the timestamp of
each packet in the iso xmit event.  As a bonus, the transfer status is
stored too.

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