Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#2211358) Fix memory corruption #396

Merged

Conversation

dtardon
Copy link
Member

@dtardon dtardon commented Jun 7, 2023

Resolves: #2211358

@mergify mergify bot added the pr/needs-ci Formerly needs-ci label Jun 7, 2023
@github-actions
Copy link

github-actions bot commented Jun 7, 2023

Tracker - 2211358

The following commits meet all requirements

commit upstream
a01ef6c - sd-event: remove dead code and use cleanup systemd/systemd@8c75fe1
systemd/systemd-stable@8c75fe1
b0ad8db - sd-event: don't destroy inotify data structures from inotify event han… systemd/systemd@53baf2e
systemd/systemd-stable@53baf2e
c199aeb - sd-event: add sd_event_add_inotify_fd() call systemd/systemd@e67d738
systemd/systemd-stable@e67d738
486d3e0 - test: add test case for self-destroy inotify handler systemd/systemd@035daf7
systemd/systemd-stable@035daf7

@systemd-rhel-bot systemd-rhel-bot added the pr/needs-review Formerly needs-review label Jun 7, 2023
@systemd-rhel-bot systemd-rhel-bot changed the title Fix memory corruption (#2211358) Fix memory corruption Jun 7, 2023
@systemd-rhel-bot systemd-rhel-bot added the tracker/unapproved Formerly needs-acks label Jun 7, 2023
@mergify mergify bot removed the pr/needs-ci Formerly needs-ci label Jun 7, 2023
Copy link
Member

@msekletar msekletar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This backport needs to be reworked. Concretely, introduction of new header file event-source.h is fine but it needs to be paired with appropriate removals of type definitions from sd-event.c. Now we have everything declared twice which is wrong.

@systemd-rhel-bot systemd-rhel-bot removed the pr/needs-review Formerly needs-review label Jun 14, 2023
CID #1393250.

(cherry picked from commit 8c75fe1)

Related: #2211358
@dtardon
Copy link
Member Author

dtardon commented Jun 15, 2023

This backport needs to be reworked. Concretely, introduction of new header file event-source.h is fine

Oops, that's a mistake. Apparently I've forgotten to remove it after I'd copied the needed stuff to sd-event.c.

…ndler

This fixes a bad memory access when we destroy an inotify source handler
from the handler itself, and thus destroy the associated inotify_data
structures.

Fixes: #20177
(cherry picked from commit 53baf2e)

Resolves: #2211358
sd_event_add_inotify_fd() is like sd_event_add_inotify(), but takes an
fd to an inode instead of a path, and is hence a ton nicer.

(cherry picked from commit e67d738)

Related: #2211358
(cherry picked from commit 035daf7)

Related: #2211358
@dtardon dtardon requested a review from msekletar June 15, 2023 13:52
@mergify mergify bot added pr/needs-ci Formerly needs-ci and removed pr/needs-ci Formerly needs-ci labels Jun 15, 2023
@systemd-rhel-bot systemd-rhel-bot removed the tracker/unapproved Formerly needs-acks label Jul 13, 2023
Copy link
Member

@msekletar msekletar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@systemd-rhel-bot systemd-rhel-bot merged commit 2fcb710 into redhat-plumbers:main Aug 4, 2023
10 checks passed
@dtardon dtardon deleted the bz2211358-sd-event-assert branch August 7, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants