mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Hui Peng <benquike@gmail.com>
Cc: ericvh@kernel.org, lucho@ionkov.net, linux_oss@crudebyte.com,
	v9fs@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 9p: reject RERROR/RLERROR with zero errcode and guard 0-link drop_nlink()
Date: Tue, 22 Sep 2026 17:47:37 +0900	[thread overview]
Message-ID: <arJAqVPrm1XfL1w-@codewreck.org> (raw)
In-Reply-To: <20260919221734.3708000-1-benquike@gmail.com>

Hui Peng wrote on Sat, Sep 19, 2026 at 10:17:34PM +0000:
> Fix two issues in 9p client and VFS inode handling:

Please split this in two commits.

> 1. In p9_check_errors() (net/9p/client.c), a malicious or buggy 9p
>    server returning P9_RERROR or P9_RLERROR with ecode == 0 causes
>    p9_check_errors() to return 0 (success) while leaving the unparsed
>    response payload as if the expected reply message type succeeded. Map
>    ecode == 0 on RERROR / RLERROR to -EPROTO.

Sure

> 2. In v9fs_dec_count() (fs/9p/vfs_inode.c), only call drop_nlink() when
>    inode->i_nlink > 0 so unlinking an inode whose server-reported nlink
>    was already 0 does not underflow i_nlink and trigger
>    WARN_ON(inode->i_nlink == 0).

I'm pretty sure this is racy but the dir case already is anyway, so meh,
why not, ok.

-- 
Dominique Martinet | Asmadeus

      reply	other threads:[~2026-09-22  8:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 22:17 Hui Peng
2026-09-22  8:47 ` Dominique Martinet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=arJAqVPrm1XfL1w-@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=benquike@gmail.com \
    --cc=ericvh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=v9fs@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®