From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651AbdJ0Gfv convert rfc822-to-8bit (ORCPT ); Fri, 27 Oct 2017 02:35:51 -0400 Received: from mga11.intel.com ([192.55.52.93]:48951 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbdJ0Gft (ORCPT ); Fri, 27 Oct 2017 02:35:49 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,303,1505804400"; d="scan'208";a="1235948573" From: "Reshetova, Elena" To: Martin Schwidefsky CC: "linux-s390@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "heiko.carstens@de.ibm.com" , "jwi@linux.vnet.ibm.com" , "ubraun@linux.vnet.ibm.com" , "peterz@infradead.org" , "keescook@chromium.org" Subject: RE: [PATCH 1/3] [S390] vmur: convert urdev.ref_count from atomic_t to refcount_t Thread-Topic: [PATCH 1/3] [S390] vmur: convert urdev.ref_count from atomic_t to refcount_t Thread-Index: AQHTSXfh92Z5dATbFEWem/wzpwgjPqL1pVeAgAGjLkA= Date: Fri, 27 Oct 2017 06:35:35 +0000 Message-ID: <2236FBA76BA1254E88B949DDB74E612B802B69F2@IRSMSX102.ger.corp.intel.com> References: <1508485670-24070-1-git-send-email-elena.reshetova@intel.com> <1508485670-24070-2-git-send-email-elena.reshetova@intel.com> <20171026083449.57ccb533@mschwideX1> In-Reply-To: <20171026083449.57ccb533@mschwideX1> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDEzMmNkMmMtYmFkNS00NWQwLTkzMTgtNTYwYTI3ZWQ5NTIwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiIxXC8rdEltQUdlVmhoRTdZMXo3K0tsQ2xLZkhcL1RkRGVteHZUcVBTeHRRMDlaemxHUUJQNURteVwvRDAraHdrOWZpIn0= x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Fri, 20 Oct 2017 10:47:48 +0300 > Elena Reshetova wrote: > > > atomic_t variables are currently used to implement reference > > counters with the following properties: > > - counter is initialized to 1 using atomic_set() > > - a resource is freed upon counter reaching zero > > - once counter reaches zero, its further > > increments aren't allowed > > - counter schema uses basic atomic operations > > (set, inc, inc_not_zero, dec_and_test, etc.) > > > > Such atomic variables should be converted to a newly provided > > refcount_t type and API that prevents accidental counter overflows > > and underflows. This is important since overflows and underflows > > can lead to use-after-free situation and be exploitable. > > > > The variable urdev.ref_count is used as pure reference counter. > > Convert it to refcount_t and fix up the operations. > > > > Suggested-by: Kees Cook > > Reviewed-by: David Windsor > > Reviewed-by: Hans Liljestrand > > Signed-off-by: Elena Reshetova > > Added to s390/linux:features for the next merge window. Thanks. Thank you very much! Best Regards, Elena. > > -- > blue skies, > Martin. > > "Reality continues to ruin my life." - Calvin.