<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch v2.36.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.36.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.36.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-06-23T10:36:12Z</updated>
<entry>
<title>Sync with 2.35.4</title>
<updated>2022-06-23T10:36:12Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:36:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8f8eea8c3aba154ce1f9eaab4fa06c73b60550dc'/>
<id>urn:sha1:8f8eea8c3aba154ce1f9eaab4fa06c73b60550dc</id>
<content type='text'>
* maint-2.35:
  Git 2.35.4
  Git 2.34.4
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>Sync with 2.34.4</title>
<updated>2022-06-23T10:36:03Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:36:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aef3d5948c5b00a0409e117da7e720f574040505'/>
<id>urn:sha1:aef3d5948c5b00a0409e117da7e720f574040505</id>
<content type='text'>
* maint-2.34:
  Git 2.34.4
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>Sync with 2.32.3</title>
<updated>2022-06-23T10:35:38Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:35:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eebfde3f213e2990727a64da0d7d04ad961a28b0'/>
<id>urn:sha1:eebfde3f213e2990727a64da0d7d04ad961a28b0</id>
<content type='text'>
* maint-2.32:
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>Sync with 2.31.4</title>
<updated>2022-06-23T10:35:30Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:35:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc0c773028685cdbae35c6c71f3fd3b87ab70985'/>
<id>urn:sha1:fc0c773028685cdbae35c6c71f3fd3b87ab70985</id>
<content type='text'>
* maint-2.31:
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>setup: tighten ownership checks post CVE-2022-24765</title>
<updated>2022-06-23T10:31:05Z</updated>
<author>
<name>Carlo Marcelo Arenas Belón</name>
<email>carenas@gmail.com</email>
</author>
<published>2022-05-10T19:35:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b0bf2704980b1ed6018622bdf5377ec22289688'/>
<id>urn:sha1:3b0bf2704980b1ed6018622bdf5377ec22289688</id>
<content type='text'>
8959555cee7 (setup_git_directory(): add an owner check for the top-level
directory, 2022-03-02), adds a function to check for ownership of
repositories using a directory that is representative of it, and ways to
add exempt a specific repository from said check if needed, but that
check didn't account for owership of the gitdir, or (when used) the
gitfile that points to that gitdir.

An attacker could create a git repository in a directory that they can
write into but that is owned by the victim to work around the fix that
was introduced with CVE-2022-24765 to potentially run code as the
victim.

An example that could result in privilege escalation to root in *NIX would
be to set a repository in a shared tmp directory by doing (for example):

  $ git -C /tmp init

To avoid that, extend the ensure_valid_ownership function to be able to
check for all three paths.

This will have the side effect of tripling the number of stat() calls
when a repository is detected, but the effect is expected to be likely
minimal, as it is done only once during the directory walk in which Git
looks for a repository.

Additionally make sure to resolve the gitfile (if one was used) to find
the relevant gitdir for checking.

While at it change the message printed on failure so it is clear we are
referring to the repository by its worktree (or gitdir if it is bare) and
not to a specific directory.

Helped-by: Junio C Hamano &lt;junio@pobox.com&gt;
Helped-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Carlo Marcelo Arenas Belón &lt;carenas@gmail.com&gt;
</content>
</entry>
<entry>
<title>Sync with Git 2.35.3</title>
<updated>2022-04-13T22:26:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-13T22:26:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ac7422e39b0043250b026f9988d0da24cb2cb58'/>
<id>urn:sha1:1ac7422e39b0043250b026f9988d0da24cb2cb58</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Git 2.35.3</title>
<updated>2022-04-13T22:21:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-13T22:21:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d516b2db0af2221bd6b13e7347abdcb5830b2829'/>
<id>urn:sha1:d516b2db0af2221bd6b13e7347abdcb5830b2829</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Git 2.33.3</title>
<updated>2022-04-13T22:21:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-13T22:21:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1f65dd6ae635f77c588ac432cad1a299723d00d6'/>
<id>urn:sha1:1f65dd6ae635f77c588ac432cad1a299723d00d6</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Git 2.32.2</title>
<updated>2022-04-13T22:21:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-13T22:21:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=15304344342b7c888f732d28f908890d874bcb0c'/>
<id>urn:sha1:15304344342b7c888f732d28f908890d874bcb0c</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: opt-out of check with safe.directory=*</title>
<updated>2022-04-13T19:42:51Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-04-13T15:32:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f85c4a30b072a26d74af8bbf63cc8f6a5dfc1b8'/>
<id>urn:sha1:0f85c4a30b072a26d74af8bbf63cc8f6a5dfc1b8</id>
<content type='text'>
With the addition of the safe.directory in 8959555ce
(setup_git_directory(): add an owner check for the top-level directory,
2022-03-02) released in v2.35.2, we are receiving feedback from a
variety of users about the feature.

Some users have a very large list of shared repositories and find it
cumbersome to add this config for every one of them.

In a more difficult case, certain workflows involve running Git commands
within containers. The container boundary prevents any global or system
config from communicating `safe.directory` values from the host into the
container. Further, the container almost always runs as a different user
than the owner of the directory in the host.

To simplify the reactions necessary for these users, extend the
definition of the safe.directory config value to include a possible '*'
value. This value implies that all directories are safe, providing a
single setting to opt-out of this protection.

Note that an empty assignment of safe.directory clears all previous
values, and this is already the case with the "if (!value || !*value)"
condition.

Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
