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>] [day] [month] [year] [list]
Date:	Tue, 26 Apr 2011 12:06:24 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	netdev@...r.kernel.org
CC:	dykmanj@...ux.vnet.ibm.com
Subject: HFI driver...


I started reviewing this monster, here is what I have to say so far:

1) Get rid of this character device.

   If you want to dump traces, and allow the user to submit commands,
   you can create a generic netlink family to do this.

   Netlink will get rid of the ugly char device, and allow you to
   extend your interfaces in a backwards compatible way in the future.

2) You add casts to of_get_property() return values.  This should never
   be necessary.

   of_get_property() returns "const void *" which means as long as
   you declare your pointers "const" (which you don't) no cast is
   necessary.

   You are bypassing the read-only protection property values have
   by doing these casts, get rid of them and declare your pointers
   with "const".

3) Most uses of "long long" and "int" are suspect.

   If you need a 64-bit type, use "u64".  If you need a 32-bit
   type, use "u32".  If you need them to be signed use "s64"
   and "s32" respectively.

4) When you add the "is_userspace" variable to hfidd_cmd_write() there
   are not users.  This will produce warnings with gcc-4.6.0, do not
   add function variables that are set but never used.

5) Similar comment about using non-fixed-sized types in the definition
   of base_hdr, hfi_rdma_extended_hdr et al.  Never use generic C types
   like "unsigned int" and "unsigned long long".  Instead, always use
   well defined, fixed sized types like "u32", "u64", etc.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ