<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/firewire/ohci.c, branch v7.2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>firewire: ohci: fix NULL pointer dereference in ar_context_release</title>
<updated>2026-08-13T12:02:23+00:00</updated>
<author>
<name>Aleksandr Nogikh</name>
<email>nogikh@google.com</email>
</author>
<published>2026-08-07T14:25:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=42d217add8d80d6e7d9f58f80d11ea9b07ea113e'/>
<id>42d217add8d80d6e7d9f58f80d11ea9b07ea113e</id>
<content type='text'>
During the error handling path of the driver's probe function, a NULL
pointer dereference can occur in ar_context_release().

When pci_probe() fails early (e.g., if pcim_enable_device() or MMIO mapping
fails), the devres cleanup mechanism invokes release_ohci(). This function
unconditionally calls ar_context_release() to clean up the asynchronous
receive contexts. However, if ar_context_init() was not yet called,
ctx-&gt;ohci remains NULL (as the fw_ohci structure is zero-initialized by
devres_alloc()).

ar_context_release() immediately dereferences ctx-&gt;ohci to get the dev
pointer before checking if the context was actually initialized, leading to
a crash:

Oops: general protection fault, probably for non-canonical address
0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
RIP: 0010:ar_context_release+0x3f/0x380 drivers/firewire/ohci.c:543
Call Trace:
 release_ohci+0x3f/0x60 drivers/firewire/ohci.c:3567
 release_nodes drivers/base/devres.c:546 [inline]
 devres_release_all+0x1a8/0x260 drivers/base/devres.c:576
 device_unbind_cleanup drivers/base/dd.c:597 [inline]
 really_probe+0x451/0xae0 drivers/base/dd.c:772

To fix this, move the assignment of the dev pointer after the !ctx-&gt;buffer
check. If ctx-&gt;buffer is NULL, it indicates that the context was never
successfully initialized and there is nothing to release, safely avoiding
the dereference of the uninitialized ctx-&gt;ohci pointer.

Fixes: 5716e58aecdd ("firewire: ohci: release buffer for AR req/resp contexts when managed resource is released")
Assisted-by: Gemini:gemini-3.5-flash Gemini:gemini-3.1-pro-preview syzbot
Reported-by: syzbot+d30aad27833a559defab@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d30aad27833a559defab
Link: https://syzkaller.appspot.com/ai_job?id=10a18617-7893-42dd-bf1c-cd49e19e95d9
Signed-off-by: Aleksandr Nogikh &lt;nogikh@google.com&gt;
Link: https://lore.kernel.org/r/90c5db71-dd1f-4d46-b9d3-2f1046cbd5ea@mail.kernel.org
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During the error handling path of the driver's probe function, a NULL
pointer dereference can occur in ar_context_release().

When pci_probe() fails early (e.g., if pcim_enable_device() or MMIO mapping
fails), the devres cleanup mechanism invokes release_ohci(). This function
unconditionally calls ar_context_release() to clean up the asynchronous
receive contexts. However, if ar_context_init() was not yet called,
ctx-&gt;ohci remains NULL (as the fw_ohci structure is zero-initialized by
devres_alloc()).

ar_context_release() immediately dereferences ctx-&gt;ohci to get the dev
pointer before checking if the context was actually initialized, leading to
a crash:

Oops: general protection fault, probably for non-canonical address
0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
RIP: 0010:ar_context_release+0x3f/0x380 drivers/firewire/ohci.c:543
Call Trace:
 release_ohci+0x3f/0x60 drivers/firewire/ohci.c:3567
 release_nodes drivers/base/devres.c:546 [inline]
 devres_release_all+0x1a8/0x260 drivers/base/devres.c:576
 device_unbind_cleanup drivers/base/dd.c:597 [inline]
 really_probe+0x451/0xae0 drivers/base/dd.c:772

To fix this, move the assignment of the dev pointer after the !ctx-&gt;buffer
check. If ctx-&gt;buffer is NULL, it indicates that the context was never
successfully initialized and there is nothing to release, safely avoiding
the dereference of the uninitialized ctx-&gt;ohci pointer.

Fixes: 5716e58aecdd ("firewire: ohci: release buffer for AR req/resp contexts when managed resource is released")
Assisted-by: Gemini:gemini-3.5-flash Gemini:gemini-3.1-pro-preview syzbot
Reported-by: syzbot+d30aad27833a559defab@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d30aad27833a559defab
Link: https://syzkaller.appspot.com/ai_job?id=10a18617-7893-42dd-bf1c-cd49e19e95d9
Signed-off-by: Aleksandr Nogikh &lt;nogikh@google.com&gt;
Link: https://lore.kernel.org/r/90c5db71-dd1f-4d46-b9d3-2f1046cbd5ea@mail.kernel.org
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: ohci: initialize page array to use alloc_pages_bulk() correctly</title>
<updated>2026-02-28T18:09:24+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-02-28T02:56:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9197e5949a41cfb5d44a6b8a860766266340d558'/>
<id>9197e5949a41cfb5d44a6b8a860766266340d558</id>
<content type='text'>
The call of alloc_pages_bulk() skips to fill entries of page array when
the entries already have values. While, 1394 OHCI PCI driver passes the
page array without initializing. It could cause invalid state at PFN
validation in vmap().

Fixes: f2ae92780ab9 ("firewire: ohci: split page allocation from dma mapping")
Reported-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reported-and-tested-by: Harald Arnesen &lt;linux@skogtun.org&gt;
Reported-and-tested-by: David Gow &lt;david@davidgow.net&gt;
Closes: https://lore.kernel.org/lkml/87tsv1vig5.fsf@jogness.linutronix.de/
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The call of alloc_pages_bulk() skips to fill entries of page array when
the entries already have values. While, 1394 OHCI PCI driver passes the
page array without initializing. It could cause invalid state at PFN
validation in vmap().

Fixes: f2ae92780ab9 ("firewire: ohci: split page allocation from dma mapping")
Reported-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reported-and-tested-by: Harald Arnesen &lt;linux@skogtun.org&gt;
Reported-and-tested-by: David Gow &lt;david@davidgow.net&gt;
Closes: https://lore.kernel.org/lkml/87tsv1vig5.fsf@jogness.linutronix.de/
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: provide isoc header buffer size outside card driver</title>
<updated>2026-01-18T08:18:48+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-01-17T14:28:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9bf71acd65bf190a0ef1bc885a0a664f91beff03'/>
<id>9bf71acd65bf190a0ef1bc885a0a664f91beff03</id>
<content type='text'>
For single-channel isochronous contexts, the header storage size is
hard-coded to PAGE_SIZE. which is inconvenient for protocol
implementations requiring more space.

This commit refactors the code to obtain the header storage size outside
the 1394 OHCI driver.

Link: https://lore.kernel.org/r/20260117142823.440811-8-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For single-channel isochronous contexts, the header storage size is
hard-coded to PAGE_SIZE. which is inconvenient for protocol
implementations requiring more space.

This commit refactors the code to obtain the header storage size outside
the 1394 OHCI driver.

Link: https://lore.kernel.org/r/20260117142823.440811-8-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: ohci: allocate isoc context header by kvmalloc()</title>
<updated>2026-01-18T08:18:48+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-01-17T14:28:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fc999c7b68ac80cf260a43237e2b304222987243'/>
<id>fc999c7b68ac80cf260a43237e2b304222987243</id>
<content type='text'>
Isochronous packet handling now runs in a workqueue context, where page
faults is acceptable.

This commit replaces __get_free_page() with kvmalloc() when allocating the
isochronous context header buffer.

Link: https://lore.kernel.org/r/20260117142823.440811-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Isochronous packet handling now runs in a workqueue context, where page
faults is acceptable.

This commit replaces __get_free_page() with kvmalloc() when allocating the
isochronous context header buffer.

Link: https://lore.kernel.org/r/20260117142823.440811-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: add flags member for isochronous context structure</title>
<updated>2026-01-18T08:18:48+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-01-17T14:28:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=090ac6520044d0d02e039d76aaa22f4c9751837f'/>
<id>090ac6520044d0d02e039d76aaa22f4c9751837f</id>
<content type='text'>
This is minor code refactoring to add a flag member to the isochronous
context structure. At present, it is used only for the option to drop
packets when the context header overflows.

Link: https://lore.kernel.org/r/20260117142823.440811-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is minor code refactoring to add a flag member to the isochronous
context structure. At present, it is used only for the option to drop
packets when the context header overflows.

Link: https://lore.kernel.org/r/20260117142823.440811-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: ohci: use cleanup helper for isoc context header allocation</title>
<updated>2026-01-18T08:18:48+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-01-17T14:28:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ea6fdb1cbde04b16c64205176e20082358ce8e99'/>
<id>ea6fdb1cbde04b16c64205176e20082358ce8e99</id>
<content type='text'>
Some cleanup helpers are useful in error path after memory allocation for
header storage.

Link: https://lore.kernel.org/r/20260117142823.440811-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some cleanup helpers are useful in error path after memory allocation for
header storage.

Link: https://lore.kernel.org/r/20260117142823.440811-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: ohci: code refactoring to use union for isoc multiple channel state</title>
<updated>2026-01-18T08:18:48+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-01-17T14:28:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c544c829894faa9251be1dcb2fe59a0a7ad21fa9'/>
<id>c544c829894faa9251be1dcb2fe59a0a7ad21fa9</id>
<content type='text'>
In 1394 OHCI driver, some members of struct iso_context are only used for
multi-channel isochronous contexts.

This commit uses a union for these members to clearly separate
multi-channel specific state.

Link: https://lore.kernel.org/r/20260117142823.440811-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In 1394 OHCI driver, some members of struct iso_context are only used for
multi-channel isochronous contexts.

This commit uses a union for these members to clearly separate
multi-channel specific state.

Link: https://lore.kernel.org/r/20260117142823.440811-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: ohci: refactor isoc single-channel state using a union</title>
<updated>2026-01-18T08:18:48+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-01-17T14:28:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0fe92d5d2c2ac3af9cb54260e7c90b945ebb306c'/>
<id>0fe92d5d2c2ac3af9cb54260e7c90b945ebb306c</id>
<content type='text'>
In 1394 OHCI driver, some members of struct iso_context are only used for
single-channel isochronous contexts.

This commit groups these members into a union.

Link: https://lore.kernel.org/r/20260117142823.440811-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In 1394 OHCI driver, some members of struct iso_context are only used for
single-channel isochronous contexts.

This commit groups these members into a union.

Link: https://lore.kernel.org/r/20260117142823.440811-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: ohci: fix index of pages for dma address to 1394 OHCI IT context</title>
<updated>2026-01-15T12:33:36+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-01-14T13:17:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a4cd9860fa085f0d04d2065f4c151fcde9fcdf4a'/>
<id>a4cd9860fa085f0d04d2065f4c151fcde9fcdf4a</id>
<content type='text'>
The index of pages for dma address was changed wrongly. This commit
corrents it.

Fixes: ef6bdffbb88d ("firewire: core: stop using page private to store DMA mapping address")
Link: https://lore.kernel.org/r/20260114131729.16133-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The index of pages for dma address was changed wrongly. This commit
corrents it.

Fixes: ef6bdffbb88d ("firewire: core: stop using page private to store DMA mapping address")
Link: https://lore.kernel.org/r/20260114131729.16133-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: ohci: stop using page private to store DMA mapping address</title>
<updated>2026-01-12T02:49:38+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-01-10T01:39:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=993ab48006b3016cdd3f2b33905e8e167f955495'/>
<id>993ab48006b3016cdd3f2b33905e8e167f955495</id>
<content type='text'>
There is a long discussion about the use of private field in page
structure between Linux kernel developers.

This commit stop using page private to store DMA mapping address for
AR context, to prepare for mm future change.

Link: https://lore.kernel.org/r/20260110013911.19160-9-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a long discussion about the use of private field in page
structure between Linux kernel developers.

This commit stop using page private to store DMA mapping address for
AR context, to prepare for mm future change.

Link: https://lore.kernel.org/r/20260110013911.19160-9-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
</feed>
