Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426AbbEZOfL (ORCPT ); Tue, 26 May 2015 10:35:11 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:51257 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752331AbbEZOfE (ORCPT ); Tue, 26 May 2015 10:35:04 -0400 MIME-Version: 1.0 In-Reply-To: <20150526140654.GI11588@mwanda> References: <1431543500-4847-1-git-send-email-Jason@zx2c4.com> <1432642669-7289-1-git-send-email-Jason@zx2c4.com> <1432642669-7289-5-git-send-email-Jason@zx2c4.com> <20150526140654.GI11588@mwanda> Date: Tue, 26 May 2015 16:34:55 +0200 Message-ID: Subject: Re: [oss-security] Re: [PATCH v2 4/4] ozwpan: unchecked signed subtraction leads to DoS From: "Jason A. Donenfeld" To: Dan Carpenter Cc: linux-kernel@vger.kernel.org, Shigekatsu Tateno , Greg Kroah-Hartman , devel@driverdev.osuosl.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 677 Lines: 13 On Tue, May 26, 2015 at 4:06 PM, Dan Carpenter wrote: > You sure do like wrapping to a high value and testing the result for > wrapping instead of validating before doing the subtraction... I do indeed. It seems like asking "did it overflow?" is more straight-forward and easier to read than trying to come up with the necessary conditions to check for "will it overflow?". Personal preference, I guess. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/