From: Petr Lautrbach <lautrbach@redhat.com>
To: James Carter <jwcart2@gmail.com>,
cgzones@googlemail.com, selinux@vger.kernel.org
Subject: Re: [PATCH 1/5] libselinux: set errno in failure case
Date: Thu, 16 Jan 2025 16:59:27 +0100 [thread overview]
Message-ID: <87jzauwy00.fsf@redhat.com> (raw)
In-Reply-To: <CAP+JOzSiqjUJ1yVft_fmgU_8HoJUdRhnvxFPSwxQeNcmUxbP3A@mail.gmail.com>
James Carter <jwcart2@gmail.com> writes:
> On Wed, Jan 15, 2025 at 8:13 AM Christian Göttsche
> <cgoettsche@seltendoof.de> wrote:
>>
>> From: Christian Göttsche <cgzones@googlemail.com>
>>
>> In case an entry read from a textual fcontext definition is too long set
>> errno and the error string accordingly.
>>
>> Fixes: 92306daf ("libselinux: rework selabel_file(5) database")
>> Reported-by: oss-fuzz (issue 389974971)
>> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> For these five patches:
> Acked-by: James Carter <jwcart2@gmail.com>
Merged. Thanks!
>> ---
>> libselinux/src/label_support.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/libselinux/src/label_support.c b/libselinux/src/label_support.c
>> index 978ba828..57e191c8 100644
>> --- a/libselinux/src/label_support.c
>> +++ b/libselinux/src/label_support.c
>> @@ -45,8 +45,11 @@ static inline int read_spec_entry(char **entry, const char **ptr, size_t *len, c
>> }
>>
>> if (*len) {
>> - if (*len >= UINT16_MAX)
>> + if (*len >= UINT16_MAX) {
>> + errno = EINVAL;
>> + *errbuf = "Spec entry too long";
>> return -1;
>> + }
>>
>> *entry = strndup(tmp_buf, *len);
>> if (!*entry)
>> --
>> 2.47.1
>>
>>
prev parent reply other threads:[~2025-01-16 15:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-15 13:13 [PATCH 2/5] checkpolicy: check identifier before copying Christian Göttsche
2025-01-15 13:13 ` [PATCH 3/5] checkpolicy: remove unneeded queue_head() Christian Göttsche
2025-01-15 13:13 ` [PATCH 4/5] checkpolicy: do not consume unmatched identifiers Christian Göttsche
2025-01-15 13:13 ` [PATCH 5/5] checkpolicy: clear queue between parser passes Christian Göttsche
2025-01-15 13:13 ` [PATCH 1/5] libselinux: set errno in failure case Christian Göttsche
2025-01-15 20:04 ` James Carter
2025-01-16 15:59 ` Petr Lautrbach [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzauwy00.fsf@redhat.com \
--to=lautrbach@redhat.com \
--cc=cgzones@googlemail.com \
--cc=jwcart2@gmail.com \
--cc=selinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.