Skip to content

nss-systemd: fix required buffer size calculation#21938

Merged
yuwata merged 1 commit intosystemd:mainfrom
yuwata:nss-systemd-gr-mem
Dec 30, 2021
Merged

nss-systemd: fix required buffer size calculation#21938
yuwata merged 1 commit intosystemd:mainfrom
yuwata:nss-systemd-gr-mem

Conversation

@yuwata
Copy link
Copy Markdown
Member

@yuwata yuwata commented Dec 30, 2021

This also fixes the pointer assigned to the gr_mem element of struct group.

Fixes a bug introduced by 47fd7fa.

Fixes #21935.

This also fixes the pointer assigned to the gr_mem element of struct group.

Fixes a bug introduced by 47fd7fa.

Fixes systemd#21935.
@yuwata yuwata added the nss label Dec 30, 2021
@yuwata
Copy link
Copy Markdown
Member Author

yuwata commented Dec 30, 2021

This needs to be backported to v250-stable, v249-stable, and v248-stable.

@Arfrever
Copy link
Copy Markdown

Problematic commit was also backported to branch v248-stable.

dest->gr_name = buffer;
dest->gr_passwd = stpcpy(dest->gr_name, src->gr_name) + 1;
dest->gr_mem = (char **) strcpy(dest->gr_passwd, src->gr_passwd) + 1;
dest->gr_mem = (char **) stpcpy(dest->gr_passwd, src->gr_passwd) + 1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

uh, how did this ever work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I guess this did not work. We do not have enough tests for nss modules...

@bluca bluca added the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Dec 30, 2021
@yuwata
Copy link
Copy Markdown
Member Author

yuwata commented Dec 30, 2021

Problematic commit was also backported to branch v248-stable.

Oh. Thanks.

@yuwata yuwata merged commit 1e65eb8 into systemd:main Dec 30, 2021
@yuwata yuwata deleted the nss-systemd-gr-mem branch December 30, 2021 18:12
@keszybz keszybz removed good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed needs-stable-backport labels Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

SIGBUS on SPARC caused by NSS lookups

5 participants