Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1871252ybz; Sun, 26 Apr 2020 06:09:59 -0700 (PDT) X-Google-Smtp-Source: APiQypIxkF9rt9zbf9tazHzdzX3b7r8gILQfZojqohxv6gUyrkQajHJ55vlRNhxFNKfcm9y494hN X-Received: by 2002:a17:906:9518:: with SMTP id u24mr15525225ejx.320.1587906599160; Sun, 26 Apr 2020 06:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587906599; cv=none; d=google.com; s=arc-20160816; b=wLzN1RXEeZ37lttivdqtCWGo3ATYlWO0Yu+CN6rksKtize0hTV9+wxfCBlfxX0+BUa ERSXF44zrQAwoCLNXhdktqWRbxWiP3ObUcigWhaRTQkk9ubPBoU2574phUOQfl2JNVlK GZ3euaohw7iZyOi+x7q13NV34YxafU2ebnwfaehKJvoRyv4yyIDbjvPirkP1dSw5ZLGT Iaa1LYM62k5yM/Cr/NYiBqHFayE/BRhau/opZzRtZ4L/t7N+aL5STzuasGbBplYlF1zC 8L/pT0KJEOWdGNTQZHB0JiiYVpsJAn7hy6fqVbugAWR5A3/qXsD5qioVvDXFH6jtxNWp +d5w== 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:mime-version :message-id:date:subject:cc:to:from; bh=/MBrzI+kWs5DA8ffL+OUrhz5HYBrpy6azkX7d6OMK6E=; b=Zx/KtfctqIoHvbjW9q3KJSgTNUppepYGj0REx3RT/feMJFazOnrYR2ydRCRLnXS261 b5vb2Hr+nseeC8EoMsT+1NFRf2nr0FeJpsZtMOmSpjqPAq4qLiMUsgjEvQPzCj4UXl2W T5jGrjmoR4EmhmiHPZnyulPMEwHQWxuBvu7A0A5b54/hKBALEvp6l+Pb9wgvw+xRUzwR +TuYaVpghEOyIAsSWrFoF7aBeo+bSFA3anVmxhFyJwZx71O4bnQXYTLjvq7hoGeGyHZf YndteXmhpGG6wrC1uLCfhCmE5/i7V9+pm+oCJwfZkSQZd++YgiC0ymVDeBjwrAwnk+fU zFtw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g26si6305570edu.55.2020.04.26.06.09.35; Sun, 26 Apr 2020 06:09:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726170AbgDZNH6 (ORCPT + 99 others); Sun, 26 Apr 2020 09:07:58 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:38270 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbgDZNH6 (ORCPT ); Sun, 26 Apr 2020 09:07:58 -0400 Received: by mail-lj1-f193.google.com with SMTP id e25so14671013ljg.5; Sun, 26 Apr 2020 06:07:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/MBrzI+kWs5DA8ffL+OUrhz5HYBrpy6azkX7d6OMK6E=; b=sTHlVWC3nN+DdM+8BmqgTTddFbmA85tRz+ybJiuBD79XNF/u64mm8TuOyGJ1RksdAT SvvMF5BG2ABDRaZXXt4BVQd7Gm8WmOBlLWovdYYa4+KkV8vdA03U4E458fBAa/5n916B 4l/MQEK4G1c35xiArTZ4I+b6QnvGKUnzHM+TGC2camAMqTgnn94hsoNYWXLon7VNxkGe rT2YPYmJi1gxiF15Ai9kibZvWF+KxhNh7YIshYf7lYABJ2wiGHXxHioGuFDpmbry4SS2 biFY7zSnR+TI2DhCVz9Suf73LbTRImkuxe6PgOXeZNHdXrrB0f5DJIKBmsSqyUduJNeu Watg== X-Gm-Message-State: AGi0PuYRGsKxNAsyYTUrEXyx2ob9bk1eA72ieYaF/Is/GxcOsnauoaKv y0hcim9pRnFYTvTf3eMq4GCUcEtiuZI= X-Received: by 2002:a2e:85c4:: with SMTP id h4mr11648938ljj.112.1587906476310; Sun, 26 Apr 2020 06:07:56 -0700 (PDT) Received: from localhost.localdomain ([213.87.147.211]) by smtp.googlemail.com with ESMTPSA id l8sm7983371ljo.5.2020.04.26.06.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 06:07:55 -0700 (PDT) From: Denis Efremov To: linux-block@vger.kernel.org Cc: Denis Efremov , Willy Tarreau , Christoph Hellwig , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] floppy: suppress UBSAN warning in setup_rw_floppy() Date: Sun, 26 Apr 2020 16:07:25 +0300 Message-Id: <20200426130728.63399-1-efremov@linux.com> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These patches are based on Willy's cleanup patches https://lkml.org/lkml/2020/3/31/609. The first two patches indroduce defines to make it more clear why cmd_count in struct floppy_raw_cmd allows out-of-bounds access for cmd, reply_count, reply fields. The last one handles the warning. Changes in v2: - add FD_RAW_CMD_FULLSIZE to the second patch - add union with fullcmd to struct floppy_raw_cmd in the last patch Denis Efremov (3): floppy: add FD_AUTODETECT_SIZE define for struct floppy_drive_params floppy: add defines for sizes of cmd & reply buffers of floppy_raw_cmd floppy: suppress UBSAN warning in setup_rw_floppy() drivers/block/floppy.c | 34 +++++++++++++--------------------- include/uapi/linux/fd.h | 26 ++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 25 deletions(-) -- 2.25.3