From owner-svn-src-stable@freebsd.org Sat Oct 7 20:20:03 2017 Return-Path: Delivered-To: svn-src-stable@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 630D9E414AA; Sat, 7 Oct 2017 20:20:03 +0000 (UTC) (envelope-from emaste@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 C739E6E888; Sat, 7 Oct 2017 20:20:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v97KK1v5062615; Sat, 7 Oct 2017 20:20:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v97KK18v062614; Sat, 7 Oct 2017 20:20:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710072020.v97KK18v062614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 7 Oct 2017 20:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324398 - stable/11/lib/libsysdecode X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/lib/libsysdecode X-SVN-Commit-Revision: 324398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 20:20:03 -0000 Author: emaste Date: Sat Oct 7 20:20:01 2017 New Revision: 324398 URL: https://svnweb.freebsd.org/changeset/base/324398 Log: MFC r323675: libsysdecode: report invalid cap_rights_t Previously we'd have an assertion failure in cap_rights_is_set if sysdecode_cap_rights is called with an invalid cap_rights_t, so test for validity first. PR: 222258 Sponsored by: The FreeBSD Foundation Modified: stable/11/lib/libsysdecode/flags.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/flags.c ============================================================================== --- stable/11/lib/libsysdecode/flags.c Sat Oct 7 20:18:20 2017 (r324397) +++ stable/11/lib/libsysdecode/flags.c Sat Oct 7 20:20:01 2017 (r324398) @@ -988,8 +988,15 @@ void sysdecode_cap_rights(FILE *fp, cap_rights_t *rightsp) { struct name_table *t; + int i; bool comma; + for (i = 0; i < CAPARSIZE(rightsp); i++) { + if (CAPIDXBIT(rightsp->cr_rights[i]) != 1 << i) { + fprintf(fp, "invalid cap_rights_t"); + return; + } + } comma = false; for (t = caprights; t->str != NULL; t++) { if (cap_rights_is_set(rightsp, t->val)) {