[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250319164602.GC1061595@mit.edu>
Date: Wed, 19 Mar 2025 12:46:02 -0400
From: "Theodore Ts'o" <tytso@....edu>
To: Linus Torvalds <torvalds@...uxfoundation.org>
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, Mar 19, 2025 at 09:28:56AM -0700, Linus Torvalds wrote:
> 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.
Yes, good point. My suggestion was to optimize htings by avoid
calling strcmp() in most cases, but you're absolutely correct that we
could do even better by *never* calling strcmp().
- Ted
Powered by blists - more mailing lists