Skip to contentSkip to conversation

CVE-2024-42143: orangefs: fix out-of-bounds fsid access

DISCUSSION Greg Kroah-Hartman 2 participants 3 messages Jul 30, 2024 – Aug 22, 2024

lore
Share & tools
lore
#0 lore raw

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

orangefs: fix out-of-bounds fsid access

Arnd Bergmann sent a patch to fsdevel, he says:

"orangefs_statfs() copies two consecutive fields of the superblock into the statfs structure, which triggers a warning from the string fortification helpers"

Jan Kara suggested an alternate way to do the patch to make it more readable.

I ran both ideas through xfstests and both seem fine. This patch is based on Jan Kara's suggestion.

The Linux kernel CVE team has assigned CVE-2024-42143 to this issue.

Affected and fixed versions
===========================

	Fixed in 4.19.318 with commit b90176a95537
	Fixed in 5.4.280 with commit 556edaa27c27
	Fixed in 5.10.222 with commit 1617249e24bd
	Fixed in 5.15.163 with commit 137a06dc0ff8
	Fixed in 6.1.98 with commit 74159d409da8
	Fixed in 6.6.39 with commit 6a3cacf6d3cf
	Fixed in 6.9.9 with commit de8a5f7b7180
	Fixed in 6.10 with commit 53e4efa470d5

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2024-42143

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
fs/orangefs/super.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/b90176a9553775e23966650e445b1866e62e4924
	https://git.kernel.org/stable/c/556edaa27c27db24a0f34c78cebef90e5bb6e167
	https://git.kernel.org/stable/c/1617249e24bd04c8047956afb43feec4876d1715
	https://git.kernel.org/stable/c/137a06dc0ff8b2d2069c2345d015ef0fa71df1ed
	https://git.kernel.org/stable/c/74159d409da82269311a60256aad8ae8753da450
	https://git.kernel.org/stable/c/6a3cacf6d3cf0278aa90392aef2fc3fe2717a047
	https://git.kernel.org/stable/c/de8a5f7b71800a11fbaffc8ddacf08ead78afcc5
	https://git.kernel.org/stable/c/53e4efa470d5fc6a96662d2d3322cfc925818517
#1 lore raw
Quoted 13 lines · Greg Kroah-Hartman

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

orangefs: fix out-of-bounds fsid access

Arnd Bergmann sent a patch to fsdevel, he says:

"orangefs_statfs() copies two consecutive fields of the superblock into the statfs structure, which triggers a warning from the string fortification helpers"

Quoted 6 lines

Jan Kara suggested an alternate way to do the patch to make it more readable.

I ran both ideas through xfstests and both seem fine. This patch is based on Jan Kara's suggestion.

The Linux kernel CVE team has assigned CVE-2024-42143 to this issue.

I think this one needs to be disputed as there was no actual out of bounds access. The fix is basically just silencing the string fortification warning which was due to:

memcpy(&buf->f_fsid, &ORANGEFS_SB(sb)->fs_id, sizeof(buf->f_fsid));

and fortify-string complaining as it detects that memory beyond sb->fs_id is going to be accessed, which was intentional:

struct orangefs_sb_info_s {
	[...]
	__s32 fs_id;
	int id;
	[...]
};

The fix simply made the fs_id and id fields assignment explicit so as to avoid the warning.

Mike, could you confirm that this should not be a CVE?

Regards,
Anthony

author
#2 lore raw
Quoted 37 lines · Anthony Iliopoulos
Quoted 13 lines · Greg Kroah-Hartman

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

orangefs: fix out-of-bounds fsid access

Arnd Bergmann sent a patch to fsdevel, he says:

"orangefs_statfs() copies two consecutive fields of the superblock into the statfs structure, which triggers a warning from the string fortification helpers"

Quoted 6 lines

Jan Kara suggested an alternate way to do the patch to make it more readable.

I ran both ideas through xfstests and both seem fine. This patch is based on Jan Kara's suggestion.

The Linux kernel CVE team has assigned CVE-2024-42143 to this issue.

I think this one needs to be disputed as there was no actual out of bounds access. The fix is basically just silencing the string fortification warning which was due to:

memcpy(&buf->f_fsid, &ORANGEFS_SB(sb)->fs_id, sizeof(buf->f_fsid));

and fortify-string complaining as it detects that memory beyond sb->fs_id is going to be accessed, which was intentional:

struct orangefs_sb_info_s {
	[...]
	__s32 fs_id;
	int id;
	[...]
};
Quoted 4 lines

The fix simply made the fs_id and id fields assignment explicit so as to avoid the warning.

Mike, could you confirm that this should not be a CVE?

Sorry for the delay, now rejected.

greg k-h