Re: [PATCH v2] fs: fix unintentional arithmetic wraparound in offset calculation

2024-05-13 Thread Kees Cook
On Mon, May 13, 2024 at 10:06:59PM +, Justin Stitt wrote: > On Mon, May 13, 2024 at 01:01:57PM -0700, Kees Cook wrote: > > On Thu, May 09, 2024 at 11:42:07PM +, Justin Stitt wrote: > > > fs/read_write.c | 18 +++--- > > > fs/remap_range.c | 12 ++-- > > > 2 files

Re: [PATCH v2] fs: fix unintentional arithmetic wraparound in offset calculation

2024-05-13 Thread Justin Stitt
On Mon, May 13, 2024 at 01:01:57PM -0700, Kees Cook wrote: > On Thu, May 09, 2024 at 11:42:07PM +, Justin Stitt wrote: > > fs/read_write.c | 18 +++--- > > fs/remap_range.c | 12 ++-- > > 2 files changed, 17 insertions(+), 13 deletions(-) > > > > diff --git

Re: [PATCH v2] fs: fix unintentional arithmetic wraparound in offset calculation

2024-05-13 Thread Kees Cook
On Thu, May 09, 2024 at 11:42:07PM +, Justin Stitt wrote: > When running syzkaller with the newly reintroduced signed integer > overflow sanitizer we encounter this report: > > [ 67.995501] UBSAN: signed-integer-overflow in ../fs/read_write.c:91:10 > [ 68.67] 9223372036854775807 +

[PATCH v2] fs: fix unintentional arithmetic wraparound in offset calculation

2024-05-09 Thread Justin Stitt
When running syzkaller with the newly reintroduced signed integer overflow sanitizer we encounter this report: [ 67.995501] UBSAN: signed-integer-overflow in ../fs/read_write.c:91:10 [ 68.67] 9223372036854775807 + 4096 cannot be represented in type 'loff_t' (aka 'long long') [