From owner-freebsd-current@freebsd.org Tue Oct 8 10:59:58 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 897BB143E17 for ; Tue, 8 Oct 2019 10:59:58 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46nZB632l5z3HGS; Tue, 8 Oct 2019 10:59:58 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by mail-lj1-x22c.google.com with SMTP id m13so16989069ljj.11; Tue, 08 Oct 2019 03:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=G+qgNFbjzGPIGl80WkyUwxwxGmzDtP3xIilaHsczPOk=; b=k1zRlSzJpEohY5qyrry35ykgohBQDYwtu5XeFD++tOhWHM7iN7fuKf6GT9qz6ZaS1P XZOCJ7LUYyqjjfsRaqV4TuMEcULnNDfr2VH2tP1ryhZNmXtZc/54Ow0YBn2c0NFcMHGE jJwtv2vYw49Zfey9e1wUTE6TOrHxmjIx109J3oy5p48ra3R4RsS0yjuGzI2xDL60UYHN DTzb8Wll1q8VBSdE9ZxwhUUeI8bgOKoaL6RDCNBQCTF8vO+aRN3/zb2CxYJl03Y79r7h YTZxbVMYPALhFtXGgpyE5hVm7y74rlaIbmZ/rLYFtiPUxtpRo5QkEWkBXKlnTI8FjMc9 bgAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=G+qgNFbjzGPIGl80WkyUwxwxGmzDtP3xIilaHsczPOk=; b=ZAaA1HLJRYn1UqHK4jh9oYMfN6tzJh5JHK/tu20D9i3fSLBXJbNzUinDyknvLHUDej s08t7Ke+ctKmLfPjgxC8ndXS0sNiR/v+3d5sxwe+NzNmCJZfF9/YkCibH02Tk59Mvyz6 wCQpOocxT1uokmJJw3bZluHh12XkEN8Pez5M9c/1XKroIpQMoOno7V+KLbyaNav7eatS x7DlpKo97JF/Fnd3VPMdPaTTxOoHU8TX8+vlGhdrcIfeWfe/ETXy5NtX+9LbSralQH2w JPzLiT7Q3OUIgfxLtNlXTHQZVnW12JWlQq7DZ6XU6WRf5lkX/in6o7MhdhLYeCQ3zifp jWmw== X-Gm-Message-State: APjAAAVX04ywQZhEi6K6nPn5x7uali6LY8xtJY8ppCNAe3HgM6RZy/bU ZtEzpgMGzhzrKQVjiXq9pHdvSfQQVX4= X-Google-Smtp-Source: APXvYqyGHgYs3FI+NLWQ0CL4JLC5fl+8QXdrRkX+BcsF9xBrLemoCm+X3LeoqNqweCPNozCFG+LMsA== X-Received: by 2002:a2e:4258:: with SMTP id p85mr21779486lja.172.1570532395957; Tue, 08 Oct 2019 03:59:55 -0700 (PDT) Received: from MacBook-Air.local (dev.nginx.com. [88.198.34.197]) by smtp.gmail.com with ESMTPSA id c197sm3525492lfg.46.2019.10.08.03.59.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2019 03:59:54 -0700 (PDT) Sender: Sergey Kandaurov Date: Tue, 8 Oct 2019 13:59:53 +0300 From: Sergey Kandaurov To: John Baldwin Cc: Ryan Stone , FreeBSD Current Subject: Re: ktrace/kdump give incorrect message on unlinkat() failure due to capabilities Message-ID: <20191008105953.ktwgu4xgeydmry2c@MacBook-Air.local> References: <20190925173338.lvlg4cstdjcwwbtm@MacBook-Air.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 46nZB632l5z3HGS X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Oct 2019 10:59:58 -0000 On Mon, Oct 07, 2019 at 09:48:16AM -0700, John Baldwin wrote: > On 9/25/19 10:33 AM, Sergey Kandaurov wrote: > > > > Index: lib/libsysdecode/mktables > > =================================================================== > > --- lib/libsysdecode/mktables (revision 352685) > > +++ lib/libsysdecode/mktables (working copy) > > @@ -157,7 +157,7 @@ > > gen_table "sigcode" "SI_[A-Z]+[[:space:]]+0(x[0-9abcdef]+)?" "sys/signal.h" > > gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/umtx.h" > > gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" > > -gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" > > +gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+(CAPRIGHT|[()A-Z_|[:space:]]+CAP_LOOKUP)" "sys/capsicum.h" > > gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+[[:space:]]+0x[0-9]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_ALL" > > gen_table "cmsgtypesocket" "SCM_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/socket.h" > > if [ -e "${include_dir}/x86/sysarch.h" ]; then > > CAP_SEEK and CAP_MMAP_X might also be subject to this. However, I'm not quite > understanding the regex, or at least why the modified portion of the regex isn't > something like this: > > (CAPRIGHT\(|\(CAP_LOOKUP) This won't match against CAP_LOOKUP on the right side, as in CAP_FSTATAT, but since it is built from CAP_FSTAT and CAP_LOOKUP, it should be fine still. > That is, you currently have [()A-Z_|[:space:]]+ for an expression that I think > will only ever match a single '(' character. All this sad magic is for preceding characters before CAP_LOOKUP, such as in "(CAP_FSTAT | CAP_LOOKUP". But seems it isn't needed. > A more general form that might work for CAP_SEEK and CAP_MMAP_X might be > to match on 'CAP_ | 0x > (CAPRIGHT\(|\([^)]*CAP_[A-Z_]+ \| 0x[0-9]+) Given the above, it looks fine.