mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: none <ytrezq@sdf-eu.org>
To: linux-kernel@vger.kernel.org
Subject: when to size_t for representing length instead of int ?
Date: Fri, 14 Oct 2016 00:12:43 +0200	[thread overview]
Message-ID: <f71827f285f30906df9b5aa2c682cce5@mx.sdfeu.org> (raw)

Hello,

I wanted to known the rules in coding guidelines concerning the use of 
size_t.
It seems the signed int type is used most of the time for representing 
string sizes, including in some parts written by Linus in /lib.
They’re can buffer overflows attack if ssize_t if larger than 
sizeof(int) (though I agree this isn’t the only way, but at least it´s 
less error prone).

So is it guaranteed for all current and future cpu architectures the 
Linux kernel support that ssize_t will always be equal to sizeof(int) ?

regards,

             reply	other threads:[~2016-10-13 22:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13 22:12 none [this message]
2016-10-13 23:37 ` Al Viro
2016-10-16  2:04   ` none

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=f71827f285f30906df9b5aa2c682cce5@mx.sdfeu.org \
    --to=ytrezq@sdf-eu.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome