lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve8TAZg96n-R8WHvAm_DKxr7y0b6XST1X-jR5aiat-Qsg@mail.gmail.com>
Date:	Tue, 27 Sep 2011 20:52:37 +0300
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Cc:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	linux-kernel@...r.kernel.org,
	Denys Vlasenko <vda.linux@...glemail.com>
Subject: Re: [PATCHv2] fat: don't use custom hex_to_bin()

On Tue, Sep 27, 2011 at 8:19 PM, OGAWA Hirofumi
<hirofumi@...l.parknet.co.jp> wrote:
> Andy Shevchenko <andriy.shevchenko@...ux.intel.com> writes:
>
> Looks good to me.
>
> Acked-by: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
>
> Or if it's needed, I'll apply this to fat tree.
I guess so. Thanks!

>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
>> Cc: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
>> ---
>>  fs/fat/namei_vfat.c |   30 ++++++++----------------------
>>  1 files changed, 8 insertions(+), 22 deletions(-)
>>
>> diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
>> index bb3f29c..cf0fd96 100644
>> --- a/fs/fat/namei_vfat.c
>> +++ b/fs/fat/namei_vfat.c
>> @@ -21,6 +21,8 @@
>>  #include <linux/slab.h>
>>  #include <linux/buffer_head.h>
>>  #include <linux/namei.h>
>> +#include <linux/kernel.h>
>> +
>>  #include "fat.h"
>>
>>  /*
>> @@ -505,10 +507,8 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname,
>>            struct nls_table *nls)
>>  {
>>       const unsigned char *ip;
>> -     unsigned char nc;
>>       unsigned char *op;
>> -     unsigned int ec;
>> -     int i, k, fill;
>> +     int i, rc, fill;
>>       int charlen;
>>
>>       if (utf8) {
>> @@ -528,26 +528,12 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname,
>>                               if (escape && (*ip == ':')) {
>>                                       if (i > len - 5)
>>                                               return -EINVAL;
>> -                                     ec = 0;
>> -                                     for (k = 1; k < 5; k++) {
>> -                                             nc = ip[k];
>> -                                             ec <<= 4;
>> -                                             if (nc >= '0' && nc <= '9') {
>> -                                                     ec |= nc - '0';
>> -                                                     continue;
>> -                                             }
>> -                                             if (nc >= 'a' && nc <= 'f') {
>> -                                                     ec |= nc - ('a' - 10);
>> -                                                     continue;
>> -                                             }
>> -                                             if (nc >= 'A' && nc <= 'F') {
>> -                                                     ec |= nc - ('A' - 10);
>> -                                                     continue;
>> -                                             }
>> +
>> +                                     rc = hex2bin(op, ip + 1, 2);
>> +                                     if (rc < 0)
>>                                               return -EINVAL;
>> -                                     }
>> -                                     *op++ = ec & 0xFF;
>> -                                     *op++ = ec >> 8;
>> +
>> +                                     op += 2;
>>                                       ip += 5;
>>                                       i += 5;
>>                               } else {
>
> --
> OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ