<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/base/firmware_class.c, branch v3.16.76</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.16.76</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.16.76'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2016-02-02T19:48:28+00:00</updated>
<entry>
<title>firmware: actually return NULL on failed request_firmware_nowait()</title>
<updated>2016-02-02T19:48:28+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2015-12-09T22:50:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f5117c4ccb71773e1d35c19a0ec8d893ec19f5d8'/>
<id>urn:sha1:f5117c4ccb71773e1d35c19a0ec8d893ec19f5d8</id>
<content type='text'>
commit 715780ae4bb76d6fd2f20eb78e2a9ba9769a6cdc upstream.

The kerneldoc for request_firmware_nowait() says that it may call the
provided cont() callback with @fw == NULL, if the firmware request
fails. However, this is not the case when called with an empty string
(""). This case is short-circuited by the 'name[0] == '\0'' check
introduced in commit 471b095dfe0d ("firmware_class: make sure fw requests
contain a name"), so _request_firmware() never gets to set the fw to
NULL.

Noticed while using the new 'trigger_async_request' testing hook:

    # printf '\x00' &gt; /sys/devices/virtual/misc/test_firmware/trigger_async_request
    [10553.726178] test_firmware: loading ''
    [10553.729859] test_firmware: loaded: 995209091
    # printf '\x00' &gt; /sys/devices/virtual/misc/test_firmware/trigger_async_request
    [10733.676184] test_firmware: loading ''
    [10733.679855] Unable to handle kernel NULL pointer dereference at virtual address 00000004
    [10733.687951] pgd = ec188000
    [10733.690655] [00000004] *pgd=00000000
    [10733.694240] Internal error: Oops: 5 [#1] SMP ARM
    [10733.698847] Modules linked in: btmrvl_sdio btmrvl bluetooth sbs_battery nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables asix usbnet mwifiex_sdio mwifiex cfg80211 jitterentropy_rng drbg joydev snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device ppp_async ppp_generic slhc tun
    [10733.725670] CPU: 0 PID: 6600 Comm: bash Not tainted 4.4.0-rc4-00351-g63d0877 #178
    [10733.733137] Hardware name: Rockchip (Device Tree)
    [10733.737831] task: ed24f6c0 ti: ee322000 task.ti: ee322000
    [10733.743222] PC is at do_raw_spin_lock+0x18/0x1a0
    [10733.747831] LR is at _raw_spin_lock+0x18/0x1c
    [10733.752180] pc : [&lt;c00653a0&gt;]    lr : [&lt;c054c204&gt;]    psr: a00d0013
    [10733.752180] sp : ee323df8  ip : ee323e20  fp : ee323e1c
    [10733.763634] r10: 00000051  r9 : b6f18000  r8 : ee323f80
    [10733.768847] r7 : c089cebc  r6 : 00000001  r5 : 00000000  r4 : ec0e6000
    [10733.775360] r3 : dead4ead  r2 : c06bd140  r1 : eef913b4  r0 : 00000000
    [10733.781874] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
    [10733.788995] Control: 10c5387d  Table: 2c18806a  DAC: 00000051
    [10733.794728] Process bash (pid: 6600, stack limit = 0xee322218)
    [10733.800549] Stack: (0xee323df8 to 0xee324000)
    [10733.804896] 3de0:                                                       ec0e6000 00000000
    [10733.813059] 3e00: 00000001 c089cebc ee323f80 b6f18000 ee323e2c ee323e20 c054c204 c0065394
    [10733.821221] 3e20: ee323e44 ee323e30 c02fec60 c054c1f8 ec0e7ec0 ec3fcfc0 ee323e5c ee323e48
    [10733.829384] 3e40: c02fed08 c02fec48 c07dbf74 eeb05a00 ee323e8c ee323e60 c0253828 c02fecac
    [10733.837547] 3e60: 00000001 c0116950 ee323eac ee323e78 00000001 ec3fce00 ed2d9700 ed2d970c
    [10733.845710] 3e80: ee323e9c ee323e90 c02e873c c02537d4 ee323eac ee323ea0 c017bd40 c02e8720
    [10733.853873] 3ea0: ee323ee4 ee323eb0 c017b250 c017bd00 00000000 00000000 f3e47a54 ec128b00
    [10733.862035] 3ec0: c017b10c ee323f80 00000001 c000f504 ee322000 00000000 ee323f4c ee323ee8
    [10733.870197] 3ee0: c011b71c c017b118 ee323fb0 c011bc90 becfa8d9 00000001 ec128b00 00000001
    [10733.878359] 3f00: b6f18000 ee323f80 ee323f4c ee323f18 c011bc90 c0063950 ee323f3c ee323f28
    [10733.886522] 3f20: c0063950 c0549138 00000001 ec128b00 00000001 ec128b00 b6f18000 ee323f80
    [10733.894684] 3f40: ee323f7c ee323f50 c011bed8 c011b6ec c0135fb8 c0135f24 ec128b00 ec128b00
    [10733.902847] 3f60: 00000001 b6f18000 c000f504 ee322000 ee323fa4 ee323f80 c011c664 c011be24
    [10733.911009] 3f80: 00000000 00000000 00000001 b6f18000 b6e79be0 00000004 00000000 ee323fa8
    [10733.919172] 3fa0: c000f340 c011c618 00000001 b6f18000 00000001 b6f18000 00000001 00000000
    [10733.927334] 3fc0: 00000001 b6f18000 b6e79be0 00000004 00000001 00000001 8068a3f1 b6e79c84
    [10733.935496] 3fe0: 00000000 becfa7dc b6de194d b6e20246 400d0030 00000001 7a4536e8 49bda390
    [10733.943664] [&lt;c00653a0&gt;] (do_raw_spin_lock) from [&lt;c054c204&gt;] (_raw_spin_lock+0x18/0x1c)
    [10733.951743] [&lt;c054c204&gt;] (_raw_spin_lock) from [&lt;c02fec60&gt;] (fw_free_buf+0x24/0x64)
    [10733.959388] [&lt;c02fec60&gt;] (fw_free_buf) from [&lt;c02fed08&gt;] (release_firmware+0x68/0x74)
    [10733.967207] [&lt;c02fed08&gt;] (release_firmware) from [&lt;c0253828&gt;] (trigger_async_request_store+0x60/0x124)
    [10733.976501] [&lt;c0253828&gt;] (trigger_async_request_store) from [&lt;c02e873c&gt;] (dev_attr_store+0x28/0x34)
    [10733.985533] [&lt;c02e873c&gt;] (dev_attr_store) from [&lt;c017bd40&gt;] (sysfs_kf_write+0x4c/0x58)
    [10733.993437] [&lt;c017bd40&gt;] (sysfs_kf_write) from [&lt;c017b250&gt;] (kernfs_fop_write+0x144/0x1a8)
    [10734.001689] [&lt;c017b250&gt;] (kernfs_fop_write) from [&lt;c011b71c&gt;] (__vfs_write+0x3c/0xe4)

After this patch:

    # printf '\x00' &gt; /sys/devices/virtual/misc/test_firmware/trigger_async_request
    [   32.126322] test_firmware: loading ''
    [   32.129995] test_firmware: failed to async load firmware
    -bash: printf: write error: No such device

Fixes: 471b095dfe0d ("firmware_class: make sure fw requests contain a name")
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
</entry>
<entry>
<title>Fix firmware loader uevent buffer NULL pointer dereference</title>
<updated>2015-08-27T13:37:38+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-07-09T18:20:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=13552197fb954d68052f5cd474bbfc9f16f4e7a3'/>
<id>urn:sha1:13552197fb954d68052f5cd474bbfc9f16f4e7a3</id>
<content type='text'>
commit 6f957724b94cb19f5c1c97efd01dd4df8ced323c upstream.

The firmware class uevent function accessed the "fw_priv-&gt;buf" buffer
without the proper locking and testing for NULL.  This is an old bug
(looks like it goes back to 2012 and commit 1244691c73b2: "firmware
loader: introduce firmware_buf"), but for some reason it's triggering
only now in 4.2-rc1.

Shuah Khan is trying to bisect what it is that causes this to trigger
more easily, but in the meantime let's just fix the bug since others are
hitting it too (at least Ingo reports having seen it as well).

Reported-and-tested-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
</entry>
<entry>
<title>firmware_class: make sure fw requests contain a name</title>
<updated>2014-10-30T16:40:12+00:00</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2014-09-18T18:25:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b248aa29c61315f8ee998c9654a849b5f8348836'/>
<id>urn:sha1:b248aa29c61315f8ee998c9654a849b5f8348836</id>
<content type='text'>
commit 471b095dfe0d693a8d624cbc716d1ee4d74eb437 upstream.

An empty firmware request name will trigger warnings when building
device names. Make sure this is caught earlier and rejected.

The warning was visible via the test_firmware.ko module interface:

echo -ne "\x00" &gt; /sys/devices/virtual/misc/test_firmware/trigger_request

Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Tested-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge 3.14-rc5 into driver-core-next</title>
<updated>2014-03-03T04:09:08+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2014-03-03T04:09:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=13df7977431e3b906a23bb75f29e0f40a8d73f87'/>
<id>urn:sha1:13df7977431e3b906a23bb75f29e0f40a8d73f87</id>
<content type='text'>
We want the fixes in here.
</content>
</entry>
<entry>
<title>PM / hibernate: Fix restore hang in freeze_processes()</title>
<updated>2014-02-26T00:13:15+00:00</updated>
<author>
<name>Sebastian Capella</name>
<email>sebastian.capella@linaro.org</email>
</author>
<published>2014-02-19T01:52:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f8d5b9e9e5372f0deb7bc1ab1088a9b60b0a793d'/>
<id>urn:sha1:f8d5b9e9e5372f0deb7bc1ab1088a9b60b0a793d</id>
<content type='text'>
During restore, pm_notifier chain are called with
PM_RESTORE_PREPARE.  The firmware_class driver handler
fw_pm_notify does not have a handler for this.  As a result,
it keeps a reader on the kmod.c umhelper_sem.  During
freeze_processes, the call to __usermodehelper_disable tries to
take a write lock on this semaphore and hangs waiting.

Signed-off-by: Sebastian Capella &lt;sebastian.capella@linaro.org&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Cc: All applicable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>firmware: use power efficient workqueue for unloading and aborting fw load</title>
<updated>2014-02-15T19:31:55+00:00</updated>
<author>
<name>Shaibal Dutta</name>
<email>shaibal.dutta@broadcom.com</email>
</author>
<published>2014-01-31T23:44:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bce6618a11ca4ca3cb5d6a2a1d43c00f8301d2b2'/>
<id>urn:sha1:bce6618a11ca4ca3cb5d6a2a1d43c00f8301d2b2</id>
<content type='text'>
Allow the scheduler to select the most appropriate CPU for running the
firmware load timeout routine and delayed routine for firmware unload.
This extends idle residency times and conserves power.

This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.

Cc: Ming Lei &lt;ming.lei@canonical.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Shaibal Dutta &lt;shaibal.dutta@broadcom.com&gt;
[zoran.markovic@linaro.org: Rebased to latest kernel, added commit message.
Fixed code alignment.]
Signed-off-by: Zoran Markovic &lt;zoran.markovic@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware: give a protection when map page failed</title>
<updated>2014-02-15T19:31:55+00:00</updated>
<author>
<name>zhang jun</name>
<email>jun.zhang@intel.com</email>
</author>
<published>2014-02-13T07:18:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2b1278cb651786648ba6dad285a6c0873c6788e1'/>
<id>urn:sha1:2b1278cb651786648ba6dad285a6c0873c6788e1</id>
<content type='text'>
so, we need give a protection and return a error value.
[ 7341.474236] [drm:do_intel_finish_page_flip] *ERROR* invalid or inactive unpin_work!
[ 7341.494464] atomisp-css2400b0_v21 0000:00:03.0: unhandled css stored event: 0x20
[ 7341.503627] vmap allocation for size 208896 failed: use vmalloc=&lt;size&gt; to increase size.&lt;=================== map failed
[ 7341.507135] [drm:do_intel_finish_page_flip] *ERROR* invalid or inactive unpin_work!
[ 7341.503848] BUG: unable to handle kernel NULL pointer dereference at   (null)
[ 7341.520394] IP: [&lt;c18f5c1b&gt;] sst_load_all_modules_elf+0x1bb/0x850
[ 7341.527216] *pdpt = 0000000030dfe001 *pde = 0000000000000000
[ 7341.533640] Oops: 0000 [#1] PREEMPT SMP
[ 7341.540360] [drm:do_intel_finish_page_flip] *ERROR* invalid or inactive unpin_work!
[ 7341.538037] Modules linked in: atomisp_css2400b0_v21 lm3554 ov2722 imx1x5 atmel_mxt_ts vxd392 videobuf_vmalloc videobuf_core lm_dump(O) bcm_bt_lpm hdmi_audio bcm4334x(O)
[ 7341.563531] CPU: 1 PID: 525 Comm: mediaserver Tainted: G        W  O 3.10.20-262518-ga83c053 #1
[ 7341.573253] task: f0994ec0 ti: f09f0000 task.ti: f09f0000
[ 7341.579284] EIP: 0060:[&lt;c18f5c1b&gt;] EFLAGS: 00010246 CPU: 1
[ 7341.585415] EIP is at sst_load_all_modules_elf+0x1bb/0x850
[ 7341.591541] EAX: 00000000 EBX: e3595ba0 ECX: 00000000 EDX: 00031c1c
[ 7341.598541] ESI: e04a0000 EDI: 00000000 EBP: f09f1d80 ESP: f09f1cf4
[ 7341.605542]  DS: 007b ES: 007b FS: 00d8 GS: 003b SS: 0068
[ 7341.611573] CR0: 80050033 CR2: 00000000 CR3: 30db4000 CR4: 001007f0
[ 7341.618573] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[ 7341.625575] DR6: ffff0ff0 DR7: 00000400
[ 7341.629856] Stack:
[ 7341.632097]  f09f1d57 00000019 c1d656d7 c1d658d3 c1d56409 00000f28 c1d64af9 18000103
[ 7341.640766]  01000001 00080000 c1f910a0 f326f4c8 00000034 f326f520 00000002 e04a02bc
[ 7341.649465]  00000001 f326e014 c1f910b0 e04a0000 c0080100 00031c1c e3595ba0 c0080100
[ 7341.658149] Call Trace:
[ 7341.660888]  [&lt;c18f6308&gt;] sst_post_download_byt+0x58/0xb0
[ 7341.666925]  [&lt;c18f4fbc&gt;] sst_load_fw+0xdc/0x510
[ 7341.672086]  [&lt;c1a7b2c0&gt;] ? __mutex_lock_slowpath+0x250/0x370
[ 7341.678507]  [&lt;c1a80e05&gt;] ? sub_preempt_count+0x55/0xe0
[ 7341.684346]  [&lt;c18f1294&gt;] sst_download_fw+0x14/0x60
[ 7341.689796]  [&lt;c1a7b403&gt;] ? mutex_lock+0x23/0x30
[ 7341.694954]  [&lt;c18f191c&gt;] intel_sst_check_device+0x6c/0x120
[ 7341.701181]  [&lt;c18f1d08&gt;] sst_set_generic_params+0x1b8/0x4a0
[ 7341.707504]  [&lt;c1a80e05&gt;] ? sub_preempt_count+0x55/0xe0
[ 7341.713341]  [&lt;c1a80e05&gt;] ? sub_preempt_count+0x55/0xe0
[ 7341.719178]  [&lt;c1a7b2c0&gt;] ? __mutex_lock_slowpath+0x250/0x370
[ 7341.725600]  [&lt;c1320d84&gt;] ? __kmalloc_track_caller+0xe4/0x1d0
[ 7341.732022]  [&lt;c18e35f5&gt;] sst_set_mixer_param+0x25/0x40
[ 7341.737859]  [&lt;c18e3853&gt;] lpe_mixer_ihf_set+0xb3/0x160
[ 7341.743602]  [&lt;c1855b99&gt;] snd_ctl_ioctl+0xa89/0xb40
[ 7341.749052]  [&lt;c1331e65&gt;] ? path_openat+0xa5/0x3d0
[ 7341.754409]  [&lt;c1447857&gt;] ? avc_has_perm_flags+0xc7/0x170
[ 7341.760441]  [&lt;c1855110&gt;] ? snd_ctl_elem_add_user+0x540/0x540
[ 7341.766862]  [&lt;c1334047&gt;] do_vfs_ioctl+0x77/0x5e0
[ 7341.772117]  [&lt;c144842a&gt;] ? inode_has_perm.isra.42.constprop.79+0x3a/0x50
[ 7341.779705]  [&lt;c14490a0&gt;] ? file_has_perm+0xa0/0xb0
[ 7341.785155]  [&lt;c14493b8&gt;] ? selinux_file_ioctl+0x48/0xe0
[ 7341.791090]  [&lt;c1334628&gt;] SyS_ioctl+0x78/0x90
[ 7341.795958]  [&lt;c1a7dde8&gt;] syscall_call+0x7/0xb
[ 7341.800925]  [&lt;c1a70000&gt;] ? mm_fault_error+0x13c/0x198

Signed-off-by: zhang jun &lt;jun.zhang@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware_class: Fix the file size check</title>
<updated>2014-01-09T04:29:19+00:00</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2013-12-28T15:53:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=08da2012e0bb0f3f1422cce3f76c36a90da366b5'/>
<id>urn:sha1:08da2012e0bb0f3f1422cce3f76c36a90da366b5</id>
<content type='text'>
We expect to read firmware blobs with a single call to kernel_read(),
which returns int.  Therefore the size must be within the range of
int, not long.

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware loader: Add sparse annotation</title>
<updated>2014-01-08T23:36:18+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2014-01-04T13:20:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=98233b21cd6e6b9bd8ad5d4756bda1c051567468'/>
<id>urn:sha1:98233b21cd6e6b9bd8ad5d4756bda1c051567468</id>
<content type='text'>
Avoid that sparse reports the following warning on __fw_free_buf():

drivers/base/firmware_class.c:230:9: warning: context imbalance in '__fw_free_buf' - unexpected unlock

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware: Suppress fallback warnings when CONFIG_FW_LOADER_USER_HELPER=n</title>
<updated>2013-12-09T02:22:33+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2013-12-02T14:38:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=68aeeaaaf86b61c78dca09879ce262778a9080e4'/>
<id>urn:sha1:68aeeaaaf86b61c78dca09879ce262778a9080e4</id>
<content type='text'>
The commit [3e358ac2bb5b: firmware: Be a bit more verbose about direct
firmware loading failure] introduced a new warning message about
falling back to user helper, but this isn't true when
CONFIG_FW_LOADER_USER_HELPER isn't set.

In this patch, clear the FW_OPT_FALLBACK flag in the case without
userhelper, so that the corresponding code will be disabled.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
