Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp969077ybl; Fri, 24 Jan 2020 12:55:20 -0800 (PST) X-Google-Smtp-Source: APXvYqx5a/xTVb7VR0GcVgZY61ynzZU3MGCd6AqLBr1a4TIGatVIMHVJgTKXQQHd3Nz95P6s1VMy X-Received: by 2002:a05:6808:913:: with SMTP id w19mr559211oih.56.1579899320031; Fri, 24 Jan 2020 12:55:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579899320; cv=none; d=google.com; s=arc-20160816; b=uhWVpLvyX8vMwL16LZBTSIk+4EHL7DfHBK4xgGleXqJTQPwyhhYdMJkUrGLcZilFLx +hZloy3NuxMvHeTpmOUBkxijtRoGTAK09IyJqgW0jAsHKX0LZIQkTQirhbwywIjqFziy oDRpRpTiorKarjvlNXqxQjVOF1NA2PkQ2B53PmNziVblPfNETkLncyIQlGvs+4cEfDFN 6naODlxe5eZuZUwo8U7X0DLlNMRQ6oI5R44edxV2MzEqJFgYkMz+tv6PTWUTq3LnRNJu pPCBxl67BJ1PhELvk9ADXlLhat6ohZVQqcNFGuml10ubKCTMJpArKqBz4831gLtVW8FD 05Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=iP5kUzj/MjjYp8gqP+NZWwU5OGdgr2jRpmH4EARLI/g=; b=vMwlKhqvmt/vavDl62g58OJSMhE8E+4znATmc2YptkpwZpVGlcrPRSXI61fW3eMJvF pNrkhuPkvWNn0EtUEbSrpUQT4uf4P42qXygE3m6CAbSUQnhMXQ0dzhB+YST1wov9s9bQ +KaWT/9ViM+8Y9XPceoTsxjYHatSFE7zmO56JnC5BlmpAH64YjCAisrDBkI0deccQspA MtbyKlTzDPjVzRKFJ5sfQsIYoEowIRnnkjKnbr/WvuTdkGgSOwn011FymTGJfHmFaWil Mis0ttYjyhhkwpxttXptLmtwN3/Bing8JGQ+H5w1DBNJzjUcf4rgKFSOUv0Brrpo1mD2 1+Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QnYaxXVB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u127si298060oig.71.2020.01.24.12.55.08; Fri, 24 Jan 2020 12:55:20 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QnYaxXVB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388252AbgAXQ0Z (ORCPT + 99 others); Fri, 24 Jan 2020 11:26:25 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:52005 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388131AbgAXQ0Z (ORCPT ); Fri, 24 Jan 2020 11:26:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579883183; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iP5kUzj/MjjYp8gqP+NZWwU5OGdgr2jRpmH4EARLI/g=; b=QnYaxXVB92QAsAYYgMSMit1XPfVsmivPPskolfKCSYbOu2yChZvLnzyUiHh1dueDdWntFN 4dMBg7b/LRyIFgbmO4CbA3lpU9c+v2PJOuN4Qh7uMDoJyAngo/L3ZDTkJ1EMXFUXuFFU5u p4LWYR5XurcQ/pjpCqwCrZ+zMY6mYYA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-120-KqwGgzqlMdit2ebtrV91vQ-1; Fri, 24 Jan 2020 11:26:18 -0500 X-MC-Unique: KqwGgzqlMdit2ebtrV91vQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A40C109576C; Fri, 24 Jan 2020 16:26:17 +0000 (UTC) Received: from llong.remote.csb (ovpn-124-92.rdu2.redhat.com [10.10.124.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1676010016E8; Fri, 24 Jan 2020 16:26:15 +0000 (UTC) Subject: Re: [PATCH 7/7] sysvipc_find_ipc should increase position index To: Vasily Averin , linux-kernel@vger.kernel.org Cc: Andrew Morton , NeilBrown , Steven Rostedt , Ingo Molnar , Peter Oberparleiter References: From: Waiman Long Organization: Red Hat Message-ID: <8ed2850e-7cec-ebeb-4e15-21da3715c42a@redhat.com> Date: Fri, 24 Jan 2020 11:26:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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