Debian Bug report logs - #896879
[chroot] postfix: race condition on cp in /etc/network/if-*.d/postfix scripts

version graph

Package: postfix; Maintainer for postfix is Debian Postfix Team <[email protected]>; Source for postfix is src:postfix (PTS, buildd, popcon).

Reported by: Vincent Lefevre <[email protected]>

Date: Wed, 25 Apr 2018 09:24:01 UTC

Severity: normal

Tags: moreinfo

Found in version postfix/3.3.0-1

Full log


Message #42 received at [email protected] (full text, mbox, reply):

Received: (at 896879) by bugs.debian.org; 5 Dec 2024 01:03:16 +0000
From [email protected] Thu Dec 05 01:03:16 2024
X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
	(2021-04-09) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-12.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER,
	RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham
	autolearn_force=no version=3.4.6-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 10; hammy, 149; neutral, 80; spammy,
	1. spammytokens:0.932-+--today hammytokens:0.000-+--networkmanager,
	0.000-+--network-manager, 0.000-+--H*F:U*mjt,
	0.000-+--H*F:D*tls.msk.ru, 0.000-+--H*RU:isrv.corpit.ru
Return-path: <[email protected]>
Received: from isrv.corpit.ru ([86.62.121.231]:59513)
	by buxtehude.debian.org with esmtps (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
	(Exim 4.94.2)
	(envelope-from <[email protected]>)
	id 1tJ0Gx-00CzqD-Oy
	for [email protected]; Thu, 05 Dec 2024 01:03:16 +0000
Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2])
	by isrv.corpit.ru (Postfix) with ESMTP id 4CF94BEAFD;
	Thu,  5 Dec 2024 04:03:08 +0300 (MSK)
Received: from [192.168.177.130] (mjt.wg.tls.msk.ru [192.168.177.130])
	by tsrv.corpit.ru (Postfix) with ESMTP id 0587A182513;
	Thu,  5 Dec 2024 04:03:13 +0300 (MSK)
Message-ID: <[email protected]>
Date: Thu, 5 Dec 2024 04:03:12 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Bug#896879: postfix: race condition on cp in
 /etc/network/if-*.d/postfix scripts
To: Vincent Lefevre <[email protected]>, [email protected]
References: <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
Content-Language: en-US, ru-RU
From: Michael Tokarev <[email protected]>
Autocrypt: [email protected]; keydata=
 xsFNBGYpLkcBEACsajkUXU2lngbm6RyZuCljo19q/XjZTMikctzMoJnBGVSmFV66kylUghxs
 HDQQF2YZJbnhSVt/mP6+V7gG6MKR5gYXYxLmypgu2lJdqelrtGf1XtMrobG6kuKFiD8OqV6l
 2M5iyOZT3ydIFOUX0WB/B9Lz9WcQ6zYO9Ohm92tiWWORCqhAnwZy4ua/nMZW3RgO7bM6GZKt
 /SFIorK9rVqzv40D6KNnSyeWfqf4WN3EvEOozMfWrXbEqA7kvd6ShjJoe1FzCEQ71Fj9dQHL
 DZG+44QXvN650DqEtQ4RW9ozFk3Du9u8lbrXC5cqaCIO4dx4E3zxIddqf6xFfu4Oa5cotCM6
 /4dgxDoF9udvmC36qYta+zuDsnAXrYSrut5RBb0moez/AR8HD/cs/dS360CLMrl67dpmA+XD
 7KKF+6g0RH46CD4cbj9c2egfoBOc+N5XYyr+6ejzeZNf40yjMZ9SFLrcWp4yQ7cpLsSz08lk
 a0RBKTpNWJdblviPQaLW5gair3tyJR+J1ER1UWRmKErm+Uq0VgLDBDQoFd9eqfJjCwuWZECp
 z2JUO+zBuGoKDzrDIZH2ErdcPx3oSlVC2VYOk6H4cH1CWr9Ri8i91ClivRAyVTbs67ha295B
 y4XnxIVaZU+jJzNgLvrXrkI1fTg4FJSQfN4W5BLCxT4sq8BDtwARAQABzSBNaWNoYWVsIFRv
 a2FyZXYgPG1qdEB0bHMubXNrLnJ1PsLBl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wUPocDu6N10LtBNbwHWTT5NLtxNJAJAvl
 ojis6H1kRWZE/n5buyPY2NYeyWfjjrerOYt3er55n4C1I88RSCTGeejVmXWuo65QD2epvzE6
 3GgKngeVm7shlp7+d3D3+fAAHTvulQQqV3jOodz+B4yzuZ7WljkNrmrWrH8aI4uA98c=
In-Reply-To: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
05.12.2024 02:05, Vincent Lefevre wrote:

> OK, but I'm still a bit uncomfortable with the fact that the
> implementation of cp is not specified (at least some missing
> guarantee that several cp's of the same file to the same target
> is OK). In the past, I had bad surprised with concurrent writes,
> but this could have been more complex cases (in my archives I can
> only find an issue with the zsh history, but truncate operations
> were also involved).

it's definitely a more complex case. There's no way you can get
different result by running multiple `cp a b` in parallel, -
they will be writing the same data to the same places, with the
end result being the same.

> BTW, I'm wondering whether when a second interface is brought up,
> /etc/resolv.conf could be modified, which would also be a problem.
That could happen to, in some theory.  It's now a question how
resolv.conf itself is updated - here, it is much more important
to guard against multiple updates from DIFFERENT destinations.
So if things are running in parallel there, there's a much more
serious bug somewhere.

Anyway.

Today, with big shift from /etc/network/interfaces towards
systemd-networkd or network-manager, so parallel execution
of things managed by if-up.d/ et al becomes significantly
less probable, I'm not going to spend more time on this.

Also, a good advise here is to not run postfix chrooted to
begin with, as upstream pleaded for decades.

So I don't really see a point anymore.

Thanks,

/mjt



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 17:49:15 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.