Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643470

Re: [PATCH v5 1/2] selinux: add brief info to policydb

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Stephen Smalley <sds@tycho.nsa.gov>
Newsgroups linux.kernel
Subject Re: [PATCH v5 1/2] selinux: add brief info to policydb
Date Wed, 17 May 2017 17:40:01 +0200
Message-ID <tI9dn-4QL-3@gated-at.bofh.it> (permalink)
References <tHHqO-3Wv-17@gated-at.bofh.it> <tHRqa-1So-15@gated-at.bofh.it> <tI8Km-4GH-7@gated-at.bofh.it>
X-Original-To Sebastien Buisson <sbuisson.ddn@gmail.com>
X-Ironport-Av E=Sophos;i="5.38,355,1491264000"; d="scan'208";a="7154921"
Ironport-Phdr 9a23:Ca6TAxJEmo9qPk++tNmcpTZWNBhigK39O0sv0rFitYgXKPjzrarrMEGX3/hxlliBBdydsKMbzbOJ+PC/EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQtFiT6/bL9oMRm7rwrdu8oUjIB/Nqs/1xzFr2dSde9L321oP1WTnxj95se04pFu9jlbtuwi+cBdT6j0Zrw0QrNEAjsoNWA1/9DrugLYTQST/HscU34ZnQRODgPY8Rz1RJbxsi/9tupgxCmXOND9QL4oVTi+6apgVQTlgzkbOTEn7G7Xi9RwjKNFrxKnuxx/2JPfbIWMOPZjYq/RYdYWSGxPUcZLUyxKH52yYY0BAeEcOepUtpfxq0cLoRa4GAKiBv7gyiVQi3H1wKM00/ovHw/E0wwuGNIBrHPao9r6OqoJTeC4z7PFwSnZYv9K2zrw7pXDfBA7ofGLWLJ9adffyVUxGAPdjlWft4rlNC6I2OQIqWeb6+5gWvyvimU6rAxxuSWgxtw3h4nVhoMa1lDE9SJjzIYzPt23UlR3YdGjEJtOriyXMZZ9TMA6Q2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FLhLUEl6XgyloAPi3Y=
X-Ipas-Result A2GSAgAhbBxZ/wHyM5BcGwEBAQMBAQEJAQEBFwEBBAEBCgEBgwEpgW6DbZpMAQEBAQEBBoEmmASGJAKFW1cBAQEBAQEBAQIBAmgogjMkAYJBAQUjDwFGEAkCDQEKAgImAgJXBhOIB4IPDY8knWCCJiYCil0BAQEBAQUBAQEBASOBC4UOhT+HdYJgAQSeEJMbixqGU5RGWIEKJgkCHggfD4dYJDaIaAEBAQ
Organization National Security Agency
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.22.6 (3.22.6-2.fc25)
MIME-Version 1.0
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 21
X-Original-Cc linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, selinux@tycho.nsa.gov, serge@hallyn.com, james.l.morris@oracle.com, Eric Paris <eparis@parisplace.org>, Paul Moore <paul@paul-moore.com>, Sebastien Buisson <sbuisson@ddn.com>
X-Original-Date Wed, 17 May 2017 11:38:11 -0400
X-Original-Message-ID <1495035491.32535.6.camel@tycho.nsa.gov>
X-Original-References <1494928281-11128-1-git-send-email-sbuisson@ddn.com> <1494967240.21557.18.camel@tycho.nsa.gov> <CAPkE-bWykonYBssXGphktM7jANY_nbtQi7EVc4uLwjm-fdM8Kg@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1643470

Show key headers only | View raw


On Wed, 2017-05-17 at 16:59 +0200, Sebastien Buisson wrote:
> 2017-05-16 22:40 GMT+02:00 Stephen Smalley <sds@tycho.nsa.gov>:
> > > +     strcpy(*brief, policydb.policybrief);
> > > +     /* *len is the length of the output string */
> > > +     *len = policybrief_len - 1;
> > 
> > Is there a particular reason to not just return policybrief_len
> > here as
> > well, for consistency in the interface?  How do you intend to use
> > this
> > value in the caller?
> 
> As called in the other patch to expose policy brief via selinuxfs
> (sel_read_policybrief), the intent is to provide the caller with the
> length of the string returned.
> Or should I set *len to policy brief_len here, and just make the
> caller aware that the returned length is in fact the length of the
> buffer (i.e. including terminating NUL byte)?

Looking at the caller usage in the other patch, I guess it makes sense
in its current form.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-16 12:00 +0200
  Re: [PATCH v5 1/2] selinux: add brief info to policydb Stephen Smalley <sds@tycho.nsa.gov> - 2017-05-16 22:40 +0200
    Re: [PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-17 17:10 +0200
      Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 17:10 +0200
        Re: [PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-17 17:30 +0200
          Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 17:40 +0200
            Re: [PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-17 17:50 +0200
              Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 18:10 +0200
                Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 18:30 +0200
                Re: [PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-17 19:10 +0200
                Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 20:30 +0200
      Re: [PATCH v5 1/2] selinux: add brief info to policydb Stephen Smalley <sds@tycho.nsa.gov> - 2017-05-17 17:40 +0200

csiph-web