From owner-svn-src-all@freebsd.org Fri Apr 8 03:26:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E557B082E4; Fri, 8 Apr 2016 03:26:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EE971EA7; Fri, 8 Apr 2016 03:26:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u383QLhW042616; Fri, 8 Apr 2016 03:26:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u383QL2b042615; Fri, 8 Apr 2016 03:26:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604080326.u383QL2b042615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 8 Apr 2016 03:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297694 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2016 03:26:22 -0000 Author: pfg Date: Fri Apr 8 03:26:21 2016 New Revision: 297694 URL: https://svnweb.freebsd.org/changeset/base/297694 Log: audit(8): leave unsigned comparison for last. aq64_minfree is unsigned so comparing to find out if it is less than zero is a nonsense. Move the comparison to the last position as we don't want to spend time if any of the others triggers first. hile it would be tempting to just remove it, it may be important to keep it for portability with platforms where may be signed(?) or in case we may want to change it in the future. Modified: head/sys/security/audit/audit_syscalls.c Modified: head/sys/security/audit/audit_syscalls.c ============================================================================== --- head/sys/security/audit/audit_syscalls.c Fri Apr 8 01:57:40 2016 (r297693) +++ head/sys/security/audit/audit_syscalls.c Fri Apr 8 03:26:21 2016 (r297694) @@ -303,8 +303,8 @@ sys_auditon(struct thread *td, struct au (udata.au_qctrl64.aq64_lowater >= udata.au_qctrl.aq_hiwater) || (udata.au_qctrl64.aq64_bufsz > AQ_MAXBUFSZ) || - (udata.au_qctrl64.aq64_minfree < 0) || - (udata.au_qctrl64.aq64_minfree > 100)) + (udata.au_qctrl64.aq64_minfree > 100) || + (udata.au_qctrl64.aq64_minfree < 0)) return (EINVAL); audit_qctrl.aq_hiwater = (int)udata.au_qctrl64.aq64_hiwater;