CVE-2015-7510.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From cb31827d62066a04b02111df3052949fda4b6888 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
  3. Date: Mon, 23 Nov 2015 13:59:43 -0500
  4. Subject: [PATCH] nss-mymachines: do not allow overlong machine names
  5. https://github.com/systemd/systemd/issues/2002
  6. ---
  7. src/nss-mymachines/nss-mymachines.c | 6 ++++++
  8. 1 file changed, 6 insertions(+)
  9. diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c
  10. index 969fa96..c98a959 100644
  11. --- a/src/nss-mymachines/nss-mymachines.c
  12. +++ b/src/nss-mymachines/nss-mymachines.c
  13. @@ -416,6 +416,9 @@ enum nss_status _nss_mymachines_getpwnam_r(
  14. if (!e || e == p)
  15. goto not_found;
  16. + if (e - p > HOST_NAME_MAX - 1) /* -1 for the last dash */
  17. + goto not_found;
  18. +
  19. r = parse_uid(e + 1, &uid);
  20. if (r < 0)
  21. goto not_found;
  22. @@ -573,6 +576,9 @@ enum nss_status _nss_mymachines_getgrnam_r(
  23. if (!e || e == p)
  24. goto not_found;
  25. + if (e - p > HOST_NAME_MAX - 1) /* -1 for the last dash */
  26. + goto not_found;
  27. +
  28. r = parse_gid(e + 1, &gid);
  29. if (r < 0)
  30. goto not_found;
  31. --
  32. 2.6.3