Re: sparse warning in cifsacl.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 26, 2011 at 11:48 PM, Steve French <smfrench@xxxxxxxxx> wrote:
> Shirish - below is a patch to fix a sparse warning in the cifsacl
> code.  The change around line 458 is cosmetic (doesn't look like the
> original code caused a problem but at least this quiets sparse) but
> doesn't sid_authusers have an endian error.   How far back does this
> bug go - does it affect much?

Yes, sid_authusers have an endian error.

>
> diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
> index 076b69c..5f02b4e 100644
> --- a/fs/cifs/cifsacl.c
> +++ b/fs/cifs/cifsacl.c
> @@ -38,7 +38,7 @@ static const struct cifs_sid sid_everyone = {
>        1, 1, {0, 0, 0, 0, 0, 1}, {0} };
>  /* security id for Authenticated Users system group */
>  static const struct cifs_sid sid_authusers = {
> -       1, 1, {0, 0, 0, 0, 0, 5}, {11} };

This variable was addedd in commit 2fbc2f1729e785a7b2faf9d8d60926bb1ff62af0

> +       1, 1, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(11)} };
>  /* group users */
>  static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} };
>
> @@ -458,7 +458,8 @@ int compare_sids(const struct cifs_sid *ctsid,
> const struct cifs_sid *cwsid)
>        if (num_subauth) {
>                for (i = 0; i < num_subauth; ++i) {
>                        if (ctsid->sub_auth[i] != cwsid->sub_auth[i]) {
> -                               if (ctsid->sub_auth[i] > cwsid->sub_auth[i])
> +                               if (le32_to_cpu(ctsid->sub_auth[i]) >
> +                                       le32_to_cpu(cwsid->sub_auth[i]))

This code has been around for quite some time.

>                                        return 1;
>                                else
>                                        return -1;
>
>
> --
> Thanks,
>
> Steve
>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux