Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
staging
rpms
glibc
Commits
c33d8b41
Commit
c33d8b41
authored
2 weeks ago
by
Rocky Automation
Browse files
Options
Downloads
Patches
Plain Diff
import glibc-2.28-251.el8_10.14
parent
201a0ff1
Branches
r8
Tags
imports/r8/glibc-2.28-251.el8_10.14
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SOURCES/glibc-RHEL-78390.patch
+114
-0
114 additions, 0 deletions
SOURCES/glibc-RHEL-78390.patch
SPECS/glibc.spec
+5
-1
5 additions, 1 deletion
SPECS/glibc.spec
with
119 additions
and
1 deletion
SOURCES/glibc-RHEL-78390.patch
0 → 100644
+
114
−
0
View file @
c33d8b41
commit c4e4b2e149705559d28b16a9b47ba2f6142d6a6c
Author: Andreas Schwab <schwab@suse.de>
Date: Tue Jun 23 12:55:49 2020 +0200
Correct locking and cancellation cleanup in syslog functions (bug 26100)
Properly serialize the access to the global state shared between the
syslog functions, to avoid races in multithreaded processes. Protect a
local allocation in the __vsyslog_internal function from leaking during
cancellation.
diff --git a/misc/syslog.c b/misc/syslog.c
index fd6537edf6..2cc63ef287 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -91,14 +91,20 @@
struct cleanup_arg
static void
cancel_handler (void *ptr)
{
-#ifndef NO_SIGPIPE
/* Restore the old signal handler. */
struct cleanup_arg *clarg = (struct cleanup_arg *) ptr;
- if (clarg != NULL && clarg->oldaction != NULL)
- __sigaction (SIGPIPE, clarg->oldaction, NULL);
+ if (clarg != NULL)
+ {
+#ifndef NO_SIGPIPE
+ if (clarg->oldaction != NULL)
+ __sigaction (SIGPIPE, clarg->oldaction, NULL);
#endif
+ /* Free the memstream buffer, */
+ free (clarg->buf);
+ }
+
/* Free the lock. */
__libc_lock_unlock (syslog_lock);
}
@@ -169,9 +175,17 @@
__vsyslog_internal(int pri, const char *fmt, va_list ap,
pri &= LOG_PRIMASK|LOG_FACMASK;
}
+ /* Prepare for multiple users. We have to take care: most
+ syscalls we are using are cancellation points. */
+ struct cleanup_arg clarg;
+ clarg.buf = NULL;
+ clarg.oldaction = NULL;
+ __libc_cleanup_push (cancel_handler, &clarg);
+ __libc_lock_lock (syslog_lock);
+
/* Check priority against setlogmask values. */
if ((LOG_MASK (LOG_PRI (pri)) & LogMask) == 0)
- return;
+ goto out;
/* Set default facility if none specified. */
if ((pri & LOG_FACMASK) == 0)
@@ -235,6 +249,9 @@
__vsyslog_internal(int pri, const char *fmt, va_list ap,
/* Close the memory stream; this will finalize the data
into a malloc'd buffer in BUF. */
fclose (f);
+
+ /* Tell the cancellation handler to free this buffer. */
+ clarg.buf = buf;
}
/* Output to stderr if requested. */
@@ -252,22 +269,10 @@
__vsyslog_internal(int pri, const char *fmt, va_list ap,
v->iov_len = 1;
}
- __libc_cleanup_push (free, buf == failbuf ? NULL : buf);
-
/* writev is a cancellation point. */
(void)__writev(STDERR_FILENO, iov, v - iov + 1);
-
- __libc_cleanup_pop (0);
}
- /* Prepare for multiple users. We have to take care: open and
- write are cancellation points. */
- struct cleanup_arg clarg;
- clarg.buf = buf;
- clarg.oldaction = NULL;
- __libc_cleanup_push (cancel_handler, &clarg);
- __libc_lock_lock (syslog_lock);
-
#ifndef NO_SIGPIPE
/* Prepare for a broken connection. */
memset (&action, 0, sizeof (action));
@@ -320,6 +325,7 @@
__vsyslog_internal(int pri, const char *fmt, va_list ap,
__sigaction (SIGPIPE, &oldaction, (struct sigaction *) NULL);
#endif
+ out:
/* End of critical section. */
__libc_cleanup_pop (0);
__libc_lock_unlock (syslog_lock);
@@ -430,8 +436,14 @@
setlogmask (int pmask)
{
int omask;
+ /* Protect against multiple users. */
+ __libc_lock_lock (syslog_lock);
+
omask = LogMask;
if (pmask != 0)
LogMask = pmask;
+
+ __libc_lock_unlock (syslog_lock);
+
return (omask);
}
This diff is collapsed.
Click to expand it.
SPECS/glibc.spec
+
5
−
1
View file @
c33d8b41
...
...
@@ -115,7 +115,7 @@ end \
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: %{glibcrelease}.1
3
Release: %{glibcrelease}.1
4
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries.
...
...
@@ -1258,6 +1258,7 @@ Patch1023: glibc-RHEL-8381-7.patch
Patch1024: glibc-RHEL-8381-8.patch
Patch1025: glibc-RHEL-8381-9.patch
Patch1026: glibc-RHEL-8381-10.patch
Patch1027: glibc-RHEL-78390.patch
##############################################################################
# Continued list of core "glibc" package information:
...
...
@@ -2919,6 +2920,9 @@ fi
%{_libdir}/libpthread_nonshared.a
%changelog
* Tue Feb 11 2025 Patsy Griffin <patsy@redhat.com> - 2.28-251.14
- Correct locking and cancellation cleanup in syslog functions (RHEL-78390)
* Fri Feb 7 2025 Carlos O'Donell <carlos@redhat.com> - 2.28-251.13
- Restore internal ABI to avoid tooling false positives (RHEL-8381)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment