bug-coreutils@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: George Valkov <gvalkov@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 61386@debbugs.gnu.org, "Pádraig Brady" <P@draigBrady.com>
Subject: bug#61386: [PATCH] cp,mv,install: Disable sparse copy on macOS
Date: Wed, 15 Feb 2023 17:26:21 +0200	[thread overview]
Message-ID: <EC5AAB70-963A-44DA-ADDA-545D0DDE4753@gmail.com> (raw)
In-Reply-To: <acc021fa-5983-2026-63fd-94073902b756@cs.ucla.edu>


> On 2023-02-15, at 12:56 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
> 
> The disabling SEEK_HOLE on Apple is OK if a release is imminent. Otherwise I'd like to get to the bottom of it first. This can be done by having George use dtrace or (if that's not possible) adding debugging printfs.

Hi Paul! Sure, send me some code, describe the tests you need and I will come back with the results. Since we are tracing regular programs and not system components, dtruss can be used. Here is a trace of the sparse copy sample I wrote earlier, when it tries to copy cc1 to cc1-sparse, resulting in a corrupted copy:
https://httpstorm.com/share/.openwrt/test/2023-02-06_coreutils-9.1/dtruss-sparse-copy.txt


> Attached is an updated proposal for the fclonefileat patch.
> 
> CVE-2021-30995 confirmed my suspicion that coreutils 9.1 and the current bleeding-edge coreutils on Savannah both have an exploitable security bug on macOS. Although I hope this patch fixes the bug, it could use more pairs of eyes, given that Apple had so many problems fixing its own security bug involving fclonefileat, and given that the coreutils code has so many flags and conditions.
> <0001-cp-fclonefileat-security-fix-CLONE_ACL-fixups.patch>

I tested your patch: both overwrite existing and clone to new produce a working copy. Here are the test results:
https://httpstorm.com/share/.openwrt/test/2023-02-06_coreutils-9.1/test-04-cf80f988eeb97cc3f8c65ae58e735d36f865277b-clone.txt

In the case when a dangling symlink is involved and depending on the arguments passed to cp, would it be possible to use CLONE_NOFOLLOW with fclonefileat or fall-back to a normal copy? Does dangling refer to source or destination?


Georgi Valkov
httpstorm.com
nano RTOS





  reply	other threads:[~2023-02-15 15:27 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09  9:20 bug#61386: [PATCH] cp,mv,install: Disable sparse copy on macOS George Valkov
2023-02-09 11:56 ` Pádraig Brady
     [not found]   ` <21A1241D-B890-4796-926F-E8712E2A807B@gmail.com>
2023-02-09 16:32     ` Pádraig Brady
2023-02-09 17:23       ` George Valkov
2023-02-09 21:35         ` Pádraig Brady
2023-02-10  1:03           ` George Valkov
2023-02-10  9:14             ` Pádraig Brady
2023-02-10  3:57 ` Paul Eggert
2023-02-10  9:18   ` Pádraig Brady
2023-02-10 12:13     ` George Valkov
2023-02-10 14:02       ` Pádraig Brady
2023-02-10 17:24         ` George Valkov
2023-02-10 18:58           ` Pádraig Brady
2023-02-10 20:06             ` George Valkov
2023-02-10 20:45             ` Paul Eggert
2023-02-10 21:35               ` George Valkov
2023-02-10 21:50                 ` Paul Eggert
2023-02-10 22:02                   ` Pádraig Brady
2023-02-11  1:27                     ` George Valkov
2023-02-11 18:19                       ` Paul Eggert
2023-02-11 20:39                         ` George Valkov
2023-02-11  1:21                   ` George Valkov
2023-02-11 21:53                     ` Paul Eggert
2023-02-12  0:38                       ` George Valkov
2023-02-12  0:47                         ` Paul Eggert
2023-02-12  2:18                           ` George Valkov
2023-02-12 14:15                       ` Pádraig Brady
2023-02-12 20:36                         ` Pádraig Brady
2023-02-12 23:37                           ` George Valkov
2023-02-13 14:15                             ` Pádraig Brady
2023-02-13 14:05                           ` Pádraig Brady
2023-02-13 17:16                             ` George Valkov
2023-02-13 17:21                               ` George Valkov
2023-02-13 18:04                               ` Pádraig Brady
2023-02-14  6:12                               ` Paul Eggert
2023-02-14  7:04                                 ` George Valkov
2023-02-14 12:12                                 ` Pádraig Brady
2023-02-14 19:02                                   ` Paul Eggert
2023-02-15  9:43                                     ` Pádraig Brady
2023-02-15 10:56                                       ` Paul Eggert
2023-02-15 15:26                                         ` George Valkov [this message]
2023-02-15 19:48                                           ` Paul Eggert
2023-02-15 22:53                                             ` George Valkov
2023-02-16 21:32                                         ` Pádraig Brady
2023-02-16 23:41                                           ` Paul Eggert
2023-02-15 14:05                                   ` George Valkov
2023-02-15 19:26                                     ` Paul Eggert
2023-02-15 22:40                                       ` George Valkov
2023-02-16 19:41                                         ` George Valkov
2023-02-19  6:08                                           ` Paul Eggert
2023-02-19 16:31                                             ` Pádraig Brady
2023-02-20 10:21                                             ` George Valkov
2023-02-20 15:02                                             ` George Valkov
2023-02-20 17:49                                               ` Pádraig Brady
2023-02-20 19:35                                                 ` George Valkov
2023-02-20 21:14                                                   ` Pádraig Brady
2023-02-20 21:25                                                     ` George Valkov
2023-02-22 13:59                                                       ` George Valkov
2023-02-23 22:23                                                     ` Paul Eggert
2023-02-24  0:51                                                       ` Pádraig Brady
2023-02-24 14:33                                                       ` George Valkov
2023-02-24 15:43                                                         ` Pádraig Brady
2023-02-24 19:34                                                           ` George Valkov
2023-02-24 22:06                                                           ` George Valkov
2023-02-24 22:47                                                             ` Pádraig Brady
2023-02-24 23:23                                                               ` George Valkov
2023-02-25 12:27                                                                 ` Pádraig Brady
2023-03-06  7:37                                                                   ` Paul Eggert
2023-03-06 11:13                                                                     ` Pádraig Brady
2023-03-06 23:48                                                                       ` Paul Eggert
2023-03-07  0:31                                                                         ` Pádraig Brady
2023-03-07 21:53                                                                           ` Paul Eggert
2023-03-07 23:16                                                                             ` Pádraig Brady
2023-03-11  7:29                                                                             ` George Valkov
2023-03-11 14:28                                                                               ` Pádraig Brady
2023-03-21 11:55                                                                                 ` George Valkov
2023-03-21 14:49                                                                                   ` Paul Eggert
2023-03-21 15:27                                                                                     ` George Valkov
2023-03-21 17:32                                                                                       ` Paul Eggert
2023-03-21 18:08                                                                                         ` George Valkov
2023-03-21 18:21                                                                                           ` Pádraig Brady
2023-03-21 18:48                                                                                             ` George Valkov
2023-03-06 21:49                                                                     ` George Valkov
2023-02-10 21:46               ` Pádraig Brady
2023-02-10 22:42                 ` Paul Eggert
2023-02-10 23:48                 ` George Valkov
2023-02-11  0:48                   ` Paul Eggert
2023-02-11  1:48                     ` George Valkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EC5AAB70-963A-44DA-ADDA-545D0DDE4753@gmail.com \
    --to=gvalkov@gmail.com \
    --cc=61386@debbugs.gnu.org \
    --cc=P@draigBrady.com \
    --cc=eggert@cs.ucla.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).