Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1161648pxb; Sun, 22 Aug 2021 07:47:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFphRC+FBEHlreQCU1b4Gnb+iFRGvSKjYcG6PK4gVuqkvNEYJf/W8iSENcq3qzOCAp5Myl X-Received: by 2002:a05:6638:275:: with SMTP id x21mr695198jaq.111.1629643666590; Sun, 22 Aug 2021 07:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629643666; cv=none; d=google.com; s=arc-20160816; b=L1c5t81nIJR9+iWjMXnwNoq5H3Y02f9cK079VuHAArypo+nTEvZV4YYiw3YvV2XACg TvB5Dee+ofIc/YY6f7PDdtY9KLXDNh+90YbQIOgOuvzAALLsFLhADrOAnJdqVqhe6mDm x5V/xaye+73W9MbWg/q2Hd2Z1S8CofKOffU0j3uotdP+/zqudN7dVaBSb1Nh3yW8717K e0SFMSg3ZTeSDIYBiu7SZfLnQcn25xQgqIdzYT3LadNt5ALO9oT91Rif2JrITaoKNTrt 8MnG8ElqFUI1rjsWTGZok+Cj3VHCY32pEoq7ExomznN8ovxaFn4pFhJ7SdskfKO9s/6L taUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+ko0iIV7PBJ60c1KDZgQc1ufJ27j1ul9I7AoqKxARiY=; b=K7Q5TD17EgroZGS6s+kk2UsO5H5m0wuMNsuHKFKYPMSyeEMnvGrqVYXn8A1n1wltSV 3tP50h2VHLwLT4qeeTgi5rJ458Ao4o2IxyT9YrP0L/4yXGZprxtSZQJV0UTpYO+YomZm FG+Qj2JquddmvJQvH5d6e7e9HIdjgk4iQ73CXmCQZmUq2dy0S+Ob5Knr/V5mVSTVN1op 8xgDpM4WQYCt2lac//M6ip6gkm6EYB6TUzqsawyIEYxBDkXmsK6WDqQZ6E0kJHzT5oHt KC1DarEPv2M9jKmOLcf78RkFXZkHjhy1Dp2SUejgiKguFVKAWyB2yKD2BpAokN8BZ6gU 4Trg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=NlPon99K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si12131207ilv.82.2021.08.22.07.47.33; Sun, 22 Aug 2021 07:47:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=NlPon99K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233689AbhHVOqS (ORCPT + 99 others); Sun, 22 Aug 2021 10:46:18 -0400 Received: from mail.skyhub.de ([5.9.137.197]:40766 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233009AbhHVOqS (ORCPT ); Sun, 22 Aug 2021 10:46:18 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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