Re: [PATCH next V3] proc: support file->f_pos checking in mem_lseek

From: Al Viro
Date: Fri Nov 10 2023 - 15:52:13 EST


On Fri, Nov 10, 2023 at 11:19:28PM +0800, Zizhi Wo wrote:
> From: WoZ1zh1 <wozizhi@xxxxxxxxxx>
>
> In mem_lseek, file->f_pos may overflow. And it's not a problem that
> mem_open set file mode with FMODE_UNSIGNED_OFFSET(memory_lseek). However,
> another file use mem_lseek do lseek can have not FMODE_UNSIGNED_OFFSET
> (kpageflags_proc_ops/proc_pagemap_operations...), so in order to prevent
> file->f_pos updated to an abnormal number, fix it by checking overflow and
> FMODE_UNSIGNED_OFFSET.

1) How is that different from the previous version?
2) Would FMODE_UNSIGNED_OFFSET be wrong for those files? If not, why not?