Received: by 10.213.65.68 with SMTP id h4csp2000579imn; Thu, 5 Apr 2018 07:23:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx49/eOMAGQf6BWMdimHpCun4bSYNvH/+/X96HItx40IS6+VptYdc8VuqTF9nHDiH9TiYPRmg X-Received: by 10.98.57.143 with SMTP id u15mr17315677pfj.79.1522938194629; Thu, 05 Apr 2018 07:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522938194; cv=none; d=google.com; s=arc-20160816; b=Z93HSRZpJ/zQhA9j2wKoQl0RW0vwT8o9U9j42XbJtkyaKtDEKvrWgQzW6aLGWlYPvS plzUB+HArx/1zD+ujpVxWGgLD1PSSFUJtrGSV8qfIMOTkulLh0zt8H0xX6vVwyWmWQBC l6sOnG0P42C5SCYLleNRmf/qSCwMrCZDc9eGc04Ucx5lZeqlKlALjBwuDojrVyaYcV2k BacDlNyUlaSbrHICI4+HiEo3qqujHVUqdUMaOXzZRHNsOuNMm85BNhCQN9LymAMallHh oIIueNwmg1e9bc4nndKD+DguS5Yf8ZmCOULdqTwG7u11Mcwvk4hD+48imG2ZCwWLBpZS OqUw== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:dkim-signature:arc-authentication-results; bh=ZF3YTIsnPwTZaqjF4RHUpJVCWy6eKQDHpW8nTUwrRrw=; b=LAfGGW/tJ/ND4/BFUwDo09SKtDIxYxfKYG9emUuEpYPAZOzMGW9i/hOz92h8ejOepm KLCFmiRhJGsp9o+kp/B/302jK/GBYcBXKn9QZbcGmrMSt5fccHM2HewAsfQuSAr/wAPO 4k6pLqUAg4E1Kk7KEEDxVivYQIL2edgWCJYF0IOC3ErrxsemQ1qOtzVUvlLmCDk/BTJI 1fcY/qy6EZdfwdz71RS+GNtF0/Kr1aaskKPf/sM76u5xtY9/ZaMsCs6r0oOCGjxdbU+e VM5AHQQw3i+5j72y1N8PqX7FJGLlCEwt4ZCd8lGVViFk8w3FMKLt50CkKSfTnMJdVb1F qjbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=aez6gaM1; dkim=fail header.i=@chromium.org header.s=google header.b=RPBCrigb; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az3-v6si4840736plb.422.2018.04.05.07.23.00; Thu, 05 Apr 2018 07:23:14 -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; dkim=fail header.i=@google.com header.s=20161025 header.b=aez6gaM1; dkim=fail header.i=@chromium.org header.s=google header.b=RPBCrigb; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751352AbeDEOVj (ORCPT + 99 others); Thu, 5 Apr 2018 10:21:39 -0400 Received: from mail-ua0-f196.google.com ([209.85.217.196]:37428 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbeDEOVh (ORCPT ); Thu, 5 Apr 2018 10:21:37 -0400 Received: by mail-ua0-f196.google.com with SMTP id q12so15576322uae.4 for ; Thu, 05 Apr 2018 07:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=ZF3YTIsnPwTZaqjF4RHUpJVCWy6eKQDHpW8nTUwrRrw=; b=aez6gaM1iRMYdPi5P8Dr7GrRieUWjG2G5iI+klsakJzozTWQiuGo8Rx2GUhcG73ASX +Fg6ePNd+dfhScz2PqFithxYrNmNHFFafS2TneKfBmaitC77w0kf+yJ4MFwwoc4Hclnp hhkriRfjhTXzpO3ZDb2me5ePF4HhzHWnZsGsQTw4eYBIKfPIzgDrziQ+ds33AgYaBiw3 pCbA+x6fsVwZVcWQqbEjeP/5efHab0+/IFExbG1kKmMQcPdT96djvsVs/XT/T2oXJpNJ gpg5HRzmx27SqrRE6sMs3qJH4kP4hVaw7Po4+xqT8qHYkdqrniR8cGJFs2IrNak3GrcA ef8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=ZF3YTIsnPwTZaqjF4RHUpJVCWy6eKQDHpW8nTUwrRrw=; b=RPBCrigbspUYmZQIZe6jTvKjlNeOdHxhlskfZ43p/+epH/cYGy/l6AKxOszWLfsWCv Dic91GMq3sa0gRfix02drCGYSrq2H/NwjZ30J/MUUAi/K6sCWo1J2VkoxV74nBtAzoh7 jKOnRMKOR9MeZxMaB4F2TwVYK3u0ABxuKbWwE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=ZF3YTIsnPwTZaqjF4RHUpJVCWy6eKQDHpW8nTUwrRrw=; b=IlUS5BxQ/V82ZRuzqx5WQsy6BaxoxdnIlVpkKZrwS2u9Gw8fIrAeMhFh5hJ7pAo/i1 yGXl0lz3jzZztbkdtllaKLqTzpuHOUj0X8oKATYp9FbXYEcVlOmDuczSVPzkP/i+ugW/ CnJxrkzAITJ9QmMxrwhogl4Blz2I3uoSIGUcUgs3YQ+fwtioMmJZYPqr0DWNAvfTPfeF aUEuSwBCdPkGSI/e6tJ8yOjLfPFOCVuaBB73dB0mRkOwltN78Wta+KUdf1+zNwUl6iY4 3E6vZZrOTd/0NUmeuvu26tl5B9Tcme0xguGIcKqkAiR5k/r+qPkM5wQGjDhp2Dgidu7Q yZyw== X-Gm-Message-State: ALQs6tBcuCr6K+lFXvs19D+DTZuuDdudjydjOxDCWHJFoJ66LxUi7dkk zRkdF2Pi4jMnJ7AQb6Um2nTowdHra9pk0ihnqaUhxA== X-Received: by 10.176.11.151 with SMTP id c23mr14209695uak.164.1522938091817; Thu, 05 Apr 2018 07:21:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.164.81 with HTTP; Thu, 5 Apr 2018 07:21:31 -0700 (PDT) In-Reply-To: <7fc01f67a561ce1fad676fc34c2249e7@natalenko.name> References: <10360653.ov98egbaqx@natalenko.name> <3265889.eu5sbW8aRz@natalenko.name> <7fc01f67a561ce1fad676fc34c2249e7@natalenko.name> From: Kees Cook Date: Thu, 5 Apr 2018 07:21:31 -0700 X-Google-Sender-Auth: tif0dVkqJ5OlnzzdS72CcwHtkp8 Message-ID: Subject: Re: usercopy whitelist woe in scsi_sense_cache To: Oleksandr Natalenko Cc: David Windsor , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 5, 2018 at 2:56 AM, Oleksandr Natalenko wrote: > Hi. > > 04.04.2018 23:25, Kees Cook wrote: >> >> Thanks for the report! I hope someone more familiar with sg_io() can >> help explain the changing buffer offset... :P > > > Also, FYI, I kept the server running with smartctl periodically invoked, = and > it was still triggering BUGs, however, I consider them to be more or less > harmless until the server got stuck with high I/O wait this morning after > next smartctl invocation. So, it isn't harmless, it seems=E2=80=A6 > > It could be unrelated, of course, since the journal didn't give me any hi= nt > (or a stack trace) on what happened, thus I'll monitor how things behave > without smartctl too. I had a VM running over night with: [1] Running while :; do smartctl -a /dev/sda > /dev/null; done & [2]- Running while :; do ls --color=3Dauto -lR / > /dev/null 2> /dev/null; done & [3]+ Running while :; do sleep $(( $RANDOM % 100 )); sync; echo 3 > /proc/sys/vm/drop_caches; done & and I haven't seen the issue. :( FWIW, I'm using the ahci qemu driver: -drive file=3Ddisk-image.raw,if=3Dnone,id=3Ddrive0,format=3Draw \ -device ahci,id=3Dbus0 \ -device ide-drive,bus=3Dbus0.0,drive=3Ddrive0 Does this match your qemu instance? -Kees --=20 Kees Cook Pixel Security