~cbrauner/ubuntu/+source/linux/+git/disco:2019-05-07/shiftfs_btrfs_ioctls

Last commit made on 2019-06-11
Get this branch:
git clone -b 2019-05-07/shiftfs_btrfs_ioctls https://git.launchpad.net/~cbrauner/ubuntu/+source/linux/+git/disco
Only Christian Brauner can upload to this branch. If you are Christian Brauner please log in for upload directions.

Branch merges

Branch information

Name:
2019-05-07/shiftfs_btrfs_ioctls
Repository:
lp:~cbrauner/ubuntu/+source/linux/+git/disco

Recent commits

853e743... by Christian Brauner

UBUNTU: SAUCE: shiftfs: allow changing ro/rw for subvolumes

BugLink: https://bugs.launchpad.net/bugs/1832316

This enables toggling between ro/rw for btrfs subvolumes under shiftfs.

Currently, btrfs workloads employing shiftfs cause regression.
With btrfs unprivileged users can already toggle whether a subvolume
will be ro or rw. This is broken on current shiftfs as we haven't
whitelisted these ioctls().
To prevent such regression, we need to whitelist the ioctls
BTRFS_IOC_FS_INFO, BTRFS_IOC_SUBVOL_GETFLAGS, and
BTRFS_IOC_SUBVOL_SETFLAGS. All of them should be safe for unprivileged
users.

Cc: Seth Forshee <email address hidden>
Cc: Tyler Hicks <email address hidden>
Signed-off-by: Christian Brauner <email address hidden>

f3c4b59... by Young

Bluetooth: hidp: fix buffer overflow

CVE-2019-11884

Struct ca is copied from userspace. It is not checked whether the "name"
field is NULL terminated, which allows local users to obtain potentially
sensitive information from kernel stack memory, via a HIDPCONNADD command.

This vulnerability is similar to CVE-2011-1079.

Signed-off-by: Young Xiao <email address hidden>
Signed-off-by: Marcel Holtmann <email address hidden>
Cc: <email address hidden>
(cherry picked from commit a1616a5ac99ede5d605047a9012481ce7ff18b16)
Signed-off-by: Connor Kuehl <email address hidden>
Acked-by: Kamal Mostafa <email address hidden>
Acked-by: Colin Ian King <email address hidden>
Acked-by: Po-Hsu Lin <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

e09b101... by Geert Uytterhoeven <email address hidden>

spi: Add missing error handling for CS GPIOs

BugLink: https://bugs.launchpad.net/bugs/1826142

While devm_gpiod_get_index_optional() returns NULL if the GPIO is not
present (i.e. -ENOENT), it may still return other error codes, like
-EPROBE_DEFER. Currently these are not handled, leading to
unrecoverable failures later in case of probe deferral:

    gpiod_set_consumer_name: invalid GPIO (errorpointer)
    gpiod_direction_output: invalid GPIO (errorpointer)
    gpiod_set_value_cansleep: invalid GPIO (errorpointer)
    gpiod_set_value_cansleep: invalid GPIO (errorpointer)
    gpiod_set_value_cansleep: invalid GPIO (errorpointer)

Detect and propagate errors to fix this.

Fixes: f3186dd876697e69 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Signed-off-by: Geert Uytterhoeven <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 1723fdec5fcbc4de3d26bbb23a9e1704ee258955)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

82dc54d... by Linus Walleij

gpio: of: Fix logic inversion

BugLink: https://bugs.launchpad.net/bugs/1826142

The SPI chip selects were not properly inspected due to
a logic inversion. This made SPI GPIOs not work.

Cc: Jan Kotas <email address hidden>
Reported-by: Jan Kotas <email address hidden>
Tested-by: Jan Kotas <email address hidden>
Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit c1c04cea13dc234ce9a4504879ddd36ea524d880)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

919fd8f... by Linus Walleij

spi: dw: Fix default polarity of native chipselect

BugLink: https://bugs.launchpad.net/bugs/1826142

The DW controller also supports platforms specifying
native chipselects. When I enforce the use of high CS
for drivers opting in for using GPIO descriptors, I
inadvertedly switched the driver to also use active
high chip select for native chip selects.

As it turns out, the DW hardware driving chip selects
also thinks it is weird with active low chip selects
so all we need to do is remove an inversion in the
driver.

Cc: Jan Kotas <email address hidden>
Reported-by: Jan Kotas <email address hidden>
Tested-by: Jan Kotas <email address hidden>
Fixes: 9400c41e77b8 ("spi: dw: Convert to use CS GPIO descriptors")
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 6e0a32d6f376ea22a34ae3a8df60adafbcdb0c86)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

fbdc858... by Linus Walleij

spi: Support high CS when using descriptors

BugLink: https://bugs.launchpad.net/bugs/1826142

All controllers using GPIO descriptors can by definition
support high CS connections, so just enforce this when
registering an SPI controller.

This fixes a regression where controllers were missing
SPI_CS_HIGH, the drivers would fail like this:

spi spi0.0: setup: unsupported mode bits 4
cdns-spi fd0b0000.spi: can't setup spi0.0, status -22

This is because as using descriptors moves the CS inversion
logic over to gpiolib, all such controllers are registered
with CS active high.

Cc: Jan Kotas <email address hidden>
Reported-by: Jan Kotas <email address hidden>
Tested-by: Jan Kotas <email address hidden>
Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 2df201e0067d84db5955d07cc0d7ccc3b7295aef)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

f621635... by Anders Roxell

spi: dw: fix warning unused variable 'ret'

BugLink: https://bugs.launchpad.net/bugs/1826142

When CONFIG_SPI_DESIGNWARE are enabled we see the unused variable
warning in dw_spi_setup.

../drivers/spi/spi-dw.c: In function ‘dw_spi_setup’:
../drivers/spi/spi-dw.c:400:6: warning: unused variable ‘ret’ [-Wunused-variable]
  int ret;
      ^~~

Remove the unused varable.

Fixes: 9400c41e77b8 ("spi: dw: Convert to use CS GPIO descriptors")
Reported-by: Stephen Rothwell <email address hidden>
Signed-off-by: Anders Roxell <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 4f0a0cd52d6c812fbf737e436b18f04eac2e312e)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

25ae772... by Linus Walleij

spi: dw: Convert to use CS GPIO descriptors

BugLink: https://bugs.launchpad.net/bugs/1826142

This converts the DesignWare (dw) SPI master driver to
use GPIO descriptors for chip select handling.

This driver has a duplicate DT parser in addition to the
one in the core, sets up the line as non-asserted and
relies on the core to drive the GPIOs.

It is a pretty straight-forward conversion.

Cc: Talel Shenhar <email address hidden>
Cc: Simon Goldschmidt <email address hidden>
Cc: Alexandre Belloni <email address hidden>
Cc: Linuxarm <email address hidden>
Tested-by: Jay Fang <email address hidden>
Reviewed-by: Alexandre Belloni <email address hidden>
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 9400c41e77b8f1f9c711b08a6c79bdbc5681fb00)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

b3fbaa6... by Linus Walleij

spi: Optionally use GPIO descriptors for CS GPIOs

BugLink: https://bugs.launchpad.net/bugs/1826142

This augments the SPI core to optionally use GPIO descriptors
for chip select on a per-master-driver opt-in basis.

Drivers using this will rely on the SPI core to look up
GPIO descriptors associated with the device, such as
when using device tree or board files with GPIO descriptor
tables.

When getting descriptors from the device tree, this will in
turn activate the code in gpiolib that was
added in commit 6953c57ab172
("gpio: of: Handle SPI chipselect legacy bindings")
which means that these descriptors are aware of the active
low semantics that is the default for SPI CS GPIO lines
and we can assume that all of these are "active high" and
thus assign SPI_CS_HIGH to all CS lines on the DT path.

The previously used gpio_set_value() would call down into
gpiod_set_raw_value() and ignore the polarity inversion
semantics.

It seems like many drivers go to great lengths to set up the
CS GPIO line as non-asserted, respecting SPI_CS_HIGH. We pull
this out of the SPI drivers and into the core, and by simply
requesting the line as GPIOD_OUT_LOW when retrieveing it from
the device and relying on the gpiolib to handle any inversion
semantics. This way a lot of code can be simplified and
removed in each converted driver.

The end goal after dealing with each driver in turn, is to
delete the non-descriptor path (of_spi_register_master() for
example) and let the core deal with only descriptors.

The different SPI drivers have complex interactions with the
core so we cannot simply change them all over, we need to use
a stepwise, bisectable approach so that each driver can be
converted and fixed in isolation.

This patch has the intended side effect of adding support for
ACPI GPIOs as it starts relying on gpiod_get_*() to get
the GPIO handle associated with the device.

Cc: Linuxarm <email address hidden>
Acked-by: Jonathan Cameron <email address hidden>
Tested-by: Fangjian (Turing) <email address hidden>
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit f3186dd876697e696d07136623d5cf0a6fb0bc0f)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

7d77182... by Josh Poimboeuf

x86/speculation/mds: Fix documentation typo

Fix a minor typo in the MDS documentation: "eanbled" -> "enabled".

Reported-by: Jeff Bastian <email address hidden>
Signed-off-by: Josh Poimboeuf <email address hidden>
Signed-off-by: Thomas Gleixner <email address hidden>

CVE-2018-12126
CVE-2018-12127
CVE-2018-12130
CVE-2019-11091

(cherry picked from commit 95310e348a321b45fb746c176961d4da72344282)
Signed-off-by: Tyler Hicks <email address hidden>
Acked-by: Kleber Sacilotto de Souza <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>