git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/8] Some object db protection when add_submodule_odb is used

From
Thomas Rast <trast@inf.ethz.ch>
Date
Apr 30, 2013, 08:43 UTC
Message-ID
<87ehdsxvbt.fsf@linux-k42r.v.cablecom.net>
In-Reply-To
<1367293372-1958-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 22 quoted lines
> The idea behind this series is, after add_submodule_odb, odb may have
> new temporary objects that only appear after the call. These temporary
> objects may lead to repo corruption (e.g. some new objects are created
> and point to these temporary objects). This series attempts to catch
> those cases. It would make it safer to dig deeper into submodule's odb,
> e.g. to implement unified git-diff.
>
> Previous approach [1] is record the odb source, then check if the
> source is from submodule's odb. But that means we rely on the
> lookup order in sha1_file.c. This approach instead allows the caller
> to select what odb sources it wants to look up from.
>
> The checks are also less drastic than before. Checks are now done at
> higher level, e.g. commit_tree(), instead of at write_sha1_file,
> because we do allow to write objects that point to nowhere.
>
> Another new thing from previous round is I completely forbid the use
> of add_submodule_odb in security sensitive commands like index-pack or
> rev-list. We could loosen up later if we need to.
>
> For fun, I set object_database_contaminated to 1 by default and ran
> the test suite. It passed :)

How does this interact with alternates set up by the user? It's not immediately obvious from the commit messages (hint hint) or the comments near ODB_LOCAL etc.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 13 of 14 in “Some object db protection when add_submodule_odb is used”
  1. 0/8 Some object db protection when add_submodule_odb is usedNguyễn Thái Ngọc Duy, Apr 30, 2013
  2. 1/8 sha1_file: allow to select pack origin when looking up an objectNguyễn Thái Ngọc Duy, Apr 30, 2013
  3. Eric SunshineApr 30, 2013
  4. 2/8 sha1_file: keep track of alternate source of objectsNguyễn Thái Ngọc Duy, Apr 30, 2013
  5. 3/8 sha1_file: mark alt object database from add_submodule_odb()Nguyễn Thái Ngọc Duy, Apr 30, 2013
  6. Eric SunshineApr 30, 2013
  7. 4/8 sha1_file: new object source for submodule's alt object databaseNguyễn Thái Ngọc Duy, Apr 30, 2013
  8. Eric SunshineApr 30, 2013
  9. 5/8 commit.c: refuse to write commits referring to external objectsNguyễn Thái Ngọc Duy, Apr 30, 2013
  10. 6/8 cache-tree.c: refuse to write trees referring to external objectsNguyễn Thái Ngọc Duy, Apr 30, 2013
  11. 7/8 mktag: refuse to write tags referring to external objectsNguyễn Thái Ngọc Duy, Apr 30, 2013
  12. 8/8 sha1_file: do write objects even if found in ODB_EXTALT databaseNguyễn Thái Ngọc Duy, Apr 30, 2013
  13. Thomas RastApr 30, 2013
  14. Duy NguyenApr 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.