diff --git a/GHC/Unit/Database.hs b/GHC/Unit/Database.hs
--- a/GHC/Unit/Database.hs
+++ b/GHC/Unit/Database.hs
@@ -87,6 +87,10 @@
 import Control.Exception as Exception
 import Control.Monad (when)
 import System.FilePath as FilePath
+#if !defined(mingw32_HOST_OS)
+import System.Posix.Files
+import GHC.IO.Exception (ioe_type, IOErrorType(NoSuchThing))
+#endif
 import System.IO
 import System.IO.Error
 import GHC.IO.Exception (IOErrorType(InappropriateType))
@@ -503,6 +507,26 @@
 -- Copied from Cabal's Distribution.Simple.Utils.
 writeFileAtomic :: FilePath -> BS.Lazy.ByteString -> IO ()
 writeFileAtomic targetPath content = do
+  -- Figure out how to update the file mode after we create the temporary file
+  let no_update _path = return ()
+#if !defined(mingw32_HOST_OS)
+  let on_error ioe =
+          -- If the file doesn't yet exist then just use the default owner and
+          -- mode.
+          case ioe_type ioe of
+            NoSuchThing -> return no_update
+            _ -> ioError ioe
+  let handleIO :: (IOException -> IO a) -> IO a -> IO a
+      handleIO = flip catch
+  set_metadata <- handleIO on_error $ do
+      status <- getFileStatus targetPath
+      return $ \path -> do
+        setFileMode path (fileMode status)
+        setOwnerAndGroup path (fileOwner status) (fileGroup status)
+#else
+  let set_metadata = no_update
+#endif
+
   let (targetDir, targetFile) = splitFileName targetPath
   Exception.bracketOnError
     (openBinaryTempFileWithDefaultPermissions targetDir $ targetFile <.> "tmp")
@@ -510,6 +534,7 @@
     (\(tmpPath, handle) -> do
         BS.Lazy.hPut handle content
         hClose handle
+        set_metadata tmpPath
         renameFile tmpPath targetPath)
 
 instance Binary DbUnitInfo where
diff --git a/GHC/Version.hs b/GHC/Version.hs
--- a/GHC/Version.hs
+++ b/GHC/Version.hs
@@ -3,19 +3,19 @@
 import Prelude -- See Note [Why do we import Prelude here?]
 
 cProjectGitCommitId   :: String
-cProjectGitCommitId   = "82e6bf12786908ccda643dd1dceb42abcc97290c"
+cProjectGitCommitId   = "fbaee70d380973f71fa6e9e15be746532e5a4fc5"
 
 cProjectVersion       :: String
-cProjectVersion       = "9.2.1"
+cProjectVersion       = "9.2.2"
 
 cProjectVersionInt    :: String
 cProjectVersionInt    = "902"
 
 cProjectPatchLevel    :: String
-cProjectPatchLevel    = "1"
+cProjectPatchLevel    = "2"
 
 cProjectPatchLevel1   :: String
-cProjectPatchLevel1   = "1"
+cProjectPatchLevel1   = "2"
 
 cProjectPatchLevel2   :: String
 cProjectPatchLevel2   = ""
diff --git a/ghc-boot.cabal b/ghc-boot.cabal
--- a/ghc-boot.cabal
+++ b/ghc-boot.cabal
@@ -5,7 +5,7 @@
 -- ghc-boot.cabal.
 
 name:           ghc-boot
-version:        9.2.1
+version:        9.2.2
 license:        BSD-3-Clause
 license-file:   LICENSE
 category:       GHC
@@ -73,4 +73,7 @@
                    directory  >= 1.2 && < 1.4,
                    filepath   >= 1.3 && < 1.5,
                    deepseq    >= 1.4 && < 1.5,
-                   ghc-boot-th == 9.2.1
+                   ghc-boot-th == 9.2.2
+    if !os(windows)
+        build-depends:
+                   unix       >= 2.7 && < 2.8
