At least some PL2303GT have a bcdDevice of 0x305 instead of 0x100 as the
datasheet claims. Add it to the list of known release numbers for the
HXN (G) type.
Fixes: 894758d0571d ("USB: serial: pl2303: tighten type HXN (G) detection")
Reported-by: Vasily Khoruzhick <anarsoul(a)gmail.com>
Tested-by: Vasily Khoruzhick <anarsoul(a)gmail.com>
Cc: stable(a)vger.kernel.org # 5.13
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/usb/serial/pl2303.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 17601e32083e..930b3d50a330 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -432,6 +432,7 @@ static int pl2303_detect_type(struct usb_serial *serial)
case 0x200:
switch (bcdDevice) {
case 0x100:
+ case 0x305:
/*
* Assume it's an HXN-type if the device doesn't
* support the old read request value.
--
2.31.1
The physical address may exceed 32 bits on 32-bit systems with
more than 32 bits of physcial address,use PFN_PHYS() in devmem_is_allowed(),
or the physical address may overflow and be truncated.
We found this bug when mapping a high addresses through devmem tool,
when CONFIG_STRICT_DEVMEM is enabled on the ARM with ARM_LPAE and devmem
is used to map a high address that is not in the iomem address range,
an unexpected error indicating no permission is returned.
This bug was initially introduced from v2.6.37, and the function was moved
to lib when v5.11.
Cc: Luis Chamberlain <mcgrof(a)kernel.org>
Fixes: 087aaffcdf9c ("ARM: implement CONFIG_STRICT_DEVMEM by disabling access to RAM via /dev/mem")
Fixes: 527701eda5f1 ("lib: Add a generic version of devmem_is_allowed()")
Cc: stable(a)vger.kernel.org # v2.6.37
Signed-off-by: Liang Wang <wangliang101(a)huawei.com>
---
v3: update changelog suggested by Luis Chamberlain <mcgrof(a)kernel.org>
lib/devmem_is_allowed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/devmem_is_allowed.c b/lib/devmem_is_allowed.c
index c0d67c541849..60be9e24bd57 100644
--- a/lib/devmem_is_allowed.c
+++ b/lib/devmem_is_allowed.c
@@ -19,7 +19,7 @@
*/
int devmem_is_allowed(unsigned long pfn)
{
- if (iomem_is_exclusive(pfn << PAGE_SHIFT))
+ if (iomem_is_exclusive(PFN_PHYS(pfn)))
return 0;
if (!page_is_ram(pfn))
return 1;
--
2.32.0
On 2021/7/30 14:49, Liang Wang wrote:
> The physical address may exceed 32 bits on ARM(when ARM_LPAE enabled),
> use PFN_PHYS() in devmem_is_allowed(), or the physical address may
> overflow and be truncated.
>
> This bug was initially introduced from v2.6.37, and the function was moved
> to lib when v5.10.
>
> Fixes: 087aaffcdf9c ("ARM: implement CONFIG_STRICT_DEVMEM by disabling access to RAM via /dev/mem")
> Fixes: 527701eda5f1 ("lib: Add a generic version of devmem_is_allowed()")
> Cc: stable(a)vger.kernel.org # v2.6.37
> Signed-off-by: Liang Wang <wangliang101(a)huawei.com>
Reviewed-by: Kefeng Wang <wangkefeng.wang(a)huawei.com>
> ---
> v2: update subject and changelog
> lib/devmem_is_allowed.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/devmem_is_allowed.c b/lib/devmem_is_allowed.c
> index c0d67c541849..60be9e24bd57 100644
> --- a/lib/devmem_is_allowed.c
> +++ b/lib/devmem_is_allowed.c
> @@ -19,7 +19,7 @@
> */
> int devmem_is_allowed(unsigned long pfn)
> {
> - if (iomem_is_exclusive(pfn << PAGE_SHIFT))
> + if (iomem_is_exclusive(PFN_PHYS(pfn)))
> return 0;
> if (!page_is_ram(pfn))
> return 1;
This is the start of the stable review cycle for the 4.14.242 release.
There are 38 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed, 04 Aug 2021 13:43:24 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.242-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.14.242-rc1
Arnaldo Carvalho de Melo <acme(a)redhat.com>
Revert "perf map: Fix dso->nsinfo refcounting"
Dan Carpenter <dan.carpenter(a)oracle.com>
can: hi311x: fix a signedness bug in hi3110_cmd()
Wang Hai <wanghai38(a)huawei.com>
sis900: Fix missing pci_disable_device() in probe and remove
Wang Hai <wanghai38(a)huawei.com>
tulip: windbond-840: Fix missing pci_disable_device() in probe and remove
Marcelo Ricardo Leitner <marcelo.leitner(a)gmail.com>
sctp: fix return value check in __sctp_rcv_asconf_lookup
Maor Gottlieb <maorg(a)nvidia.com>
net/mlx5: Fix flow table chaining
Pavel Skripkin <paskripkin(a)gmail.com>
net: llc: fix skb_over_panic
Jiapeng Chong <jiapeng.chong(a)linux.alibaba.com>
mlx4: Fix missing error code in mlx4_load_one()
Hoang Le <hoang.h.le(a)dektech.com.au>
tipc: fix sleeping in tipc accept routine
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_nat: allow to specify layer 4 protocol NAT only
Florian Westphal <fw(a)strlen.de>
netfilter: conntrack: adjust stop timestamp to real expiry value
Nguyen Dinh Phi <phind.uet(a)gmail.com>
cfg80211: Fix possible memory leak in function cfg80211_bss_update
Jan Kiszka <jan.kiszka(a)siemens.com>
x86/asm: Ensure asm/proto.h can be included stand-alone
Krzysztof Kozlowski <krzysztof.kozlowski(a)canonical.com>
nfc: nfcsim: fix use after free during module unload
Paul Jakma <paul(a)jakma.org>
NIU: fix incorrect error return, missed in previous revert
Pavel Skripkin <paskripkin(a)gmail.com>
can: esd_usb2: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: ems_usb: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: usb_8dev: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: mcba_usb_start(): add missing urb->transfer_dma initialization
Ziyang Xuan <william.xuanziyang(a)huawei.com>
can: raw: raw_setsockopt(): fix raw_rcv panic for sock UAF
Junxiao Bi <junxiao.bi(a)oracle.com>
ocfs2: issue zeroout to EOF blocks
Junxiao Bi <junxiao.bi(a)oracle.com>
ocfs2: fix zero out valid data
Juergen Gross <jgross(a)suse.com>
x86/kvm: fix vcpu-id indexed array sizes
Eric Dumazet <edumazet(a)google.com>
gro: ensure frag0 meets IP header alignment
Eric Dumazet <edumazet(a)google.com>
virtio_net: Do not pull payload in skb->head
Sudeep Holla <sudeep.holla(a)arm.com>
ARM: dts: versatile: Fix up interrupt controller node names
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
hfs: add lock nesting notation to hfs_find_init
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
hfs: fix high memory mapping in hfs_bnode_read
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
hfs: add missing clean-up in hfs_fill_super
Xin Long <lucien.xin(a)gmail.com>
sctp: move 198 addresses from unusable to private scope
Eric Dumazet <edumazet(a)google.com>
net: annotate data race around sk_ll_usec
Yang Yingliang <yangyingliang(a)huawei.com>
net/802/garp: fix memleak in garp_request_join()
Yang Yingliang <yangyingliang(a)huawei.com>
net/802/mrp: fix memleak in mrp_request_join()
Yang Yingliang <yangyingliang(a)huawei.com>
workqueue: fix UAF in pwq_unbound_release_workfn()
Miklos Szeredi <mszeredi(a)redhat.com>
af_unix: fix garbage collect vs MSG_PEEK
Jens Axboe <axboe(a)kernel.dk>
net: split out functions related to registering inflight socket files
Maxim Levitsky <mlevitsk(a)redhat.com>
KVM: x86: determine if an exception has an error code only when injecting it.
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
selftest: fix build error in tools/testing/selftests/vm/userfaultfd.c
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/dts/versatile-ab.dts | 5 +-
arch/arm/boot/dts/versatile-pb.dts | 2 +-
arch/x86/include/asm/proto.h | 2 +
arch/x86/kvm/ioapic.c | 2 +-
arch/x86/kvm/ioapic.h | 4 +-
arch/x86/kvm/x86.c | 13 +-
drivers/net/can/spi/hi311x.c | 2 +-
drivers/net/can/usb/ems_usb.c | 14 +-
drivers/net/can/usb/esd_usb2.c | 16 ++-
drivers/net/can/usb/mcba_usb.c | 2 +
drivers/net/can/usb/usb_8dev.c | 15 ++-
drivers/net/ethernet/dec/tulip/winbond-840.c | 7 +-
drivers/net/ethernet/mellanox/mlx4/main.c | 1 +
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 10 +-
drivers/net/ethernet/sis/sis900.c | 7 +-
drivers/net/ethernet/sun/niu.c | 3 +-
drivers/net/virtio_net.c | 10 +-
drivers/nfc/nfcsim.c | 3 +-
fs/hfs/bfind.c | 14 +-
fs/hfs/bnode.c | 25 +++-
fs/hfs/btree.h | 7 +
fs/hfs/super.c | 10 +-
fs/ocfs2/file.c | 103 +++++++++------
include/linux/skbuff.h | 9 ++
include/linux/virtio_net.h | 14 +-
include/net/af_unix.h | 1 +
include/net/busy_poll.h | 2 +-
include/net/llc_pdu.h | 31 +++--
include/net/sctp/constants.h | 4 +-
kernel/workqueue.c | 20 ++-
net/802/garp.c | 14 ++
net/802/mrp.c | 14 ++
net/Makefile | 2 +-
net/can/raw.c | 20 ++-
net/core/dev.c | 3 +-
net/core/sock.c | 2 +-
net/llc/af_llc.c | 10 +-
net/llc/llc_s_ac.c | 2 +-
net/netfilter/nf_conntrack_core.c | 7 +-
net/netfilter/nft_nat.c | 4 +-
net/sctp/input.c | 2 +-
net/sctp/protocol.c | 3 +-
net/tipc/socket.c | 9 +-
net/unix/Kconfig | 5 +
net/unix/Makefile | 2 +
net/unix/af_unix.c | 102 +++++++--------
net/unix/garbage.c | 68 +---------
net/unix/scm.c | 149 ++++++++++++++++++++++
net/unix/scm.h | 10 ++
net/wireless/scan.c | 6 +-
tools/perf/util/map.c | 2 -
tools/testing/selftests/vm/userfaultfd.c | 2 +-
53 files changed, 540 insertions(+), 260 deletions(-)
The patch titled
Subject: lib: use PFN_PHYS() in devmem_is_allowed()
has been added to the -mm tree. Its filename is
lib-use-pfn_phys-in-devmem_is_allowed.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/lib-use-pfn_phys-in-devmem_is_all…
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/lib-use-pfn_phys-in-devmem_is_all…
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Liang Wang <wangliang101(a)huawei.com>
Subject: lib: use PFN_PHYS() in devmem_is_allowed()
The physical address may exceed 32 bits on 32-bit systems with more than
32 bits of physcial address,use PFN_PHYS() in devmem_is_allowed(), or the
physical address may overflow and be truncated.
We found this bug when mapping a high addresses through devmem tool, when
CONFIG_STRICT_DEVMEM is enabled on the ARM with ARM_LPAE and devmem is
used to map a high address that is not in the iomem address range, an
unexpected error indicating no permission is returned.
This bug was initially introduced from v2.6.37, and the function was moved
to lib when v5.11.
Link: https://lkml.kernel.org/r/20210731025057.78825-1-wangliang101@huawei.com
Fixes: 087aaffcdf9c ("ARM: implement CONFIG_STRICT_DEVMEM by disabling access to RAM via /dev/mem")
Fixes: 527701eda5f1 ("lib: Add a generic version of devmem_is_allowed()")
Signed-off-by: Liang Wang <wangliang101(a)huawei.com>
Cc: Palmer Dabbelt <palmerdabbelt(a)google.com>
Cc: Luis Chamberlain <mcgrof(a)kernel.org>
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: Russell King <linux(a)armlinux.org.uk>
Cc: Liang Wang <wangliang101(a)huawei.com>
Cc: Xiaoming Ni <nixiaoming(a)huawei.com>
Cc: Kefeng Wang <wangkefeng.wang(a)huawei.com>
Cc: <stable(a)vger.kernel.org> [2.6.37+]
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
lib/devmem_is_allowed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/devmem_is_allowed.c~lib-use-pfn_phys-in-devmem_is_allowed
+++ a/lib/devmem_is_allowed.c
@@ -19,7 +19,7 @@
*/
int devmem_is_allowed(unsigned long pfn)
{
- if (iomem_is_exclusive(pfn << PAGE_SHIFT))
+ if (iomem_is_exclusive(PFN_PHYS(pfn)))
return 0;
if (!page_is_ram(pfn))
return 1;
_
Patches currently in -mm which might be from wangliang101(a)huawei.com are
lib-use-pfn_phys-in-devmem_is_allowed.patch