linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: DoS in lseek inodes with proc_ops
       [not found] <SEZPR02MB70394C03FD07798864962C7C8EFBA@SEZPR02MB7039.apcprd02.prod.outlook.com>
@ 2023-09-18  9:59 ` Alexey Dobriyan
  0 siblings, 0 replies; only message in thread
From: Alexey Dobriyan @ 2023-09-18  9:59 UTC (permalink / raw)
  To: 张子勋(Zhang Zixun)
  Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Mon, Sep 18, 2023 at 07:39:51AM +0000, 张子勋(Zhang Zixun) wrote:
> Hi,
> There is a null pointer dereference DoS issue when I use lseek syscall to inode with proc_ops.
> I find the root cause is https://lore.kernel.org/all/YFYX0Bzwxlc7aBa%2F@localhost.localdomain/ .
> In this patch, the lseek syscall is set to mandatory. So, if proc_lseek is not set in proc_ops, pde->proc_ops->proc_lseek will get a null pointer.
> I want to know why all inode in proc need to set its own lseek, and why set default_llseek in pde_lseek isn’t a good idea?
> By the way, although every inode need set a lseek to use lseek syscall, lseek to a inode without lseek should get a fail return and the kernel should’t panic.

It removes 1 branch and make code smaller too.
You can switch to nonseekable_open() if you don't need lseeks.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-18 10:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <SEZPR02MB70394C03FD07798864962C7C8EFBA@SEZPR02MB7039.apcprd02.prod.outlook.com>
2023-09-18  9:59 ` DoS in lseek inodes with proc_ops Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).