From: Justin Stitt <justinstitt(a)google.com>
[ Upstream commit 23cc6ef6fd453b13502caae23130844e7d6ed0fe ]
Running syzkaller with the newly enabled signed integer overflow
sanitizer produces this report:
[ 195.401651] ------------[ cut here ]------------
[ 195.404808] UBSAN: signed-integer-overflow in ../fs/open.c:321:15
[ 195.408739] 9223372036854775807 + 562984447377399 cannot be represented in type 'loff_t' (aka 'long long')
[ 195.414683] CPU: 1 PID: 703 Comm: syz-executor.0 Not tainted 6.8.0-rc2-00039-g14de58dbe653-dirty #11
[ 195.420138] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 195.425804] Call Trace:
[ 195.427360] <TASK>
[ 195.428791] dump_stack_lvl+0x93/0xd0
[ 195.431150] handle_overflow+0x171/0x1b0
[ 195.433640] vfs_fallocate+0x459/0x4f0
...
[ 195.490053] ------------[ cut here ]------------
[ 195.493146] UBSAN: signed-integer-overflow in ../fs/open.c:321:61
[ 195.497030] 9223372036854775807 + 562984447377399 cannot be represented in type 'loff_t' (aka 'long long)
[ 195.502940] CPU: 1 PID: 703 Comm: syz-executor.0 Not tainted 6.8.0-rc2-00039-g14de58dbe653-dirty #11
[ 195.508395] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 195.514075] Call Trace:
[ 195.515636] <TASK>
[ 195.517000] dump_stack_lvl+0x93/0xd0
[ 195.519255] handle_overflow+0x171/0x1b0
[ 195.521677] vfs_fallocate+0x4cb/0x4f0
[ 195.524033] __x64_sys_fallocate+0xb2/0xf0
Historically, the signed integer overflow sanitizer did not work in the
kernel due to its interaction with `-fwrapv` but this has since been
changed [1] in the newest version of Clang. It was re-enabled in the
kernel with Commit 557f8c582a9ba8ab ("ubsan: Reintroduce signed overflow
sanitizer").
Let's use the check_add_overflow helper to first verify the addition
stays within the bounds of its type (long long); then we can use that
sum for the following check.
Link: https://github.com/llvm/llvm-project/pull/82432 [1]
Closes: https://github.com/KSPP/linux/issues/356
Cc: linux-hardening(a)vger.kernel.org
Reviewed-by: Kees Cook <keescook(a)chromium.org>
Signed-off-by: Justin Stitt <justinstitt(a)google.com>
Link: https://lore.kernel.org/r/20240513-b4-sio-vfs_fallocate-v2-1-db415872fb16@g…
Reviewed-by: Jan Kara <jack(a)suse.cz>
Signed-off-by: Christian Brauner <brauner(a)kernel.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
---
fs/open.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/open.c b/fs/open.c
index 97932af49071a..73d864636ae57 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -229,6 +229,7 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
{
struct inode *inode = file_inode(file);
long ret;
+ loff_t sum;
if (offset < 0 || len <= 0)
return -EINVAL;
@@ -297,8 +298,11 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))
return -ENODEV;
- /* Check for wrap through zero too */
- if (((offset + len) > inode->i_sb->s_maxbytes) || ((offset + len) < 0))
+ /* Check for wraparound */
+ if (check_add_overflow(offset, len, &sum))
+ return -EFBIG;
+
+ if (sum > inode->i_sb->s_maxbytes)
return -EFBIG;
if (!file->f_op->fallocate)
--
2.43.0
From: Justin Stitt <justinstitt(a)google.com>
[ Upstream commit 23cc6ef6fd453b13502caae23130844e7d6ed0fe ]
Running syzkaller with the newly enabled signed integer overflow
sanitizer produces this report:
[ 195.401651] ------------[ cut here ]------------
[ 195.404808] UBSAN: signed-integer-overflow in ../fs/open.c:321:15
[ 195.408739] 9223372036854775807 + 562984447377399 cannot be represented in type 'loff_t' (aka 'long long')
[ 195.414683] CPU: 1 PID: 703 Comm: syz-executor.0 Not tainted 6.8.0-rc2-00039-g14de58dbe653-dirty #11
[ 195.420138] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 195.425804] Call Trace:
[ 195.427360] <TASK>
[ 195.428791] dump_stack_lvl+0x93/0xd0
[ 195.431150] handle_overflow+0x171/0x1b0
[ 195.433640] vfs_fallocate+0x459/0x4f0
...
[ 195.490053] ------------[ cut here ]------------
[ 195.493146] UBSAN: signed-integer-overflow in ../fs/open.c:321:61
[ 195.497030] 9223372036854775807 + 562984447377399 cannot be represented in type 'loff_t' (aka 'long long)
[ 195.502940] CPU: 1 PID: 703 Comm: syz-executor.0 Not tainted 6.8.0-rc2-00039-g14de58dbe653-dirty #11
[ 195.508395] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 195.514075] Call Trace:
[ 195.515636] <TASK>
[ 195.517000] dump_stack_lvl+0x93/0xd0
[ 195.519255] handle_overflow+0x171/0x1b0
[ 195.521677] vfs_fallocate+0x4cb/0x4f0
[ 195.524033] __x64_sys_fallocate+0xb2/0xf0
Historically, the signed integer overflow sanitizer did not work in the
kernel due to its interaction with `-fwrapv` but this has since been
changed [1] in the newest version of Clang. It was re-enabled in the
kernel with Commit 557f8c582a9ba8ab ("ubsan: Reintroduce signed overflow
sanitizer").
Let's use the check_add_overflow helper to first verify the addition
stays within the bounds of its type (long long); then we can use that
sum for the following check.
Link: https://github.com/llvm/llvm-project/pull/82432 [1]
Closes: https://github.com/KSPP/linux/issues/356
Cc: linux-hardening(a)vger.kernel.org
Reviewed-by: Kees Cook <keescook(a)chromium.org>
Signed-off-by: Justin Stitt <justinstitt(a)google.com>
Link: https://lore.kernel.org/r/20240513-b4-sio-vfs_fallocate-v2-1-db415872fb16@g…
Reviewed-by: Jan Kara <jack(a)suse.cz>
Signed-off-by: Christian Brauner <brauner(a)kernel.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
---
fs/open.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/open.c b/fs/open.c
index 0d63c94e1c5e6..dd68725cd7247 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -244,6 +244,7 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
{
struct inode *inode = file_inode(file);
long ret;
+ loff_t sum;
if (offset < 0 || len <= 0)
return -EINVAL;
@@ -312,8 +313,11 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))
return -ENODEV;
- /* Check for wrap through zero too */
- if (((offset + len) > inode->i_sb->s_maxbytes) || ((offset + len) < 0))
+ /* Check for wraparound */
+ if (check_add_overflow(offset, len, &sum))
+ return -EFBIG;
+
+ if (sum > inode->i_sb->s_maxbytes)
return -EFBIG;
if (!file->f_op->fallocate)
--
2.43.0
From: Justin Stitt <justinstitt(a)google.com>
[ Upstream commit 23cc6ef6fd453b13502caae23130844e7d6ed0fe ]
Running syzkaller with the newly enabled signed integer overflow
sanitizer produces this report:
[ 195.401651] ------------[ cut here ]------------
[ 195.404808] UBSAN: signed-integer-overflow in ../fs/open.c:321:15
[ 195.408739] 9223372036854775807 + 562984447377399 cannot be represented in type 'loff_t' (aka 'long long')
[ 195.414683] CPU: 1 PID: 703 Comm: syz-executor.0 Not tainted 6.8.0-rc2-00039-g14de58dbe653-dirty #11
[ 195.420138] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 195.425804] Call Trace:
[ 195.427360] <TASK>
[ 195.428791] dump_stack_lvl+0x93/0xd0
[ 195.431150] handle_overflow+0x171/0x1b0
[ 195.433640] vfs_fallocate+0x459/0x4f0
...
[ 195.490053] ------------[ cut here ]------------
[ 195.493146] UBSAN: signed-integer-overflow in ../fs/open.c:321:61
[ 195.497030] 9223372036854775807 + 562984447377399 cannot be represented in type 'loff_t' (aka 'long long)
[ 195.502940] CPU: 1 PID: 703 Comm: syz-executor.0 Not tainted 6.8.0-rc2-00039-g14de58dbe653-dirty #11
[ 195.508395] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 195.514075] Call Trace:
[ 195.515636] <TASK>
[ 195.517000] dump_stack_lvl+0x93/0xd0
[ 195.519255] handle_overflow+0x171/0x1b0
[ 195.521677] vfs_fallocate+0x4cb/0x4f0
[ 195.524033] __x64_sys_fallocate+0xb2/0xf0
Historically, the signed integer overflow sanitizer did not work in the
kernel due to its interaction with `-fwrapv` but this has since been
changed [1] in the newest version of Clang. It was re-enabled in the
kernel with Commit 557f8c582a9ba8ab ("ubsan: Reintroduce signed overflow
sanitizer").
Let's use the check_add_overflow helper to first verify the addition
stays within the bounds of its type (long long); then we can use that
sum for the following check.
Link: https://github.com/llvm/llvm-project/pull/82432 [1]
Closes: https://github.com/KSPP/linux/issues/356
Cc: linux-hardening(a)vger.kernel.org
Reviewed-by: Kees Cook <keescook(a)chromium.org>
Signed-off-by: Justin Stitt <justinstitt(a)google.com>
Link: https://lore.kernel.org/r/20240513-b4-sio-vfs_fallocate-v2-1-db415872fb16@g…
Reviewed-by: Jan Kara <jack(a)suse.cz>
Signed-off-by: Christian Brauner <brauner(a)kernel.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
---
fs/open.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/open.c b/fs/open.c
index 59db720693f9a..61f0b733ad962 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -245,6 +245,7 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
{
struct inode *inode = file_inode(file);
long ret;
+ loff_t sum;
if (offset < 0 || len <= 0)
return -EINVAL;
@@ -313,8 +314,11 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))
return -ENODEV;
- /* Check for wrap through zero too */
- if (((offset + len) > inode->i_sb->s_maxbytes) || ((offset + len) < 0))
+ /* Check for wraparound */
+ if (check_add_overflow(offset, len, &sum))
+ return -EFBIG;
+
+ if (sum > inode->i_sb->s_maxbytes)
return -EFBIG;
if (!file->f_op->fallocate)
--
2.43.0
Hello,
After updating from 6.8.9 to 6.9.1 I noticed a bug on my HP Envy x360
with AMD Ryzen 5 4500U.
#regzbot introduced: v6.8.9..v6.9.1
After waking up from sleep brightness is set to max level, ignoring
previous value.
With the help of Arch Linux team, we was able to track bad commit to
this:
https://gitlab.freedesktop.org/agd5f/linux/-/commit/63d0b87213a0ba241b3fcfb…
I have tested this on latest mainline kernel:
Results after waking up:
> cat /sys/class/backlight/amdgpu_bl1/{brightness,actual_brightness}
12
252
Then, on exact this commit (63d0b87213a0ba241b3fcfba3fe7b0aed0cd1cc5),
result is the same.
Then, on commit just before this one (aeaf3e6cf842):
> cat /sys/class/backlight/amdgpu_bl1/{brightness,actual_brightness}
12
12
I hope I included all relevant information, more info can be found here:
https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/issues/52
I'm announcing the release of the 6.10.2 kernel.
All users of the 6.10 kernel series must upgrade.
The updated 6.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.10.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 -
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 1
arch/arm64/boot/dts/qcom/ipq8074.dtsi | 2 +
arch/arm64/boot/dts/qcom/msm8996.dtsi | 1
arch/arm64/boot/dts/qcom/msm8998.dtsi | 1
arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 13 +++++++-
arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 13 +++++++-
arch/arm64/boot/dts/qcom/sc7180.dtsi | 1
arch/arm64/boot/dts/qcom/sc7280.dtsi | 1
arch/arm64/boot/dts/qcom/sdm630.dtsi | 1
arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +
arch/arm64/boot/dts/qcom/sm6115.dtsi | 1
arch/arm64/boot/dts/qcom/sm6350.dtsi | 1
arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 17 ++++++++---
arch/arm64/boot/dts/qcom/x1e80100-qcp.dts | 17 ++++++++---
arch/s390/mm/fault.c | 3 +
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 -
drivers/net/tap.c | 5 +++
drivers/net/tun.c | 3 +
drivers/usb/gadget/function/f_midi2.c | 19 +++++++-----
fs/jfs/xattr.c | 23 ++++++++++++---
fs/locks.c | 9 ++---
fs/ntfs3/fslog.c | 44 ++++++++++++++++++++++++----
fs/ocfs2/dir.c | 46 ++++++++++++++++++------------
sound/core/pcm_dmaengine.c | 6 +++
sound/core/seq/seq_ump_client.c | 16 ++++++++++
sound/pci/hda/patch_realtek.c | 3 +
27 files changed, 198 insertions(+), 55 deletions(-)
Abel Vesa (4):
arm64: dts: qcom: x1e80100-qcp: Fix USB PHYs regulators
arm64: dts: qcom: x1e80100-crd: Fix the PHY regulator for PCIe 6a
arm64: dts: qcom: x1e80100-qcp: Fix the PHY regulator for PCIe 6a
arm64: dts: qcom: x1e80100-crd: Fix USB PHYs regulators
Dan Carpenter (1):
drm/amdgpu: Fix signedness bug in sdma_v4_0_process_trap_irq()
Dmitry Baryshkov (2):
arm64: dts: qcom: qrb2210-rb1: switch I2C2 to i2c-gpio
arm64: dts: qcom: qrb4210-rb2: switch I2C2 to i2c-gpio
Dongli Zhang (1):
tun: add missing verification for short frame
Edson Juliano Drosdeck (1):
ALSA: hda/realtek: Enable headset mic on Positivo SU C1400
Gerald Schaefer (1):
s390/mm: Fix VM_FAULT_HWPOISON handling in do_exception()
Greg Kroah-Hartman (1):
Linux 6.10.2
Jann Horn (1):
filelock: Fix fcntl/close race recovery compat path
Konstantin Komarov (1):
fs/ntfs3: Add a check for attr_names and oatbl
Krishna Kurapati (10):
arm64: dts: qcom: sc7180: Disable SuperSpeed instances in park mode
arm64: dts: qcom: sc7280: Disable SuperSpeed instances in park mode
arm64: dts: qcom: msm8996: Disable SS instance in Parkmode for USB
arm64: dts: qcom: sm6350: Disable SS instance in Parkmode for USB
arm64: dts: qcom: msm8998: Disable SS instance in Parkmode for USB
arm64: dts: qcom: ipq6018: Disable SS instance in Parkmode for USB
arm64: dts: qcom: sdm630: Disable SS instance in Parkmode for USB
arm64: dts: qcom: ipq8074: Disable SS instance in Parkmode for USB
arm64: dts: qcom: sdm845: Disable SS instance in Parkmode for USB
arm64: dts: qcom: sm6115: Disable SS instance in Parkmode for USB
Seunghun Han (1):
ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
Shenghao Ding (1):
ALSA: hda/tas2781: Add new quirk for Lenovo Hera2 Laptop
Shengjiu Wang (1):
ALSA: pcm_dmaengine: Don't synchronize DMA channel when DMA is paused
Si-Wei Liu (1):
tap: add missing verification for short frame
Takashi Iwai (2):
usb: gadget: midi2: Fix incorrect default MIDI2 protocol setup
ALSA: seq: ump: Skip useless ports for static blocks
lei lu (3):
ocfs2: add bounds checking to ocfs2_check_dir_entry()
jfs: don't walk off the end of ealist
fs/ntfs3: Validate ff offset
I'm announcing the release of the 6.6.43 kernel.
All users of the 6.6 kernel series must upgrade.
The updated 6.6.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.6.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 -
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 1
arch/arm64/boot/dts/qcom/msm8996.dtsi | 1
arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 13 ++++++++
arch/arm64/boot/dts/qcom/sdm630.dtsi | 1
arch/arm64/boot/dts/qcom/sm6350.dtsi | 1
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 -
drivers/net/tap.c | 5 +++
drivers/net/tun.c | 3 ++
drivers/usb/gadget/function/f_midi2.c | 19 +++++++-----
fs/jfs/xattr.c | 23 ++++++++++++---
fs/locks.c | 9 ++----
fs/ntfs3/fslog.c | 44 ++++++++++++++++++++++++-----
fs/ocfs2/dir.c | 46 +++++++++++++++++++------------
sound/core/pcm_dmaengine.c | 6 +++-
sound/core/seq/seq_ump_client.c | 16 ++++++++++
sound/pci/hda/patch_realtek.c | 2 +
17 files changed, 149 insertions(+), 45 deletions(-)
Dan Carpenter (1):
drm/amdgpu: Fix signedness bug in sdma_v4_0_process_trap_irq()
Dmitry Baryshkov (1):
arm64: dts: qcom: qrb4210-rb2: switch I2C2 to i2c-gpio
Dongli Zhang (1):
tun: add missing verification for short frame
Edson Juliano Drosdeck (1):
ALSA: hda/realtek: Enable headset mic on Positivo SU C1400
Greg Kroah-Hartman (1):
Linux 6.6.43
Jann Horn (1):
filelock: Fix fcntl/close race recovery compat path
Konstantin Komarov (1):
fs/ntfs3: Add a check for attr_names and oatbl
Krishna Kurapati (4):
arm64: dts: qcom: msm8996: Disable SS instance in Parkmode for USB
arm64: dts: qcom: sm6350: Disable SS instance in Parkmode for USB
arm64: dts: qcom: ipq6018: Disable SS instance in Parkmode for USB
arm64: dts: qcom: sdm630: Disable SS instance in Parkmode for USB
Seunghun Han (1):
ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
Shengjiu Wang (1):
ALSA: pcm_dmaengine: Don't synchronize DMA channel when DMA is paused
Si-Wei Liu (1):
tap: add missing verification for short frame
Takashi Iwai (2):
usb: gadget: midi2: Fix incorrect default MIDI2 protocol setup
ALSA: seq: ump: Skip useless ports for static blocks
lei lu (3):
ocfs2: add bounds checking to ocfs2_check_dir_entry()
jfs: don't walk off the end of ealist
fs/ntfs3: Validate ff offset
I'm announcing the release of the 6.1.102 kernel.
All users of the 6.1 kernel series must upgrade.
The updated 6.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.1.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 -
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 1
arch/arm64/boot/dts/qcom/msm8996.dtsi | 1
arch/arm64/boot/dts/qcom/sdm630.dtsi | 1
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 -
drivers/net/tap.c | 5 +++
drivers/net/tun.c | 3 ++
fs/btrfs/transaction.c | 5 ++-
fs/f2fs/super.c | 15 +++++++++-
fs/jfs/xattr.c | 23 +++++++++++++---
fs/locks.c | 9 ++----
fs/ntfs3/fslog.c | 6 +++-
fs/ocfs2/dir.c | 46 ++++++++++++++++++++-------------
sound/core/pcm_dmaengine.c | 6 +++-
sound/pci/hda/patch_realtek.c | 2 +
15 files changed, 94 insertions(+), 33 deletions(-)
Chao Yu (1):
f2fs: avoid dead loop in f2fs_issue_checkpoint()
Dan Carpenter (1):
drm/amdgpu: Fix signedness bug in sdma_v4_0_process_trap_irq()
Dongli Zhang (1):
tun: add missing verification for short frame
Edson Juliano Drosdeck (1):
ALSA: hda/realtek: Enable headset mic on Positivo SU C1400
Filipe Manana (1):
btrfs: do not BUG_ON on failure to get dir index for new snapshot
Greg Kroah-Hartman (1):
Linux 6.1.102
Jann Horn (1):
filelock: Fix fcntl/close race recovery compat path
Krishna Kurapati (3):
arm64: dts: qcom: msm8996: Disable SS instance in Parkmode for USB
arm64: dts: qcom: ipq6018: Disable SS instance in Parkmode for USB
arm64: dts: qcom: sdm630: Disable SS instance in Parkmode for USB
Seunghun Han (1):
ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
Shengjiu Wang (1):
ALSA: pcm_dmaengine: Don't synchronize DMA channel when DMA is paused
Si-Wei Liu (1):
tap: add missing verification for short frame
lei lu (3):
ocfs2: add bounds checking to ocfs2_check_dir_entry()
jfs: don't walk off the end of ealist
fs/ntfs3: Validate ff offset