Received: by 10.213.65.68 with SMTP id h4csp2857230imn; Mon, 9 Apr 2018 10:05:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/WFlM1HO879npO5OY1A7Q9nYABnY+P+tBY3+/Sw5OGSH3/8KQYMvA6eFCHpLfNsRwdrd2+ X-Received: by 2002:a17:902:7d92:: with SMTP id a18-v6mr1737745plm.331.1523293533206; Mon, 09 Apr 2018 10:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523293533; cv=none; d=google.com; s=arc-20160816; b=sN0xUR20GxANBlBPl8qHsEzUnUCvjM4HmwTneNWKQn9mGwnoaZPFDzzrV+JxDeklVL zNkdb9MirXQXcPjN+OzgMC3qT1650lGsHVBr3esSabAjIoBoG6y5N3JWVML1jOtwdNRe g1gYg8/pFRnx+Ld9Z9yQv1DQOBuF7PmzcxQXUqq2HfGWmYtIil71UDC6lBNZW7WphfcB kNVt8iv7kQZ4yxhi2xvdfAstmJwUGTDpVvC9GkPkyYEsZFTDc7N58y9u8lGGpahKK73t Ad/YJiTjVeJikG+ysHNA/o5RVqyYb9BAAVqz5pwHQtzi2gx2yZVeSmqU17LHanFrOynN irvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:organization :user-agent:references:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=hK+PO4UmiqdZHfJEJ6dp76EWU5gISHmCX4++h9+DT4w=; b=LlF4Dg25B6kSE+LvHYdp1897j5PYhSlb7eRD2A9/9vcBwZEORAASemYGp+UYM1u03j uoN+6lsc4mfHQguAJJzqcbLupGDPQetOoB4EX1eGJ4SOevBISqYwG631QVCgijVbmqDy /rfCpVUBqoa5YcpNWrjhi5871X7h/0bAZckmD9xraQj0WYoxWHE/oUpNll8VEluESh5u FSGea8yJA7O4jiL6ZNB47/x3hGaeEPAS/f9+1jzxpAhIY96S/mdMnYfk5xY9DCMTFyTb Fmbi97N4/71449VMnNs751uO0ibBWV3cIZWG3+uxSZSTE4UCoB3dkA3Cy6rEhAcVacrT lPHQ== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf10-v6si659595plb.417.2018.04.09.10.04.55; Mon, 09 Apr 2018 10:05:33 -0700 (PDT) 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753891AbeDIRAq (ORCPT + 99 others); Mon, 9 Apr 2018 13:00:46 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49466 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753463AbeDIRAp (ORCPT ); Mon, 9 Apr 2018 13:00:45 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w39GpAIj058949 for ; Mon, 9 Apr 2018 13:00:44 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h89ggrm9j-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 09 Apr 2018 13:00:43 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Apr 2018 18:00:42 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 9 Apr 2018 18:00:38 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w39H0b5042729596; Mon, 9 Apr 2018 17:00:37 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8383AA4053; Mon, 9 Apr 2018 17:52:57 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4D58A4055; Mon, 9 Apr 2018 17:52:56 +0100 (BST) Received: from icon-9-164-148-163.megacenter.de.ibm.com (unknown [9.164.148.163]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 9 Apr 2018 17:52:56 +0100 (BST) Date: Mon, 9 Apr 2018 19:00:36 +0200 (CEST) From: Sebastian Ott X-X-Sender: sebott@schleppi To: Kees Cook cc: Sebastian Ott , Linus Torvalds , LKML , Heiko Carstens , Martin Uecker , Ingo Molnar , Miguel Ojeda Subject: Re: [bisected] 3c8ba0d61d04ced9f8d9ff93977995a9e4e96e91 oopses on s390 In-Reply-To: References: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) Organization: =?ISO-8859-15?Q?=22IBM_Deutschland_Research_&_Development_GmbH?= =?ISO-8859-15?Q?_=2F_Vorsitzende_des_Aufsichtsrats=3A_Martina?= =?ISO-8859-15?Q?_Koederitz_Gesch=E4ftsf=FChrung=3A_Dirk_Wittkopp?= =?ISO-8859-15?Q?_Sitz_der_Gesellschaft=3A_B=F6blingen_=2F_Reg?= =?ISO-8859-15?Q?istergericht=3A_Amtsgericht_Stuttgart=2C_HRB_2432?= =?ISO-8859-15?Q?94=22?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1463805262-326909844-1523293237=:1698" X-TM-AS-GCONF: 00 x-cbid: 18040917-0020-0000-0000-0000040FCD94 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040917-0021-0000-0000-000042A3EF2E Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-09_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804090174 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463805262-326909844-1523293237=:1698 Content-Type: text/plain; charset=US-ASCII On Mon, 9 Apr 2018, Sebastian Ott wrote: > On Fri, 6 Apr 2018, Kees Cook wrote: > > On Fri, Apr 6, 2018 at 2:47 AM, Sebastian Ott wrote: > > > Today's kernel oopsed on s390. Bisect points to: > > > 3c8ba0d61d04 ("kernel.h: Retain constant expression output for max()/min()") > > > > > > [ 1.898277] dasd-eckd 0.0.3304: DASD with 4 KB/block, 21636720 KB total size, 48 KB/track, compatible disk layout > > > [ 1.898308] ------------[ cut here ]------------ > > > [ 1.898310] kernel BUG at block/bio.c:1798! > > > > Well that's extremely bad. :( > > What happened is that the bio build by the partition detection code was > attempted to be split by the block layer because the block queue had a > max_sector setting of 0. blk_queue_max_hw_sectors uses min_not_zero. > > Both of the following return 0 on my machine: > + pr_warn("%u\n", min_not_zero(100, 1000)); > + pr_warn("%u\n", min_not_zero(1000, 100)); > > So, we now know what failed...the question is why? I copied these macros to a userspace program to easily test it on other machines/compilers. ....maybe I did something wrong but min_not_zero did not work - even on fedora on an x86 laptop. Sebastian ---1463805262-326909844-1523293237=:1698 Content-Type: text/plain; name=test.c Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=test.c I2luY2x1ZGUgPHN0ZGlvLmg+DQoNCiNkZWZpbmUgX190eXBlY2hlY2soeCwg eSkJCQkJXA0KCSghIShzaXplb2YoKHR5cGVvZih4KSAqKTEgPT0gKHR5cGVv Zih5KSAqKTEpKSkNCg0KI2RlZmluZSBfX2lzX2NvbnN0ZXhwcih4KQkJCQkJ CVwNCgkoc2l6ZW9mKGludCkgPT0gc2l6ZW9mKCooOCA/ICgodm9pZCAqKSgo bG9uZykoeCkgKiAwbCkpIDogKGludCAqKTgpKSkNCg0KI2RlZmluZSBfX25v X3NpZGVfZWZmZWN0cyh4LCB5KQkJCQlcDQoJKF9faXNfY29uc3RleHByKHgp ICYmIF9faXNfY29uc3RleHByKHkpKQ0KDQojZGVmaW5lIF9fc2FmZV9jbXAo eCwgeSkJCQkJCQlcDQoJKF9fdHlwZWNoZWNrKHgsIHkpICYmIF9fbm9fc2lk ZV9lZmZlY3RzKHgsIHkpKQ0KDQojZGVmaW5lIF9fY21wKHgsIHksIG9wKSAg ICAgICAgKCh4KSBvcCAoeSkgPyAoeCkgOiAoeSkpDQoNCiNkZWZpbmUgX19j bXBfb25jZSh4LCB5LCBvcCkgKHsJCQlcDQoJCQl0eXBlb2YoeCkgX194ID0g KHgpOyAgICBcDQoJCQl0eXBlb2YoeSkgX195ID0gKHkpOyAgICBcDQoJCQlf X2NtcChfX3gsIF9feSwgb3ApOyB9KQ0KDQojZGVmaW5lIF9fY2FyZWZ1bF9j bXAoeCwgeSwgb3ApCQkJCQkJXA0KCV9fYnVpbHRpbl9jaG9vc2VfZXhwcihf X3NhZmVfY21wKHgsIHkpLAkJCQlcDQoJCQkgICAgICBfX2NtcCh4LCB5LCBv cCksIF9fY21wX29uY2U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