Skip to content

Commit 0cdd776

Browse files
committed
Merge tag 'driver-core-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg KH: "Here is one fix, and three documentation updates for 5.18-rc7. The fix is for the firmware loader which resolves a long-reported problem where the credentials of the firmware loader could be set to a userspace process without enough permissions to actually load the firmware image. Many Android vendors have been reporting this for quite some time. The documentation updates are for the embargoed-hardware-issues.rst file to add a new entry, change an existing one, and sort the list to make changes easier in the future. All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: Documentation/process: Update ARM contact for embargoed hardware issues Documentation/process: Add embargoed HW contact for Ampere Computing Documentation/process: Make groups alphabetical and use tabs consistently firmware_loader: use kernel credentials when reading firmware
2 parents 5becde6 + 575f00e commit 0cdd776

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

Documentation/process/embargoed-hardware-issues.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,11 @@ disclosure of a particular issue, unless requested by a response team or by
244244
an involved disclosed party. The current ambassadors list:
245245

246246
============= ========================================================
247-
ARM Grant Likely <[email protected]>
248247
AMD Tom Lendacky <[email protected]>
249-
IBM Z Christian Borntraeger <[email protected]>
250-
IBM Power Anton Blanchard <[email protected]>
248+
Ampere Darren Hart <[email protected]>
249+
ARM Catalin Marinas <[email protected]>
250+
IBM Power Anton Blanchard <[email protected]>
251+
IBM Z Christian Borntraeger <[email protected]>
251252
Intel Tony Luck <[email protected]>
252253
Qualcomm Trilok Soni <[email protected]>
253254

drivers/base/firmware_loader/main.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
735735
size_t offset, u32 opt_flags)
736736
{
737737
struct firmware *fw = NULL;
738+
struct cred *kern_cred = NULL;
739+
const struct cred *old_cred;
738740
bool nondirect = false;
739741
int ret;
740742

@@ -751,6 +753,18 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
751753
if (ret <= 0) /* error or already assigned */
752754
goto out;
753755

756+
/*
757+
* We are about to try to access the firmware file. Because we may have been
758+
* called by a driver when serving an unrelated request from userland, we use
759+
* the kernel credentials to read the file.
760+
*/
761+
kern_cred = prepare_kernel_cred(NULL);
762+
if (!kern_cred) {
763+
ret = -ENOMEM;
764+
goto out;
765+
}
766+
old_cred = override_creds(kern_cred);
767+
754768
ret = fw_get_filesystem_firmware(device, fw->priv, "", NULL);
755769

756770
/* Only full reads can support decompression, platform, and sysfs. */
@@ -776,6 +790,9 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
776790
} else
777791
ret = assign_fw(fw, device);
778792

793+
revert_creds(old_cred);
794+
put_cred(kern_cred);
795+
779796
out:
780797
if (ret < 0) {
781798
fw_abort_batch_reqs(fw);

0 commit comments

Comments
 (0)