From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757392AbcBRXxx (ORCPT ); Thu, 18 Feb 2016 18:53:53 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:35528 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756954AbcBRXxv (ORCPT ); Thu, 18 Feb 2016 18:53:51 -0500 Date: Fri, 19 Feb 2016 00:21:36 +0100 From: Ralf Baechle To: Insu Yun Cc: David Miller , linux-hams@vger.kernel.org, Netdev , LKML , Taesoo Kim , Yeongjin Jang , "Yun, Insu" , Changwoo Min Subject: Re: [PATCH] rose: correct integer overflow check Message-ID: <20160218232136.GB11796@linux-mips.org> References: <1455740713-18262-1-git-send-email-wuninsu@gmail.com> <20160218.153329.28621505199573578.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 18, 2016 at 04:03:16PM -0500, Insu Yun wrote: > > Because of the types on the right hand side of the comparison > the expressions are all promoted to unsigned. > > Did you look at the compiler's assembler output?  I did when > reviewing your patch. > > > I checked the assembler output right now. > You are right. > I realized that right hand side becomes unsigned due to sizeof. > I think this patch is wrong.  > Thanks.  On a different level, the current whole approach of ROSE to just generate a fixed number of devices at initialization time of ROSE is if not wrong then at least very archaic. The default number is 10 devices and probably of those 9 are unused on a typical setup - that is, if the module has been loaded intentionally at all. As a solution I've implemented a patch to support creating of ROSE devices through netlink plus the necessary changes to iproute2 to go along with that. Ralf