From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 823CEC4320A for ; Sun, 22 Aug 2021 14:45:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0AB2A61246 for ; Sun, 22 Aug 2021 14:45:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0AB2A61246 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5AE178D0001; Sun, 22 Aug 2021 10:45:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 55E9B6B0074; Sun, 22 Aug 2021 10:45:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 473F88D0001; Sun, 22 Aug 2021 10:45:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 30B7B6B0073 for ; Sun, 22 Aug 2021 10:45:38 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7ACF88248D52 for ; Sun, 22 Aug 2021 14:45:37 +0000 (UTC) X-FDA: 78502990314.14.247D1C5 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf11.hostedemail.com (Postfix) with ESMTP id 28075F0000AE for ; Sun, 22 Aug 2021 14:45:37 +0000 (UTC) Received: from zn.tnic (p200300ec2f2da100ab464a00f653617a.dip0.t-ipconnect.de [IPv6:2003:ec:2f2d:a100:ab46:4a00:f653:617a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D7CB61EC04F0; Sun, 22 Aug 2021 16:45:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1629643532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=+ko0iIV7PBJ60c1KDZgQc1ufJ27j1ul9I7AoqKxARiY=; b=NlPon99KIYT7hKfsgPyRomyJ5Jo8Eibb/z9KFjEyvd88ofgMAPic9jcT48uoK+KXnxUXdW zw5+kpv/epGmlnmJQjtsCnh8zcuG3uHoac2gzdRN+t3Ews4sCCwu6BxWHPtIQ1t5qTBRBf FD+PMv6vk5Mu2tbZWh5K4p0kl+kAlp0= Date: Sun, 22 Aug 2021 16:46:14 +0200 From: Borislav Petkov To: "Luck, Tony" Cc: Jue Wang , Ding Hui , naoya.horiguchi@nec.com, osalvador@suse.de, Youquan Song , huangcun@sangfor.com.cn, x86@kernel.org, linux-edac@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] x86/mce: Avoid infinite loop for copy from user recovery Message-ID: References: <20210706190620.1290391-1-tony.luck@intel.com> <20210818002942.1607544-1-tony.luck@intel.com> <20210818002942.1607544-2-tony.luck@intel.com> <20210820185945.GA1623421@agluck-desk2.amr.corp.intel.com> <20210820203356.GA1623896@agluck-desk2.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210820203356.GA1623896@agluck-desk2.amr.corp.intel.com> Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=NlPon99K; spf=pass (imf11.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de; dmarc=pass (policy=none) header.from=alien8.de X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 28075F0000AE X-Stat-Signature: im5zuafxmp9qkre3qriwfoeauhibrf7p X-HE-Tag: 1629643537-273019 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000431, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Aug 20, 2021 at 01:33:56PM -0700, Luck, Tony wrote: > The new version (thanks to All fixing iov_iter.c) now does > exactly what POSIX says should happen. If I have a buffer > with poison at offset 213, and I do this: > > ret = write(fd, buf, 512); > > Then the return from write is 213, and the first 213 bytes > from the buffer appear in the file, and the file size is > incremented by 213 (assuming the write started with the lseek > offset at the original size of the file). ... and the user still gets a SIGBUS so that it gets a chance to handle the encountered poison? I.e., not retry the write for the remaining 512 - 213 bytes? If so, do we document that somewhere so that application writers can know what they should do in such cases? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette