All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shreeya Patel <shreeya.patel@collabora.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org,
	chao@kernel.org, krisman@collabora.com, drosen@google.com,
	yuchao0@huawei.com, linux-ext4@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org, kernel@collabora.com,
	andre.almeida@collabora.com
Subject: Re: [PATCH v4 5/5] fs: unicode: Add utf8 module and a unicode layer
Date: Fri, 26 Mar 2021 01:56:00 +0530	[thread overview]
Message-ID: <2db48ab8-1297-e044-dcec-6c8b8875fdb0@collabora.com> (raw)
In-Reply-To: <YFznIVf/F68oEuC6@sol.localdomain>


On 26/03/21 1:10 am, Eric Biggers wrote:
> On Thu, Mar 25, 2021 at 05:38:11AM +0530, Shreeya Patel wrote:
>> Also, indirect calls using function pointers are easily exploitable by
>> speculative execution attacks, hence use static_call() in unicode.h and
>> unicode-core.c files inorder to prevent these attacks by making direct
>> calls and also to improve the performance of function pointers.
> I don't think you need to worry about avoiding indirect calls to prevent
> speculative execution attacks.  That's what the mitigations like Retpoline are
> for.  Instead my concern was just that indirect calls are *slow*, especially
> when those mitigations are enabled.  Some of the casefolding operations are
> called a lot (e.g., repeatedly during path resolution), and it would be
> desirable to avoid adding more overhead there.
>
>> diff --git a/fs/unicode/Kconfig b/fs/unicode/Kconfig
>> index 2c27b9a5cd6c..2961b0206b4d 100644
>> --- a/fs/unicode/Kconfig
>> +++ b/fs/unicode/Kconfig
>> @@ -8,7 +8,16 @@ config UNICODE
>>   	  Say Y here to enable UTF-8 NFD normalization and NFD+CF casefolding
>>   	  support.
>>   
>> +# UTF-8 encoding can be compiled as a module using UNICODE_UTF8 option.
>> +# Having UTF-8 encoding as a module will avoid carrying large
>> +# database table present in utf8data.h_shipped into the kernel
>> +# by being able to load it only when it is required by the filesystem.
>> +config UNICODE_UTF8
>> +	tristate "UTF-8 module"
>> +	depends on UNICODE
>> +	default m
>> +
> The help for UNICODE still says that it enables UTF-8 support.  But now there is
> a separate option that people will need to remember to enable.
>
> Please document each of these options properly.
>
> Perhaps EXT4_FS and F2FS_FS just should select UNICODE_UTF8 if UNICODE, so that
> UNICODE_UTF8 doesn't have to be a user-selectable symbol?


It is not a user-selectable symbol. It depends on UNICODE and if someone 
enables it,
by default UNICODE_UTF8 will be enabled as a module.


>> +DEFINE_STATIC_CALL(validate, unicode_validate_static_call);
>> +EXPORT_STATIC_CALL(validate);
> Global symbols can't have generic names like "validate".  Please add an
> appropriate prefix like "unicode_".
>
> Also, the thing called "unicode_validate_static_call" isn't actually a static
> call as the name suggests, but rather the default function used by the static
> call.  It should be called something like unicode_validate_default.
>
> Likewise for all the others.


Thanks for your reviews, I'll make the change suggested by you in v5.


>
> - Eric
>

WARNING: multiple messages have this Message-ID (diff)
From: Shreeya Patel <shreeya.patel@collabora.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: tytso@mit.edu, drosen@google.com, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, kernel@collabora.com,
	adilger.kernel@dilger.ca, linux-fsdevel@vger.kernel.org,
	jaegeuk@kernel.org, andre.almeida@collabora.com,
	linux-ext4@vger.kernel.org, krisman@collabora.com
Subject: Re: [f2fs-dev] [PATCH v4 5/5] fs: unicode: Add utf8 module and a unicode layer
Date: Fri, 26 Mar 2021 01:56:00 +0530	[thread overview]
Message-ID: <2db48ab8-1297-e044-dcec-6c8b8875fdb0@collabora.com> (raw)
In-Reply-To: <YFznIVf/F68oEuC6@sol.localdomain>


On 26/03/21 1:10 am, Eric Biggers wrote:
> On Thu, Mar 25, 2021 at 05:38:11AM +0530, Shreeya Patel wrote:
>> Also, indirect calls using function pointers are easily exploitable by
>> speculative execution attacks, hence use static_call() in unicode.h and
>> unicode-core.c files inorder to prevent these attacks by making direct
>> calls and also to improve the performance of function pointers.
> I don't think you need to worry about avoiding indirect calls to prevent
> speculative execution attacks.  That's what the mitigations like Retpoline are
> for.  Instead my concern was just that indirect calls are *slow*, especially
> when those mitigations are enabled.  Some of the casefolding operations are
> called a lot (e.g., repeatedly during path resolution), and it would be
> desirable to avoid adding more overhead there.
>
>> diff --git a/fs/unicode/Kconfig b/fs/unicode/Kconfig
>> index 2c27b9a5cd6c..2961b0206b4d 100644
>> --- a/fs/unicode/Kconfig
>> +++ b/fs/unicode/Kconfig
>> @@ -8,7 +8,16 @@ config UNICODE
>>   	  Say Y here to enable UTF-8 NFD normalization and NFD+CF casefolding
>>   	  support.
>>   
>> +# UTF-8 encoding can be compiled as a module using UNICODE_UTF8 option.
>> +# Having UTF-8 encoding as a module will avoid carrying large
>> +# database table present in utf8data.h_shipped into the kernel
>> +# by being able to load it only when it is required by the filesystem.
>> +config UNICODE_UTF8
>> +	tristate "UTF-8 module"
>> +	depends on UNICODE
>> +	default m
>> +
> The help for UNICODE still says that it enables UTF-8 support.  But now there is
> a separate option that people will need to remember to enable.
>
> Please document each of these options properly.
>
> Perhaps EXT4_FS and F2FS_FS just should select UNICODE_UTF8 if UNICODE, so that
> UNICODE_UTF8 doesn't have to be a user-selectable symbol?


It is not a user-selectable symbol. It depends on UNICODE and if someone 
enables it,
by default UNICODE_UTF8 will be enabled as a module.


>> +DEFINE_STATIC_CALL(validate, unicode_validate_static_call);
>> +EXPORT_STATIC_CALL(validate);
> Global symbols can't have generic names like "validate".  Please add an
> appropriate prefix like "unicode_".
>
> Also, the thing called "unicode_validate_static_call" isn't actually a static
> call as the name suggests, but rather the default function used by the static
> call.  It should be called something like unicode_validate_default.
>
> Likewise for all the others.


Thanks for your reviews, I'll make the change suggested by you in v5.


>
> - Eric
>


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2021-03-25 20:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25  0:08 [PATCH v4 0/5] Make UTF-8 encoding loadable Shreeya Patel
2021-03-25  0:08 ` [f2fs-dev] " Shreeya Patel
2021-03-25  0:08 ` [PATCH v4 1/5] fs: unicode: Use strscpy() instead of strncpy() Shreeya Patel
2021-03-25  0:08   ` [f2fs-dev] " Shreeya Patel
2021-03-25  0:08 ` [PATCH v4 2/5] fs: Check if utf8 encoding is loaded before calling utf8_unload() Shreeya Patel
2021-03-25  0:08   ` [f2fs-dev] " Shreeya Patel
2021-03-25 19:21   ` Eric Biggers
2021-03-25 19:21     ` [f2fs-dev] " Eric Biggers
2021-03-25 19:31     ` Gabriel Krisman Bertazi
2021-03-25 19:31       ` [f2fs-dev] " Gabriel Krisman Bertazi
2021-03-25 19:43       ` Eric Biggers
2021-03-25 19:43         ` [f2fs-dev] " Eric Biggers
2021-03-25  0:08 ` [PATCH v4 3/5] fs: unicode: Rename function names from utf8 to unicode Shreeya Patel
2021-03-25  0:08   ` [f2fs-dev] " Shreeya Patel
2021-03-25 19:24   ` Eric Biggers
2021-03-25 19:24     ` [f2fs-dev] " Eric Biggers
2021-03-25  0:08 ` [PATCH v4 4/5] fs: unicode: Rename utf8-core file to unicode-core Shreeya Patel
2021-03-25  0:08   ` [f2fs-dev] " Shreeya Patel
2021-03-25  0:08 ` [PATCH v4 5/5] fs: unicode: Add utf8 module and a unicode layer Shreeya Patel
2021-03-25  0:08   ` [f2fs-dev] " Shreeya Patel
2021-03-25 19:40   ` Eric Biggers
2021-03-25 19:40     ` [f2fs-dev] " Eric Biggers
2021-03-25 20:26     ` Shreeya Patel [this message]
2021-03-25 20:26       ` Shreeya Patel
2021-03-25 21:26       ` Shreeya Patel
2021-03-25 21:26         ` [f2fs-dev] " Shreeya Patel

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=2db48ab8-1297-e044-dcec-6c8b8875fdb0@collabora.com \
    --to=shreeya.patel@collabora.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=andre.almeida@collabora.com \
    --cc=chao@kernel.org \
    --cc=drosen@google.com \
    --cc=ebiggers@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=kernel@collabora.com \
    --cc=krisman@collabora.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=yuchao0@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.