In the `extract()` function of the Tarfile module, the `filter` parameter is not correctly handled when extracting hardlinks. This issue allows a system extracting content from untrusted tar files to write files with an unexpected uid/gid, even when the user has specified `filter='data'` to restrict the extraction process.