From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757377AbcJMWUQ (ORCPT ); Thu, 13 Oct 2016 18:20:16 -0400 Received: from odin.sdf-eu.org ([178.63.35.194]:59359 "EHLO sdfeu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757020AbcJMWUJ (ORCPT ); Thu, 13 Oct 2016 18:20:09 -0400 X-Greylist: delayed 405 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Oct 2016 18:20:09 EDT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 14 Oct 2016 00:12:43 +0200 From: none To: linux-kernel@vger.kernel.org Subject: =?UTF-8?Q?when_to_size=5Ft_for_representing_length_instead_of_in?= =?UTF-8?Q?t=E2=80=AF=3F?= X-Priority: 2 (High) Message-ID: User-Agent: Roundcube Webmail/1.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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,