[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wgzYVZ0ZNvcqC+yToX6nFx+SNZqTcyEvzm2RMP-TU-Dqw@mail.gmail.com>
Date: Wed, 19 Mar 2025 09:28:56 -0700
From: Linus Torvalds <torvalds@...uxfoundation.org>
To: "Theodore Ts'o" <tytso@....edu>
Cc: Jakub Acs <acsjakub@...zon.com>, linux-kernel@...r.kernel.org,
linux-ext4@...r.kernel.org, Andreas Dilger <adilger.kernel@...ger.ca>,
Mahmoud Adam <mngyadam@...zon.com>, stable@...r.kernel.org, security@...nel.org
Subject: Re: [PATCH] ext4: fix OOB read when checking dotdot dir
On Wed, 19 Mar 2025 at 06:06, Theodore Ts'o <tytso@....edu> wrote:
>
> I'd change the check to:
>
> else if (unlikely(next_offset == size && de->name_len == 1 &&
> strcmp(".", de->name) == 0))
>
> which is a bit more optimized.
Why would you use 'strcmp()' when you just checked that the length is one?
IOW, if you are talking about "a bit more optimized", please just check
de->name[0] == '.'
after you've checked that the length is 1.
No?
Linus
Powered by blists - more mailing lists