Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3308765ybv; Mon, 24 Feb 2020 22:44:04 -0800 (PST) X-Google-Smtp-Source: APXvYqyGD1dLmCISHnTiE/MSIL20FyfJqdvks+RTz4hUz6mbrioxmSHYS54Hq0kkUbcBNOg5RBTW X-Received: by 2002:a9d:1c96:: with SMTP id l22mr43778025ota.322.1582613044187; Mon, 24 Feb 2020 22:44:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582613044; cv=none; d=google.com; s=arc-20160816; b=zFuDkurE9iQ85XtEUzl0kXJ2RVzZ0PNi+jQNdpYZNGHhu4OGTiPFvnqx+X/KdGreuk Z11sY06ERgVtxlrXMbBsslWneK+1TaZLgn0mYK5gIu7Jq28f+ilzd5MPWc72mhfbbf5S RsenlMYTU9pFecilb31pIwAOEvPtLYqv04mXUj48H64867VwZ/MECBAr1nbAQGJh39Je SoSZSxjp2EZEb5v7F2oNzX9LSYKz0YFvQjY2uu7Euh6uA+aT2/W+I75cQDJ1iKHHOO2i PQwpWdF4m/y3gvVlAS5eKhxkuuvUCYAla6676FNFK884Tr5jFoRShRSDWsRBv+Jedzfw S94g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MhMaWMjj3M7eA3BDOckAlYt1Mx5suf2oObIHVxYSB0E=; b=uBE9TunXz9s6cTj99wDwhov29puj4cxoK0kRAqxW1cowhnj1vTTne8hW3Sd3vrkBsV 2KF12w32w/sa4kcfAxebmMvMuHevStx6mGmYBORbokJtyh9mruv1dPxZ5EzcCXI9Q9AZ atBJBWrY363uOcp+w143XJ2i9qnKEC21+HV0Do8Zpr2DoHPhVx2428auDxurXyBZPRw+ fVKLd8IkqukfAu3ysZ/HsynjjooE0vgkX7xwfnuzWziGsbEsac1xQI94KpNFoR25cUKI WVgPqNx7a4F3GDI9QpRsFbnXbOZT9ilWsW6ayHH1YUyxvXwUs35k1iYNrGaZ+vWHeCK8 fwKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16si7733788otq.253.2020.02.24.22.43.51; Mon, 24 Feb 2020 22:44:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729058AbgBYGfm (ORCPT + 99 others); Tue, 25 Feb 2020 01:35:42 -0500 Received: from relay.sw.ru ([185.231.240.75]:39432 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbgBYGfm (ORCPT ); Tue, 25 Feb 2020 01:35:42 -0500 Received: from vvs-ws.sw.ru ([172.16.24.21]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j6Tod-0004kl-UK; Tue, 25 Feb 2020 09:35:36 +0300 Subject: Re: [PATCH 7/7] sysvipc_find_ipc should increase position index To: linux-kernel@vger.kernel.org, Andrew Morton Cc: Waiman Long References: <8ed2850e-7cec-ebeb-4e15-21da3715c42a@redhat.com> From: Vasily Averin Message-ID: <8e097c72-5fd0-4a59-12e3-8298b9f5468e@virtuozzo.com> Date: Tue, 25 Feb 2020 09:35:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <8ed2850e-7cec-ebeb-4e15-21da3715c42a@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Andrew, Could you please pick up this patch? On 1/24/20 7:26 PM, Waiman Long wrote: > On 1/24/20 2:03 AM, Vasily Averin wrote: >> if seq_file .next fuction does not change position index, >> read after some lseek can generate unexpected output. >> >> https://bugzilla.kernel.org/show_bug.cgi?id=206283 >> Signed-off-by: Vasily Averin >> --- >> ipc/util.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/ipc/util.c b/ipc/util.c >> index 915eacb..7a3ab2e 100644 >> --- a/ipc/util.c >> +++ b/ipc/util.c >> @@ -764,13 +764,13 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos, >> total++; >> } >> >> + *new_pos = pos + 1; >> if (total >= ids->in_use) >> return NULL; >> >> for (; pos < ipc_mni; pos++) { >> ipc = idr_find(&ids->ipcs_idr, pos); >> if (ipc != NULL) { >> - *new_pos = pos + 1; >> rcu_read_lock(); >> ipc_lock_object(ipc); >> return ipc; > > Acked-by: Waiman Long >