Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp268787pxj; Thu, 13 May 2021 04:39:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7kLF4amRrBYp+7/CS3BJx4N5j5lmZ5PiGHrIpOlcIePmzqfnEG7hDRJEqKY3U85k2xrlT X-Received: by 2002:a05:6e02:194b:: with SMTP id x11mr36761232ilu.213.1620905942742; Thu, 13 May 2021 04:39:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620905942; cv=none; d=google.com; s=arc-20160816; b=vrN7BX9uDhyXANgKo22+z4zAERPSvapsuTN7Wx/+SBLUrsKhD0fJdj+qwxZYTpWPsX 0injxeRWoo9Lfplutp7kstwAFUk9lQO+qDaZS6JXHyoFYsFPqWNrKVztVja/Qerh8mAa nKBLO6fGp5tKfNtrTdPtJkem+IT43rGvZB7TFZyF5L07rLLBxiWFqxt2VhQq1CL967ir YEqzlmjAJIlQRG4fanuAPbMrC+UuzRPUhWxH12ngFLCrmtUjC7br0qPqn2wnCUjhJZtU ogMIK/IJWgkxa3aeq6/JCohGJYEQujTtqZxk4briDJQnr4fCFfpLSOQcz2l6WsHpaCqa FP7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Gv3oECQ46RpkqjsSmVdu+DBDmUv5de8Z0G7uM0jmSok=; b=qyFWumIk0esi8ov5D49BuOSF2C4M+uOjpEkTwdau8soYdI2vsGQjSKeCQ+/NmEMxUQ XWSF3Bi6kNiQwOCHFZlFKbfQPD2lLxZUtIcvmEgRmil0gLG3wSEEUjxTGkr8ujKJOGME Um/c3pwHMTz8HvCn1cW7B3GelBtwAN+V32JvyX8PKCoTeePO44ZVkg6ivhs8oi3XbJ3c LTM9tP0v7FNG//yP9HEp4Q7wIcMlTXEqRwFEm9cackfge6D8NVl7KRcHbBPLtfomavbP smeLo3nqQ+5jRtYAuGRUTxI8iAIy/63lLj0uFWJBrY8zbd4R0t6bl/qzHJfS/xJfVSxz R77Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=jUliB6QB; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si4012793ilu.88.2021.05.13.04.38.49; Thu, 13 May 2021 04:39:02 -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=@suse.com header.s=susede1 header.b=jUliB6QB; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232796AbhEMKWD (ORCPT + 99 others); Thu, 13 May 2021 06:22:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:50114 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232643AbhEMKVq (ORCPT ); Thu, 13 May 2021 06:21:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1620901236; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Gv3oECQ46RpkqjsSmVdu+DBDmUv5de8Z0G7uM0jmSok=; b=jUliB6QB+yR8m7zRmYNUYKDKJ3/1vxpyky3PJGw3F93zhwBoHSkhylkgwQb1Vaq7l1dlm1 2KogYYZd78ZTwfzoJSBPcNNs5osgvCANhvLt7vleAdSAVPhIeb3n8SETjdMtUSokPWGDd5 Ownp3SVZ9wWKrhXoIPaI4X6u/QbH9/0= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 47268B15E; Thu, 13 May 2021 10:20:36 +0000 (UTC) Subject: Re: [PATCH 8/8] xen/hvc: replace BUG_ON() with negative return value To: Christophe Leroy , xen-devel@lists.xenproject.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby References: <20210513100302.22027-1-jgross@suse.com> <20210513100302.22027-9-jgross@suse.com> <6da4cc91-ccde-fce8-707c-e7544783c2fa@csgroup.eu> From: Juergen Gross Message-ID: Date: Thu, 13 May 2021 12:20:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <6da4cc91-ccde-fce8-707c-e7544783c2fa@csgroup.eu> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PNhWaVfjD0otdP9RzGGQdOMphOo0bj07j" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PNhWaVfjD0otdP9RzGGQdOMphOo0bj07j Content-Type: multipart/mixed; boundary="yyRuUPzqcs5EAOdYBXLJTxPGRA5Ebq4bt"; protected-headers="v1" From: Juergen Gross To: Christophe Leroy , xen-devel@lists.xenproject.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Message-ID: Subject: Re: [PATCH 8/8] xen/hvc: replace BUG_ON() with negative return value References: <20210513100302.22027-1-jgross@suse.com> <20210513100302.22027-9-jgross@suse.com> <6da4cc91-ccde-fce8-707c-e7544783c2fa@csgroup.eu> In-Reply-To: <6da4cc91-ccde-fce8-707c-e7544783c2fa@csgroup.eu> --yyRuUPzqcs5EAOdYBXLJTxPGRA5Ebq4bt Content-Type: multipart/mixed; boundary="------------8C09C99EF5386C5A52D248BD" Content-Language: en-US This is a multi-part message in MIME format. --------------8C09C99EF5386C5A52D248BD Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 13.05.21 12:16, Christophe Leroy wrote: >=20 >=20 > Le 13/05/2021 =C3=A0 12:03, Juergen Gross a =C3=A9crit=C2=A0: >> Xen frontends shouldn't BUG() in case of illegal data received from >> their backends. So replace the BUG_ON()s when reading illegal data fro= m >> the ring page with negative return values. >> >> Signed-off-by: Juergen Gross >> --- >> =C2=A0 drivers/tty/hvc/hvc_xen.c | 15 +++++++++++++-- >> =C2=A0 1 file changed, 13 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c >> index 92c9a476defc..30d7ffb1e04c 100644 >> --- a/drivers/tty/hvc/hvc_xen.c >> +++ b/drivers/tty/hvc/hvc_xen.c >> @@ -86,6 +86,11 @@ static int __write_console(struct xencons_info=20 >> *xencons, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cons =3D intf->out_cons; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 prod =3D intf->out_prod; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mb();=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* update queue values before going on */ >> + >> +=C2=A0=C2=A0=C2=A0 if (WARN_ONCE((prod - cons) > sizeof(intf->out), >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 "Illegal ring page indices")) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL; >> + >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BUG_ON((prod - cons) > sizeof(intf->out= )); >=20 > Why keep the BUG_ON() ? Oh, failed to delete it. Thanks for noticing. Juergen --------------8C09C99EF5386C5A52D248BD Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOBy= cWx w3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJvedYm8O= f8Z d621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y= 9bf IhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xq= G7/ 377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR= 3Jv c3MgPGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsEFgIDA= QIe AQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4FUGNQH2lvWAUy+dnyT= hpw dtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3TyevpB0CA3dbBQp0OW0fgCetToGIQrg0= MbD 1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbv= oPH Z8SlM4KWm8rG+lIkGurqqu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v= 5QL +qHI3EIPtyfE7i9Hz6rVwi7lWKgh7pe0ZvatAudZ+JNIl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Ap4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5BjR/i1DG86lem3iBDX= zXs ZDn8R38=3D =3D2wuH -----END PGP PUBLIC KEY BLOCK----- --------------8C09C99EF5386C5A52D248BD-- --yyRuUPzqcs5EAOdYBXLJTxPGRA5Ebq4bt-- --PNhWaVfjD0otdP9RzGGQdOMphOo0bj07j Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmCc/XMFAwAAAAAACgkQsN6d1ii/Ey/C FQf+OD+N3eBcm476rbHE/SMrRCrdPemYIIfTIa5eniRP163hc8D1XpMWlkcy5Im93pdCIpKY0tTp 2W2b04SywD+i6CehGWJ+nKEvRh1wNiJdGF+EWyf5QQGdmixgOhHzWEcOdn+uI770XafZTPT2w3x2 Ki7nKgGa7Gjr6xCJhexpnMYtQe4uo1SXTRT9j+W10jA6ppaG8zB4pE8ONyHG2c+CN7Ue354XBM4X QVNLngs5PFy8LbNyhfU1IU1kG/0rrFmwsd2+CRRx0iCgtlcxaVwkPsIEF0e17l2rXGj0+aniQXW8 NcRQ00qw+18DPctnaLB1OU2GUgEJnuLWGzEuR6NdDg== =tAfr -----END PGP SIGNATURE----- --PNhWaVfjD0otdP9RzGGQdOMphOo0bj07j--