From: Chao Yu <chao@kernel.org>
To: Alexey Dobriyan <adobriyan@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] proc: fix to check name length in proc_lookup_de()
Date: Sat, 11 Feb 2023 09:22:47 +0800 [thread overview]
Message-ID: <910d9157-1168-a7b7-8a9b-56a93687170c@kernel.org> (raw)
In-Reply-To: <Y9+fYuixrjGnkReH@p183>
On 2023/2/5 20:21, Alexey Dobriyan wrote:
> Nothing! /proc lived without this check for 30 years:
Oh, I'm trying make error handling logic of proc's lookup() to be the
same as other generic filesystem, it looks you don't think it's worth or
necessary to do that, anyway, the change is not critial, let's ignore it,
thank you for reviewing this patch.
Thanks,
>
> int proc_match(int len,const char * name,struct proc_dir_entry * de)
> {
> register int same __asm__("ax");
>
> if (!de || !de->low_ino)
> return 0;
> /* "" means "." ---> so paths like "/usr/lib//libc.a" work */
> if (!len && (de->name[0]=='.') && (de->name[1]=='\0'))
> return 1;
> if (de->namelen != len)
> return 0;
> __asm__("cld\n\t"
> "repe ; cmpsb\n\t"
> "setz %%al"
> :"=a" (same)
> :"0" (0),"S" ((long) name),"D" ((long) de->name),"c" (len)
> :"cx","di","si");
> return same;
> }
next prev parent reply other threads:[~2023-02-11 1:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-31 15:55 Chao Yu
2023-01-31 15:55 ` [PATCH 2/2] proc: fix .s_blocksize and .s_blocksize_bits Chao Yu
2023-02-01 13:01 ` [PATCH 1/2] proc: fix to check name length in proc_lookup_de() Chao Yu
2023-02-02 23:41 ` Andrew Morton
2023-02-05 12:21 ` Alexey Dobriyan
2023-02-11 1:22 ` Chao Yu [this message]
2023-02-11 1:13 ` Chao Yu
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=910d9157-1168-a7b7-8a9b-56a93687170c@kernel.org \
--to=chao@kernel.org \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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®