Project

General

Profile

Actions

Bug #6787

open

hsfs asserts instead of handling getpage beyond EOF

Added by Josef Sipek over 6 years ago. Updated over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
filesystems (not ZFS)
Start date:
2016-03-23
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

lofi likes to ask the underlaying fs for data in 8kB chunks (MAXBSIZE). If a file is 12kB long, lofi will try to read MAXBSIZE at offset 0, and MAXBSIZE at offset 8k. The second read will end up setting up a page beyond the EOF. As far as I can tell, this is ok for the kernel to do. Only when the vop_getpage is invoked by the user does the code bail with EFAULT. In this case, the hsfs_getapage call with offset EOF, len PAGESIZE is what ends up tripping the assertion.

Note: simply removing the assertion causes an assertion in pvn_read_kluster to trigger.

> $C
ffffff0004635380 vpanic()
ffffff00046353b0 0xfffffffffbe0fa88()
ffffff0004635530 hsfs_getapage+0x255(ffffff00dc5cbd00, 265b000, 1000, ffffff000463584c, ffffff0004635838, 1000, fffffffffbc44360, ffffff00c3fcf000, ffffff0000000001, ffffff00c89dfdd8)
ffffff0004635630 pvn_getpages+0x181(fffffffff7e7c020, ffffff00dc5cbd00, 265a000, 2000, ffffff000463584c, ffffff0004635830, 1000, fffffffffbc44360, ffffff00c3fce000, 1, ffffff00c89dfdd8)
ffffff00046356f0 hsfs_getpage+0x183(ffffff00dc5cbd00, 265a000, 2000, ffffff000463584c, ffffff0004635830, 2000, fffffffffbc44360, ffffff00c3fce000, ffffff0000000001, ffffff00c89dfdd8, 0)
ffffff00046357b0 fop_getpage+0x7e(ffffff00dc5cbd00, 265a000, 2000, ffffff000463584c, ffffff0004635830, 2000, fffffffffbc44360, ffffff00c3fce000, 1, ffffff00c89dfdd8, 0)
ffffff00046358b0 segmap_fault+0x16c(ffffff00c674bee0, fffffffffbc44360, ffffff00c3fce000, 2000, 0, 1)
ffffff00046359c0 segmap_getmapflt+0x582(fffffffffbc44360, ffffff00dc5cbd00, 265a000, 2000, 1, 1)
ffffff0004635a80 lofi_mapped_rdwr+0x12c(ffffff00e3752000, 2653200, ffffff00d805b980, ffffff00e20ef800)
ffffff0004635b60 lofi_strategy_task+0x4d2(ffffff00d805b980)
ffffff0004635c20 taskq_thread+0x318(ffffff00d97e2628)
ffffff0004635c30 thread_start+8()

Files

hsfs.patch (1.85 KB) hsfs.patch Josef Sipek, 2016-03-23 07:17 PM
Actions #1

Updated by Josef Sipek over 6 years ago

  • Category set to filesystems (not ZFS)
Actions #2

Updated by Josef Sipek over 6 years ago

Actions

Also available in: Atom PDF