4.14.322-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 140/204 net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()/cpsw_ale_set_field()
In reply to Greg Kroah-HartmanFrom: Tanmay Patil <[email protected]>
[ Upstream commit b685f1a58956fa36cc01123f253351b25bfacfda ]
CPSW ALE has 75 bit ALE entries which are stored within three 32 bit words. The cpsw_ale_get_field() and cpsw_ale_set_field() functions assume that the field will be strictly contained within one word. However, this is not guaranteed to be the case and it is possible for ALE field entries to span across up to two words at the most.
Fix the methods to handle getting/setting fields spanning up to two words.
--- drivers/net/ethernet/ti/cpsw_ale.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
drivers/net/ethernet/ti/cpsw_ale.c +19 -5
@@ -67,23 +67,37 @@static inline int cpsw_ale_get_field (u32 *ale_entry,u32 start,u32 bits) { -int idx; +int idx, idx2; +u32 hi_val =0 ; idx = start /32 ; + idx2 = (start + bits -1 ) /32 ; +/* Check if bits to be fetched exceed a word */ +if (idx != idx2) { + idx2 =2 - idx2;/* flip */ + hi_val = ale_entry[idx2] << ((idx2 *32 ) - start); + } start -= idx *32 ; idx =2 - idx;/* flip */ -return (ale_entry[idx] >> start) &BITMASK (bits); +return (hi_val + (ale_entry[idx] >> start)) &BITMASK (bits); }static inline void cpsw_ale_set_field (u32 *ale_entry,u32 start,u32 bits,u32 value) { -int idx; +int idx, idx2; value &=BITMASK (bits); - idx = start /32 ; + idx = start /32 ; + idx2 = (start + bits -1 ) /32 ; +/* Check if bits to be set exceed a word */ +if (idx != idx2) { + idx2 =2 - idx2;/* flip */ + ale_entry[idx2] &= ~(BITMASK (bits + start - (idx2 *32 ))); + ale_entry[idx2] |= (value >> ((idx2 *32 ) - start)); + } start -= idx *32 ; - idx =2 - idx;/* flip */ + idx =2 - idx;/* flip */ ale_entry[idx] &= ~(BITMASK (bits) << start); ale_entry[idx] |= (value << start); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 141/204 fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe
In reply to Greg Kroah-HartmanFrom: Zhang Shurong <[email protected]>
[ Upstream commit 4e88761f5f8c7869f15a2046b1a1116f4fab4ac8 ]
This func misses checking for platform_get_irq()'s call and may passes the negative error codes to request_irq(), which takes unsigned IRQ #, causing it to fail with -EINVAL, overriding an original error code.
Fix this by stop calling request_irq() with invalid IRQ #s.
--- drivers/video/fbdev/au1200fb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/fbdev/au1200fb.c +3 -0
@@ -1748,6 +1748,9 @@ static int au1200fb_drv_probe(struct platform_device *dev)/* Now hook interrupt too */ irq =platform_get_irq (dev,0 ); +if (irq <0 ) +return irq; + ret =request_irq (irq, au1200fb_handle_irq,IRQF_SHARED ,"lcd" , (void *)dev);if (ret) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 142/204 llc: Dont drop packet from non-root netns.
In reply to Greg Kroah-HartmanFrom: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 6631463b6e6673916d2481f692938f393148aa82 ]
Now these upper layer protocol handlers can be called from llc_rcv() as sap->rcv_func(), which is registered by llc_sap_open().
* function which is passed to register_8022_client()
-> no in-kernel user calls register_8022_client().
* snap_rcv()
`- proto->rcvfunc() : registered by register_snap_client()
-> aarp_rcv() and atalk_rcv() drop packets from non-root netns * stp_pdu_rcv()
`- garp_protos[]->rcv() : registered by stp_proto_register()
-> garp_pdu_rcv() and br_stp_rcv() are netns-awareSo, we can safely remove the netns restriction in llc_rcv().
--- net/llc/llc_input.c | 3 --- 1 file changed, 3 deletions(-)
net/llc/llc_input.c +0 -3
@@ -162,9 +162,6 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,void (*sta_handler)(struct sk_buff *skb);void (*sap_handler)(struct llc_sap *sap,struct sk_buff *skb); -if (!net_eq (dev_net (dev), &init_net)) - goto drop; -/* * When the interface is in promisc. mode, drop all the crap that it * receives, do not try to analyse it.
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 143/204 netfilter: nf_tables: fix spurious set element insertion failure
In reply to Greg Kroah-HartmanFrom: Florian Westphal <[email protected]>
[ Upstream commit ddbd8be68941985f166f5107109a90ce13147c44 ]
On some platforms there is a padding hole in the nft_verdict structure, between the verdict code and the chain pointer.
On element insertion, if the new element clashes with an existing one and NLM_F_EXCL flag isn't set, we want to ignore the -EEXIST error as long as the data associated with duplicated element is the same as the existing one. The data equality check uses memcmp.
For normal data (NFT_DATA_VALUE) this works fine, but for NFT_DATA_VERDICT padding area leads to spurious failure even if the verdict data is the same.
This then makes the insertion fail with 'already exists' error, even though the new "key : data" matches an existing entry and userspace told the kernel that it doesn't want to receive an error indication.
--- net/netfilter/nf_tables_api.c | 3 +++ 1 file changed, 3 insertions(+)
net/netfilter/nf_tables_api.c +3 -0
@@ -5852,6 +5852,9 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data,if (!tb[NFTA_VERDICT_CODE ])return -EINVAL ; + +/* zero padding hole for memcmp */ +memset (data,0 ,sizeof (*data)); data->verdict.code =ntohl (nla_get_be32 (tb[NFTA_VERDICT_CODE ]));switch (data->verdict.code) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 144/204 tcp: annotate data-races around rskq_defer_accept
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit ae488c74422fb1dcd807c0201804b3b5e8a322a3 ]
do_tcp_getsockopt() reads rskq_defer_accept while another cpu might change its value.
--- net/ipv4/tcp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
net/ipv4/tcp.c +6 -5
@@ -2729,9 +2729,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level,case TCP_DEFER_ACCEPT :/* Translate value in seconds to number of retransmits */ - icsk->icsk_accept_queue.rskq_defer_accept = -secs_to_retrans (val,TCP_TIMEOUT_INIT /HZ , -TCP_RTO_MAX /HZ ); +WRITE_ONCE (icsk->icsk_accept_queue.rskq_defer_accept, +secs_to_retrans (val,TCP_TIMEOUT_INIT /HZ , +TCP_RTO_MAX /HZ ));break ;case TCP_WINDOW_CLAMP :
@@ -3067,8 +3067,9 @@ static int do_tcp_getsockopt(struct sock *sk, int level, val = (val ? : net->ipv4.sysctl_tcp_fin_timeout) /HZ ;break ;case TCP_DEFER_ACCEPT : - val =retrans_to_secs (icsk->icsk_accept_queue.rskq_defer_accept, -TCP_TIMEOUT_INIT /HZ ,TCP_RTO_MAX /HZ ); + val =READ_ONCE (icsk->icsk_accept_queue.rskq_defer_accept); + val =retrans_to_secs (val,TCP_TIMEOUT_INIT /HZ , +TCP_RTO_MAX /HZ );break ;case TCP_WINDOW_CLAMP : val = tp->window_clamp;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 145/204 tcp: annotate data-races around tp->notsent_lowat
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 1aeb87bc1440c5447a7fa2d6e3c2cca52cbd206b ]
tp->notsent_lowat can be read locklessly from do_tcp_getsockopt() and tcp_poll().
--- include/net/tcp.h | 6 +++++- net/ipv4/tcp.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-)
include/net/tcp.h +5 -1
@@ -1887,7 +1887,11 @@ void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, __be32 daddr);static inline u32 tcp_notsent_lowat (const struct tcp_sock *tp) {struct net *net =sock_net ((struct sock *)tp); -return tp->notsent_lowat ?:READ_ONCE (net->ipv4.sysctl_tcp_notsent_lowat); +u32 val; + + val =READ_ONCE (tp->notsent_lowat); + +return val ?:READ_ONCE (net->ipv4.sysctl_tcp_notsent_lowat); }static inline bool tcp_stream_memory_free (const struct sock *sk)
net/ipv4/tcp.c +2 -2
@@ -2810,7 +2810,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, err =tcp_repair_set_window (tp, optval, optlen);break ;case TCP_NOTSENT_LOWAT : - tp->notsent_lowat = val; +WRITE_ONCE (tp->notsent_lowat, val); sk->sk_write_space (sk);break ;default :
@@ -3204,7 +3204,7 @@ static int do_tcp_getsockopt(struct sock *sk, int level, val =tcp_time_stamp_raw () + tp->tsoffset;break ;case TCP_NOTSENT_LOWAT : - val = tp->notsent_lowat; + val =READ_ONCE (tp->notsent_lowat);break ;case TCP_SAVE_SYN : val = tp->save_syn;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 146/204 tcp: annotate data-races around fastopenq.max_qlen
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 70f360dd7042cb843635ece9d28335a4addff9eb ]
This field can be read locklessly.
--- include/linux/tcp.h | 2 +- net/ipv4/tcp.c | 2 +- net/ipv4/tcp_fastopen.c | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-)
include/linux/tcp.h +1 -1
@@ -425,7 +425,7 @@ static inline void fastopen_queue_tune(sstruct request_sock_queue *queue = &inet_csk (sk)->icsk_accept_queue;int somaxconn =READ_ONCE (sock_net (sk)->core.sysctl_somaxconn); - queue->fastopenq.max_qlen = min_t(unsigned int, backlog, somaxconn); + WRITE_ONCE(queue->fastopenq.max_qlen, min_t(unsigned int, backlog, somaxconn)); } static inline void tcp_move_syn(struct tcp_sock *tp,
net/ipv4/tcp.c +1 -1
@@ -3193,7 +3193,7 @@ static int do_tcp_getsockopt(struct sockbreak ;case TCP_FASTOPEN : - val = icsk->icsk_accept_queue.fastopenq.max_qlen; + val =READ_ONCE (icsk->icsk_accept_queue.fastopenq.max_qlen);break ;case TCP_FASTOPEN_CONNECT :
net/ipv4/tcp_fastopen.c +4 -2
@@ -239,6 +239,7 @@ static struct sock *tcp_fastopen_create_static bool tcp_fastopen_queue_check (struct sock *sk) {struct fastopen_queue *fastopenq; +int max_qlen;/* Make sure the listener has enabled fastopen, and we don't * exceed the max # of pending TFO requests allowed before trying
@@ -251,10 +252,11 @@ static bool tcp_fastopen_queue_check(str* temporarily vs a server not supporting Fast Open at all. */ fastopenq = &inet_csk (sk)->icsk_accept_queue.fastopenq; -if (fastopenq->max_qlen ==0 ) + max_qlen =READ_ONCE (fastopenq->max_qlen); +if (max_qlen ==0 )return false; -if (fastopenq->qlen >= fastopenq->max_qlen) { +if (fastopenq->qlen >= max_qlen) {struct request_sock *req1;spin_lock (&fastopenq->lock); req1 = fastopenq->rskq_rst_head;
Greg Kroah-Hartman
maintainerPATCH 147/204 gpio: tps68470: Make tps68470_gpio_output() always set the initial value
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 5a7adc6c1069ce31ef4f606ae9c05592c80a6ab5 ]
Make tps68470_gpio_output() call tps68470_gpio_set() for output-only pins too, so that the initial value passed to gpiod_direction_output() is honored for these pins too.
--- drivers/gpio/gpio-tps68470.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpio/gpio-tps68470.c +3 -3
@@ -99,13 +99,13 @@ static int tps68470_gpio_output(struct gpio_chip *gc, unsigned int offset,struct tps68470_gpio_data *tps68470_gpio =gpiochip_get_data (gc);struct regmap *regmap = tps68470_gpio->tps68470_regmap; +/* Set the initial value */ +tps68470_gpio_set (gc, offset, value); +/* rest are always outputs */ if (offset >=TPS68470_N_REGULAR_GPIO )return 0 ; -/* Set the initial value */ -tps68470_gpio_set (gc, offset, value); -return regmap_update_bits (regmap,TPS68470_GPIO_CTL_REG_A (offset),TPS68470_GPIO_MODE_MASK ,TPS68470_GPIO_MODE_OUT_CMOS );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 148/204 i40e: Fix an NULL vs IS_ERR() bug for debugfs_create_dir()
In reply to Greg Kroah-HartmanFrom: Wang Ming <[email protected]>
[ Upstream commit 043b1f185fb0f3939b7427f634787706f45411c4 ]
The debugfs_create_dir() function returns error pointers. It never returns NULL. Most incorrect error checks were fixed, but the one in i40e_dbg_init() was forgotten.
Fix the remaining error check.
--- drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_debugfs.c +1 -1
@@ -1850,7 +1850,7 @@ void i40e_dbg_pf_exit(struct i40e_pf *pf)void i40e_dbg_init (void ) { i40e_dbg_root =debugfs_create_dir (i40e_driver_name,NULL ); -if (!i40e_dbg_root) +if (IS_ERR (i40e_dbg_root))pr_info ("init of debugfs failed\n" ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 149/204 ethernet: atheros: fix return value check in atl1e_tso_csum()
In reply to Greg Kroah-HartmanFrom: Yuanjun Gong <[email protected]>
[ Upstream commit 69a184f7a372aac588babfb0bd681aaed9779f5b ]
in atl1e_tso_csum, it should check the return value of pskb_trim(), and return an error code if an unexpected value is returned by pskb_trim().
--- drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/atheros/atl1e/atl1e_main.c +5 -2
@@ -1650,8 +1650,11 @@ static int atl1e_tso_csum(struct atl1e_adapter *adapter, real_len = (((unsigned char *)ip_hdr (skb) - skb->data) +ntohs (ip_hdr (skb)->tot_len)); -if (real_len < skb->len) -pskb_trim (skb, real_len); +if (real_len < skb->len) { + err =pskb_trim (skb, real_len); +if (err) +return err; + } hdr_len = (skb_transport_offset (skb) +tcp_hdrlen (skb));if (unlikely (skb->len == hdr_len)) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 150/204 ipv6 addrconf: fix bug where deleting a mngtmpaddr can create a new temporary address
In reply to Greg Kroah-HartmanFrom: Maciej Żenczykowski <[email protected]>
[ Upstream commit 69172f0bcb6a09110c5d2a6d792627f5095a9018 ]
currently on 6.4 net/main:
# ip link add dummy1 type dummy # echo 1 > /proc/sys/net/ipv6/conf/dummy1/use_tempaddr # ip link set dummy1 up # ip -6 addr add 2000::1/64 mngtmpaddr dev dummy1 # ip -6 addr show dev dummy1
11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
inet6 2000::44f3:581c:8ca:3983/64 scope global temporary dynamic
valid_lft 604800sec preferred_lft 86172sec
inet6 2000::1/64 scope global mngtmpaddr
valid_lft forever preferred_lft forever
inet6 fe80::e8a8:a6ff:fed5:56d4/64 scope link
valid_lft forever preferred_lft forever# ip -6 addr del 2000::44f3:581c:8ca:3983/64 dev dummy1
(can wait a few seconds if you want to, the above delete isn't [directly] the problem)
# ip -6 addr show dev dummy1
11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
inet6 2000::1/64 scope global mngtmpaddr
valid_lft forever preferred_lft forever
inet6 fe80::e8a8:a6ff:fed5:56d4/64 scope link
valid_lft forever preferred_lft forever
# ip -6 addr del 2000::1/64 mngtmpaddr dev dummy1 # ip -6 addr show dev dummy1
11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
inet6 2000::81c9:56b7:f51a:b98f/64 scope global temporary dynamic
valid_lft 604797sec preferred_lft 86169sec
inet6 fe80::e8a8:a6ff:fed5:56d4/64 scope link
valid_lft forever preferred_lft foreverThis patch prevents this new 'global temporary dynamic' address from being created by the deletion of the related (same subnet prefix) 'mngtmpaddr' (which is triggered by there already being no temporary addresses).
--- net/ipv6/addrconf.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
net/ipv6/addrconf.c +10 -4
@@ -2436,12 +2436,18 @@ static void manage_tempaddrs(struct inet6_dev *idev,ipv6_ifa_notify (0 , ift); } -if ((create ||list_empty (&idev->tempaddr_list)) && - idev->cnf.use_tempaddr >0 ) { +/* Also create a temporary address if it's enabled but no temporary +* address currently exists. +* However, we get called with valid_lft == 0, prefered_lft == 0, create == false +* as part of cleanup (ie. deleting the mngtmpaddr). +* We don't want that to result in creating a new temporary ip address. +*/ +if (list_empty (&idev->tempaddr_list) && (valid_lft || prefered_lft)) + create = true; + +if (create && idev->cnf.use_tempaddr >0 ) {/* When a new public address is created as described * in [ADDRCONF], also create a new temporary address. -* Also create a temporary address if it's enabled but -* no temporary address currently exists. */ read_unlock_bh (&idev->lock);ipv6_create_tempaddr (ifp,NULL );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 151/204 tcp: Reduce chance of collisions in inet6_hashfn().
In reply to Greg Kroah-HartmanFrom: Stewart Smith <[email protected]>
[ Upstream commit d11b0df7ddf1831f3e170972f43186dad520bfcc ]
For both IPv4 and IPv6 incoming TCP connections are tracked in a hash table with a hash over the source & destination addresses and ports. However, the IPv6 hash is insufficient and can lead to a high rate of collisions.
The IPv6 hash used an XOR to fit everything into the 96 bits for the fast jenkins hash, meaning it is possible for an external entity to ensure the hash collides, thus falling back to a linear search in the bucket, which is slow.
We take the approach of hash the full length of IPv6 address in __ipv6_addr_jhash() so that all users can benefit from a more secure version.
While this may look like it adds overhead, the reality of modern CPUs means that this is unmeasurable in real world scenarios.
In simulating with llvm-mca, the increase in cycles for the hashing code was ~16 cycles on Skylake (from a base of ~155), and an extra ~9 on Nehalem (base of ~173).
In commit dd6d2910c5e0 ("netfilter: conntrack: switch to siphash") netfilter switched from a jenkins hash to a siphash, but even the faster hsiphash is a more significant overhead (~20-30%) in some preliminary testing. So, in this patch, we keep to the more conservative approach to ensure we don't add much overhead per SYN.
In testing, this results in a consistently even spread across the connection buckets. In both testing and real-world scenarios, we have not found any measurable performance impact.
--- include/net/ipv6.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
include/net/ipv6.h +2 -6
@@ -540,12 +540,8 @@ static inline u32 ipv6_addr_hash(const struct in6_addr *a)/* more secured version of ipv6_addr_hash() */ static inline u32 __ipv6_addr_jhash (const struct in6_addr *a,const u32 initval) { -u32 v = (__force u32 )a->s6_addr32[0 ] ^ (__force u32 )a->s6_addr32[1 ]; - -return jhash_3words (v, - (__force u32 )a->s6_addr32[2 ], - (__force u32 )a->s6_addr32[3 ], - initval); +return jhash2 ((__force const u32 *)a->s6_addr32, +ARRAY_SIZE (a->s6_addr32), initval); }static inline bool ipv6_addr_loopback (const struct in6_addr *a)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 152/204 bonding: reset bonds flags when down link is P2P device
In reply to Greg Kroah-HartmanFrom: Hangbin Liu <[email protected]>
[ Upstream commit da19a2b967cf1e2c426f50d28550d1915214a81d ]
When adding a point to point downlink to the bond, we neglected to reset the bond's flags, which were still using flags like BROADCAST and MULTICAST. Consequently, this would initiate ARP/DAD for P2P downlink interfaces, such as when adding a GRE device to the bonding.
To address this issue, let's reset the bond's flags for P2P interfaces.
Before fix:
7: gre0@NONE: <POINTOPOINT,NOARP,SLAVE,UP,LOWER_UP> mtu 1500 qdisc noqueue master bond0 state UNKNOWN group default qlen 1000
link/gre6 2006:70:10::1 peer 2006:70:10::2 permaddr 167f:18:f188::
8: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/gre6 2006:70:10::1 brd 2006:70:10::2
inet6 fe80::200:ff:fe00:0/64 scope link
valid_lft forever preferred_lft foreverAfter fix:
7: gre0@NONE: <POINTOPOINT,NOARP,SLAVE,UP,LOWER_UP> mtu 1500 qdisc noqueue master bond2 state UNKNOWN group default qlen 1000
link/gre6 2006:70:10::1 peer 2006:70:10::2 permaddr c29e:557a:e9d9::
8: bond0: <POINTOPOINT,NOARP,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/gre6 2006:70:10::1 peer 2006:70:10::2
inet6 fe80::1/64 scope link
valid_lft forever preferred_lft forever--- drivers/net/bonding/bond_main.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/bonding/bond_main.c +5 -0
@@ -1134,6 +1134,11 @@ static void bond_setup_by_slave(struct net_device *bond_dev,memcpy (bond_dev->broadcast, slave_dev->broadcast, slave_dev->addr_len); + +if (slave_dev->flags &IFF_POINTOPOINT ) { + bond_dev->flags &= ~(IFF_BROADCAST |IFF_MULTICAST ); + bond_dev->flags |= (IFF_POINTOPOINT |IFF_NOARP ); + } }/* On bonding slaves other than the currently active slave, suppress
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 153/204 team: reset teams flags when down link is P2P device
In reply to Greg Kroah-HartmanFrom: Hangbin Liu <[email protected]>
[ Upstream commit fa532bee17d15acf8bba4bc8e2062b7a093ba801 ]
When adding a point to point downlink to team device, we neglected to reset the team's flags, which were still using flags like BROADCAST and MULTICAST. Consequently, this would initiate ARP/DAD for P2P downlink interfaces, such as when adding a GRE device to team device. Fix this by remove multicast/broadcast flags and add p2p and noarp flags.
After removing the none ethernet interface and adding an ethernet interface to team, we need to reset team interface flags. Unlike bonding interface, team do not need restore IFF_MASTER, IFF_SLAVE flags.
--- drivers/net/team/team.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/team/team.c +9 -0
@@ -2095,6 +2095,15 @@ static void team_setup_by_port(struct net_device *dev, dev->mtu = port_dev->mtu;memcpy (dev->broadcast, port_dev->broadcast, port_dev->addr_len);eth_hw_addr_inherit (dev, port_dev); + +if (port_dev->flags &IFF_POINTOPOINT ) { + dev->flags &= ~(IFF_BROADCAST |IFF_MULTICAST ); + dev->flags |= (IFF_POINTOPOINT |IFF_NOARP ); + }else if ((port_dev->flags & (IFF_BROADCAST |IFF_MULTICAST )) == + (IFF_BROADCAST |IFF_MULTICAST )) { + dev->flags |= (IFF_BROADCAST |IFF_MULTICAST ); + dev->flags &= ~(IFF_POINTOPOINT |IFF_NOARP ); + } } static int team_dev_type_check_change(struct net_device *dev,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 154/204 platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100
In reply to Greg Kroah-HartmanFrom: Maxim Mikityanskiy <[email protected]>
[ Upstream commit ad084a6d99bc182bf109c190c808e2ea073ec57b ]
Only the HW rfkill state is toggled on laptops with quirks->ec_read_only (so far only MSI Wind U90/U100). There are, however, a few issues with the implementation:
1. The initial HW state is always unblocked, regardless of the actual state on boot, because msi_init_rfkill only sets the SW state, regardless of ec_read_only.
2. The initial SW state corresponds to the actual state on boot, but it can't be changed afterwards, because set_device_state returns -EOPNOTSUPP. It confuses the userspace, making Wi-Fi and/or Bluetooth unusable if it was blocked on boot, and breaking the airplane mode if the rfkill was unblocked on boot.
Address the above issues by properly initializing the HW state on ec_read_only laptops and by allowing the userspace to toggle the SW state. Don't set the SW state ourselves and let the userspace fully control it. Toggling the SW state is a no-op, however, it allows the userspace to properly toggle the airplane mode. The actual SW radio disablement is handled by the corresponding rtl818x_pci and btusb drivers that have their own rfkills.
Tested on MSI Wind U100 Plus, BIOS ver 1.0G, EC ver 130.
--- drivers/platform/x86/msi-laptop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/platform/x86/msi-laptop.c +4 -4
@@ -223,7 +223,7 @@ static ssize_t set_device_state(const char *buf, size_t count, u8 mask)return -EINVAL ;if (quirks->ec_read_only) -return -EOPNOTSUPP ; +return 0 ;/* read current device state */ result =ec_read (MSI_STANDARD_EC_COMMAND_ADDRESS , &rdata);
@@ -854,15 +854,15 @@ static bool msi_laptop_i8042_filter(unsigned char data, unsigned char str,static void msi_init_rfkill (struct work_struct *ignored) {if (rfk_wlan) { -rfkill_set_sw_state (rfk_wlan, !wlan_s); +msi_rfkill_set_state (rfk_wlan, !wlan_s);rfkill_wlan_set (NULL , !wlan_s); }if (rfk_bluetooth) { -rfkill_set_sw_state (rfk_bluetooth, !bluetooth_s); +msi_rfkill_set_state (rfk_bluetooth, !bluetooth_s);rfkill_bluetooth_set (NULL , !bluetooth_s); }if (rfk_threeg) { -rfkill_set_sw_state (rfk_threeg, !threeg_s); +msi_rfkill_set_state (rfk_threeg, !threeg_s);rfkill_threeg_set (NULL , !threeg_s); } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 155/204 benet: fix return value check in be_lancer_xmit_workarounds()
In reply to Greg Kroah-HartmanFrom: Yuanjun Gong <[email protected]>
[ Upstream commit 5c85f7065718a949902b238a6abd8fc907c5d3e0 ]
in be_lancer_xmit_workarounds(), it should go to label 'tx_drop' if an unexpected value is returned by pskb_trim().
--- drivers/net/ethernet/emulex/benet/be_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/emulex/benet/be_main.c +2 -1
@@ -1132,7 +1132,8 @@ static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter, (lancer_chip(adapter) || BE3_chip(adapter) || skb_vlan_tag_present(skb)) && is_ipv4_pkt(skb)) { ip = (struct iphdr *)ip_hdr (skb); -pskb_trim (skb, eth_hdr_len +ntohs (ip->tot_len)); +if (unlikely (pskb_trim (skb, eth_hdr_len +ntohs (ip->tot_len)))) + goto tx_drop; }/* If vlan tag is already inlined in the packet, skip HW VLAN
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 156/204 ASoC: fsl_spdif: Silence output on stop
In reply to Greg Kroah-HartmanFrom: Matus Gajdos <[email protected]>
[ Upstream commit 0e4c2b6b0c4a4b4014d9424c27e5e79d185229c5 ]
Clear TX registers on stop to prevent the SPDIF interface from sending last written word over and over again.
--- sound/soc/fsl/fsl_spdif.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/fsl/fsl_spdif.c +2 -0
@@ -618,6 +618,8 @@ static int fsl_spdif_trigger(struct snd_pcm_substream *substream,case SNDRV_PCM_TRIGGER_PAUSE_PUSH :regmap_update_bits (regmap,REG_SPDIF_SCR , dmaen,0 );regmap_update_bits (regmap,REG_SPDIF_SIE , intr,0 ); +regmap_write (regmap,REG_SPDIF_STL ,0x0 ); +regmap_write (regmap,REG_SPDIF_STR ,0x0 );break ;default :return -EINVAL ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 157/204 block: Fix a source code comment in include/uapi/linux/blkzoned.h
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
[ Upstream commit e0933b526fbfd937c4a8f4e35fcdd49f0e22d411 ]
Fix the symbolic names for zone conditions in the blkzoned.h header file.
--- include/uapi/linux/blkzoned.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
include/uapi/linux/blkzoned.h +5 -5
@@ -51,13 +51,13 @@ enum blk_zone_type {* * The Zone Condition state machine in the ZBC/ZAC standards maps the above * deinitions as: -* - ZC1: Empty | BLK_ZONE_EMPTY +* - ZC1: Empty | BLK_ZONE_COND_EMPTY * - ZC2: Implicit Open | BLK_ZONE_COND_IMP_OPEN * - ZC3: Explicit Open | BLK_ZONE_COND_EXP_OPEN -* - ZC4: Closed | BLK_ZONE_CLOSED -* - ZC5: Full | BLK_ZONE_FULL -* - ZC6: Read Only | BLK_ZONE_READONLY -* - ZC7: Offline | BLK_ZONE_OFFLINE +* - ZC4: Closed | BLK_ZONE_COND_CLOSED +* - ZC5: Full | BLK_ZONE_COND_FULL +* - ZC6: Read Only | BLK_ZONE_COND_READONLY +* - ZC7: Offline | BLK_ZONE_COND_OFFLINE * * Conditions 0x5 to 0xC are reserved by the current ZBC/ZAC spec and should * be considered invalid.
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 158/204 dm raid: fix missing reconfig_mutex unlock in raid_ctr() error paths
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit bae3028799dc4f1109acc4df37c8ff06f2d8f1a0 ]
In the error paths 'bad_stripe_cache' and 'bad_check_reshape', 'reconfig_mutex' is still held after raid_ctr() returns.
--- drivers/md/dm-raid.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/md/dm-raid.c +7 -2
@@ -3190,15 +3190,19 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv)/* Try to adjust the raid4/5/6 stripe cache size to the stripe size */ if (rs_is_raid456 (rs)) { r =rs_set_raid456_stripe_cache (rs); -if (r) +if (r) { +mddev_unlock (&rs->md); goto bad_stripe_cache; + } }/* Now do an early reshape check */ if (test_bit (RT_FLAG_RESHAPE_RS , &rs->runtime_flags)) { r =rs_check_reshape (rs); -if (r) +if (r) { +mddev_unlock (&rs->md); goto bad_check_reshape; + }/* Restore new, ctr requested layout to perform check */ rs_config_restore (rs, &rs_layout);
@@ -3207,6 +3211,7 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) r = rs->md.pers->check_reshape (&rs->md);if (r) { ti->error ="Reshape check failed" ; +mddev_unlock (&rs->md); goto bad_check_reshape; } }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 159/204 ata: pata_ns87415: mark ns87560_tf_read static
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 3fc2febb0f8ffae354820c1772ec008733237cfa ]
The global function triggers a warning because of the missing prototype
drivers/ata/pata_ns87415.c:263:6: warning: no previous prototype for 'ns87560_tf_read' [-Wmissing-prototypes]
263 | void ns87560_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
There are no other references to this, so just make it static.
--- drivers/ata/pata_ns87415.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/pata_ns87415.c +1 -1
@@ -260,7 +260,7 @@ static u8 ns87560_check_status(struct ata_port *ap)* LOCKING: * Inherited from caller. */ -void ns87560_tf_read (struct ata_port *ap,struct ata_taskfile *tf) +static void ns87560_tf_read (struct ata_port *ap,struct ata_taskfile *tf) {struct ata_ioports *ioaddr = &ap->ioaddr;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 160/204 ring-buffer: Fix wrong stat of cpu_buffer->read
In reply to Greg Kroah-HartmanFrom: Zheng Yejian <[email protected]>
[ Upstream commit 2d093282b0d4357373497f65db6a05eb0c28b7c8 ]
When pages are removed in rb_remove_pages(), 'cpu_buffer->read' is set to 0 in order to make sure any read iterators reset themselves. However, this will mess 'entries' stating, see following steps:
# cd /sys/kernel/tracing/
# 1. Enlarge ring buffer prepare for later reducing:
# echo 20 > per_cpu/cpu0/buffer_size_kb
# 2. Write a log into ring buffer of cpu0:
# taskset -c 0 echo "hello1" > trace_marker
# 3. Read the log:
# cat per_cpu/cpu0/trace_pipe
<...>-332 [000] ..... 62.406844: tracing_mark_write: hello1
# 4. Stop reading and see the stats, now 0 entries, and 1 event readed:
# cat per_cpu/cpu0/stats
entries: 0
[...]
read events: 1
# 5. Reduce the ring buffer
# echo 7 > per_cpu/cpu0/buffer_size_kb
# 6. Now entries became unexpected 1 because actually no entries!!!
# cat per_cpu/cpu0/stats
entries: 1
[...]
read events: 0To fix it, introduce 'page_removed' field to count total removed pages since last reset, then use it to let read iterators reset themselves instead of changing the 'read' pointer.
--- kernel/trace/ring_buffer.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
kernel/trace/ring_buffer.c +12 -10
@@ -464,6 +464,8 @@ struct ring_buffer_per_cpu {unsigned long read_bytes;u64 write_stamp;u64 read_stamp; +/* pages removed since last reset */ +unsigned long pages_removed;/* ring buffer pages to update, > 0 to add, < 0 to remove */ long nr_pages_to_update;struct list_head new_pages;/* new pages to add */
@@ -498,6 +500,7 @@ struct ring_buffer_iter {struct buffer_page *head_page;struct buffer_page *cache_reader_page;unsigned long cache_read; +unsigned long cache_pages_removed;u64 read_stamp; };
@@ -1447,6 +1450,8 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages) to_remove =rb_list_head (to_remove)->next; head_bit |= (unsigned long )to_remove &RB_PAGE_HEAD ; } +/* Read iterators need to reset themselves when some pages removed */ + cpu_buffer->pages_removed += nr_removed; next_page =rb_list_head (to_remove)->next;
@@ -1468,12 +1473,6 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages) cpu_buffer->head_page =list_entry (next_page, struct buffer_page, list); -/* -* change read pointer to make sure any read iterators reset -* themselves -*/ - cpu_buffer->read =0 ; -/* pages are removed, resume tracing and then free the pages */ atomic_dec (&cpu_buffer->record_disabled);raw_spin_unlock_irq (&cpu_buffer->reader_lock);
@@ -3464,6 +3463,7 @@ static void rb_iter_reset(struct ring_buffer_iter *iter) iter->cache_reader_page = iter->head_page; iter->cache_read = cpu_buffer->read; + iter->cache_pages_removed = cpu_buffer->pages_removed;if (iter->head) iter->read_stamp = cpu_buffer->read_stamp;
@@ -3896,12 +3896,13 @@ rb_iter_peek(struct ring_buffer_iter *iter, u64 *ts) buffer = cpu_buffer->buffer;/* -* Check if someone performed a consuming read to -* the buffer. A consuming read invalidates the iterator -* and we need to reset the iterator in this case. +* Check if someone performed a consuming read to the buffer +* or removed some pages from the buffer. In these cases, +* iterator was invalidated and we need to reset it. */ if (unlikely (iter->cache_read != cpu_buffer->read || - iter->cache_reader_page != cpu_buffer->reader_page)) + iter->cache_reader_page != cpu_buffer->reader_page || + iter->cache_pages_removed != cpu_buffer->pages_removed))rb_iter_reset (iter); again:
@@ -4323,6 +4324,7 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer) cpu_buffer->last_overrun =0 ;rb_head_page_activate (cpu_buffer); + cpu_buffer->pages_removed =0 ; }/**
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 161/204 tracing: Fix warning in trace_buffered_event_disable()
In reply to Greg Kroah-HartmanFrom: Zheng Yejian <[email protected]>
[ Upstream commit dea499781a1150d285c62b26659f62fb00824fce ]
Warning happened in trace_buffered_event_disable() at
WARN_ON_ONCE(!trace_buffered_event_ref)
Call Trace: ? __warn+0xa5/0x1b0 ? trace_buffered_event_disable+0x189/0x1b0 __ftrace_event_enable_disable+0x19e/0x3e0 free_probe_data+0x3b/0xa0 unregister_ftrace_function_probe_func+0x6b8/0x800 event_enable_func+0x2f0/0x3d0 ftrace_process_regex.isra.0+0x12d/0x1b0 ftrace_filter_write+0xe6/0x140 vfs_write+0x1c9/0x6f0 [...]
The cause of the warning is in __ftrace_event_enable_disable(), trace_buffered_event_enable() was called once while trace_buffered_event_disable() was called twice. Reproduction script show as below, for analysis, see the comments:
```
#!/bin/bash
cd /sys/kernel/tracing/
# 1. Register a 'disable_event' command, then:
# 1) SOFT_DISABLED_BIT was set;
# 2) trace_buffered_event_enable() was called first time;
echo 'cmdline_proc_show:disable_event:initcall:initcall_finish' > \
set_ftrace_filter
# 2. Enable the event registered, then:
# 1) SOFT_DISABLED_BIT was cleared;
# 2) trace_buffered_event_disable() was called first time;
echo 1 > events/initcall/initcall_finish/enable
# 3. Try to call into cmdline_proc_show(), then SOFT_DISABLED_BIT was
# set again!!!
cat /proc/cmdline
# 4. Unregister the 'disable_event' command, then:
# 1) SOFT_DISABLED_BIT was cleared again;
# 2) trace_buffered_event_disable() was called second time!!!
echo '!cmdline_proc_show:disable_event:initcall:initcall_finish' > \
set_ftrace_filter
```To fix it, IIUC, we can change to call trace_buffered_event_enable() at fist time soft-mode enabled, and call trace_buffered_event_disable() at last time soft-mode disabled.
--- kernel/trace/trace_events.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
kernel/trace/trace_events.c +4 -10
@@ -370,7 +370,6 @@ static int __ftrace_event_enable_disable(struct trace_event_file *file, {struct trace_event_call *call = file->event_call;struct trace_array *tr = file->tr; -unsigned long file_flags = file->flags;int ret =0 ;int disable;
@@ -394,6 +393,8 @@ static int __ftrace_event_enable_disable(struct trace_event_file *file,break ; disable = file->flags &EVENT_FILE_FL_SOFT_DISABLED ;clear_bit (EVENT_FILE_FL_SOFT_MODE_BIT , &file->flags); +/* Disable use of trace_buffered_event */ +trace_buffered_event_disable (); }else disable = !(file->flags &EVENT_FILE_FL_SOFT_MODE );
@@ -432,6 +433,8 @@ static int __ftrace_event_enable_disable(struct trace_event_file *file,if (atomic_inc_return (&file->sm_ref) >1 )break ;set_bit (EVENT_FILE_FL_SOFT_MODE_BIT , &file->flags); +/* Enable use of trace_buffered_event */ +trace_buffered_event_enable (); }if (!(file->flags &EVENT_FILE_FL_ENABLED )) {
@@ -471,15 +474,6 @@ static int __ftrace_event_enable_disable(struct trace_event_file *file,break ; } -/* Enable or disable use of trace_buffered_event */ -if ((file_flags &EVENT_FILE_FL_SOFT_DISABLED ) != - (file->flags &EVENT_FILE_FL_SOFT_DISABLED )) { -if (file->flags &EVENT_FILE_FL_SOFT_DISABLED ) -trace_buffered_event_enable (); -else -trace_buffered_event_disable (); - } -return ret; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 162/204 USB: serial: option: support Quectel EM060K_128
In reply to Greg Kroah-HartmanFrom: Jerry Meng <[email protected]>
commit 4f7cab49cecee16120d27c1734cfdf3d6c0e5329 upstream.
EM060K_128 is EM060K's sub-model, having the same name "Quectel EM060K-GL"
MBIM + GNSS + DIAG + NMEA + AT + QDSS + DPL
T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 8 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0128 Rev= 5.04 S: Manufacturer=Quectel S: Product=Quectel EM060K-GL S: SerialNumber=f6fa08b6 C:* #Ifs= 8 Cfg#= 1 Atr=a0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none)
E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none)
E: Ad=8f(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/usb/serial/option.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/serial/option.c +4 -0
@@ -254,6 +254,7 @@ static void option_instat_callback(struc#define QUECTEL_PRODUCT_EM061K_LTA 0x0123#define QUECTEL_PRODUCT_EM061K_LMS 0x0124#define QUECTEL_PRODUCT_EC25 0x0125 +#define QUECTEL_PRODUCT_EM060K_128 0x0128#define QUECTEL_PRODUCT_EG91 0x0191#define QUECTEL_PRODUCT_EG95 0x0195#define QUECTEL_PRODUCT_BG96 0x0296
@@ -1200,6 +1201,9 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0xff, 0x30) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0x00, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0xff, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x30) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0x00, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x40) },
Greg Kroah-Hartman
maintainerPATCH 163/204 USB: serial: option: add Quectel EC200A module support
In reply to Greg Kroah-HartmanFrom: Mohsen Tahmasebi <[email protected]>
commit 857ea9005806e2a458016880278f98715873e977 upstream.
Add Quectel EC200A "DIAG, AT, MODEM":
0x6005: ECM / RNDIS + DIAG + AT + MODEM
T: Bus=01 Lev=01 Prnt=02 Port=05 Cnt=01 Dev#= 8 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=6005 Rev=03.18 S: Manufacturer=Android S: Product=Android S: SerialNumber=0000 C: #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether E: Ad=87(I) Atr=03(Int.) MxPS= 64 Ivl=4096ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=03(Int.) MxPS= 64 Ivl=4096ms I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=03(Int.) MxPS= 64 Ivl=4096ms
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -272,6 +272,7 @@ static void option_instat_callback(struc#define QUECTEL_PRODUCT_RM520N 0x0801#define QUECTEL_PRODUCT_EC200U 0x0901#define QUECTEL_PRODUCT_EC200S_CN 0x6002 +#define QUECTEL_PRODUCT_EC200A 0x6005#define QUECTEL_PRODUCT_EM061K_LWW 0x6008#define QUECTEL_PRODUCT_EM061K_LCN 0x6009#define QUECTEL_PRODUCT_EC200T 0x6026
@@ -1232,6 +1233,7 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0900, 0xff, 0, 0), /* RM500U-CN */ .driver_info = ZLP }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200A, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
Greg Kroah-Hartman
maintainerPATCH 164/204 USB: serial: simple: add Kaufmann RKS+CAN VCP
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit dd92c8a1f99bcd166204ffc219ea5a23dd65d64f upstream.
Add the device and product ID for this CAN bus interface / license dongle. The device is usable either directly from user space or can be attached to a kernel CAN interface with slcan_attach.
--- drivers/usb/serial/usb-serial-simple.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/serial/usb-serial-simple.c +7 -0
@@ -66,6 +66,11 @@ DEVICE(flashloader, FLASHLOADER_IDS); 0x01) }DEVICE (google,GOOGLE_IDS ); +/* KAUFMANN RKS+CAN VCP */ +#define KAUFMANN_IDS () \ + { USB_DEVICE(0x16d0, 0x0870) } +DEVICE (kaufmann,KAUFMANN_IDS ); +/* Libtransistor USB console */ #define LIBTRANSISTOR_IDS () \ { USB_DEVICE(0x1209, 0x8b00) }
@@ -127,6 +132,7 @@ static struct usb_serial_driver * const &funsoft_device, &flashloader_device, &google_device, + &kaufmann_device, &libtransistor_device, &vivopay_device, &moto_modem_device,
@@ -145,6 +151,7 @@ static const struct usb_device_id id_tabFUNSOFT_IDS (),FLASHLOADER_IDS (),GOOGLE_IDS (), +KAUFMANN_IDS (),LIBTRANSISTOR_IDS (),VIVOPAY_IDS (), MOTO_IDS(),
Greg Kroah-Hartman
maintainerPATCH 165/204 USB: serial: simple: sort driver entries
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit d245aedc00775c4d7265a9f4522cc4e1fd34d102 upstream.
Sort the driver symbols alphabetically in order to make it more obvious where new driver entries should be added.
--- drivers/usb/serial/usb-serial-simple.c | 66 ++++++++++++++++----------------- 1 file changed, 33 insertions(+), 33 deletions(-)
drivers/usb/serial/usb-serial-simple.c +33 -33
@@ -41,16 +41,6 @@ static struct usb_serial_driver vendor## { USB_DEVICE(0x0a21, 0x8001) } /* MMT-7305WW */DEVICE (carelink,CARELINK_IDS ); -/* ZIO Motherboard USB driver */ -#define ZIO_IDS () \ - { USB_DEVICE(0x1CBE, 0x0103) } -DEVICE (zio,ZIO_IDS ); - -/* Funsoft Serial USB driver */ -#define FUNSOFT_IDS () \ - { USB_DEVICE(0x1404, 0xcddc) } -DEVICE (funsoft,FUNSOFT_IDS ); -/* Infineon Flashloader driver */ #define FLASHLOADER_IDS () \ { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, USB_CLASS_CDC_DATA) }, \
@@ -58,6 +48,11 @@ DEVICE(funsoft, FUNSOFT_IDS); { USB_DEVICE(0x8087, 0x0801) }DEVICE (flashloader,FLASHLOADER_IDS ); +/* Funsoft Serial USB driver */ +#define FUNSOFT_IDS () \ + { USB_DEVICE(0x1404, 0xcddc) } +DEVICE (funsoft,FUNSOFT_IDS ); +/* Google Serial USB SubClass */ #define GOOGLE_IDS () \ { USB_VENDOR_AND_INTERFACE_INFO(0x18d1, \
@@ -66,6 +61,11 @@ DEVICE(flashloader, FLASHLOADER_IDS); 0x01) }DEVICE (google,GOOGLE_IDS ); +/* HP4x (48/49) Generic Serial driver */ +#define HP4X_IDS () \ + { USB_DEVICE(0x03f0, 0x0121) } +DEVICE (hp4x,HP4X_IDS ); +/* KAUFMANN RKS+CAN VCP */ #define KAUFMANN_IDS () \ { USB_DEVICE(0x16d0, 0x0870) }
@@ -76,11 +76,6 @@ DEVICE(kaufmann, KAUFMANN_IDS); { USB_DEVICE(0x1209, 0x8b00) }DEVICE (libtransistor,LIBTRANSISTOR_IDS ); -/* ViVOpay USB Serial Driver */ -#define VIVOPAY_IDS () \ - { USB_DEVICE(0x1d5f, 0x1004) }/* ViVOpay 8800 */ -DEVICE (vivopay,VIVOPAY_IDS ); -/* Motorola USB Phone driver */ #define MOTO_IDS () \ { USB_DEVICE(0x05c6, 0x3197) },/* unknown Motorola phone */ \
@@ -109,10 +104,10 @@ DEVICE(nokia, NOKIA_IDS); { USB_DEVICE(0x09d7, 0x0100) } /* NovAtel FlexPack GPS */DEVICE_N (novatel_gps,NOVATEL_IDS ,3 ); -/* HP4x (48/49) Generic Serial driver */ -#define HP4X_IDS () \ - { USB_DEVICE(0x03f0, 0x0121) } -DEVICE (hp4x,HP4X_IDS ); +/* Siemens USB/MPI adapter */ +#define SIEMENS_IDS () \ + { USB_DEVICE(0x908, 0x0004) } +DEVICE (siemens_mpi,SIEMENS_IDS );/* Suunto ANT+ USB Driver */ #define SUUNTO_IDS () \
@@ -120,47 +115,52 @@ DEVICE(hp4x, HP4X_IDS); { USB_DEVICE(0x0fcf, 0x1009) } /* Dynastream ANT USB-m Stick */DEVICE (suunto,SUUNTO_IDS ); -/* Siemens USB/MPI adapter */ -#define SIEMENS_IDS () \ - { USB_DEVICE(0x908, 0x0004) } -DEVICE (siemens_mpi,SIEMENS_IDS ); +/* ViVOpay USB Serial Driver */ +#define VIVOPAY_IDS () \ + { USB_DEVICE(0x1d5f, 0x1004) }/* ViVOpay 8800 */ +DEVICE (vivopay,VIVOPAY_IDS ); + +/* ZIO Motherboard USB driver */ +#define ZIO_IDS () \ + { USB_DEVICE(0x1CBE, 0x0103) } +DEVICE (zio,ZIO_IDS );/* All of the above structures mushed into two lists */ static struct usb_serial_driver *const serial_drivers[] = { &carelink_device, - &zio_device, - &funsoft_device, &flashloader_device, + &funsoft_device, &google_device, + &hp4x_device, &kaufmann_device, &libtransistor_device, - &vivopay_device, &moto_modem_device, &motorola_tetra_device, &nokia_device, &novatel_gps_device, - &hp4x_device, - &suunto_device, &siemens_mpi_device, + &suunto_device, + &vivopay_device, + &zio_device,NULL };static const struct usb_device_id id_table[] = {CARELINK_IDS (), -ZIO_IDS (), -FUNSOFT_IDS (),FLASHLOADER_IDS (), +FUNSOFT_IDS (),GOOGLE_IDS (), +HP4X_IDS (),KAUFMANN_IDS (),LIBTRANSISTOR_IDS (), -VIVOPAY_IDS (),MOTO_IDS (),MOTOROLA_TETRA_IDS (),NOKIA_IDS (),NOVATEL_IDS (), -HP4X_IDS (), -SUUNTO_IDS (),SIEMENS_IDS (), +SUUNTO_IDS (), +VIVOPAY_IDS (), +ZIO_IDS (), { }, };MODULE_DEVICE_TABLE (usb, id_table);
Greg Kroah-Hartman
maintainerPATCH 166/204 can: gs_usb: gs_can_close(): add missing set of CAN state to CAN_STATE_STOPPED
In reply to Greg Kroah-HartmanFrom: Marc Kleine-Budde <[email protected]>
commit f8a2da6ec2417cca169fa85a8ab15817bccbb109 upstream.
After an initial link up the CAN device is in ERROR-ACTIVE mode. Due to a missing CAN_STATE_STOPPED in gs_can_close() it doesn't change to STOPPED after a link down:
| ip link set dev can0 up | ip link set dev can0 down | ip --details link show can0 | 13: can0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10 | link/can promiscuity 0 allmulti 0 minmtu 0 maxmtu 0 | can state ERROR-ACTIVE restart-ms 1000
Add missing assignment of CAN_STATE_STOPPED in gs_can_close().
--- drivers/net/can/usb/gs_usb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/can/usb/gs_usb.c +2 -0
@@ -740,6 +740,8 @@ static int gs_can_close(struct net_devicusb_kill_anchored_urbs (&dev->tx_submitted);atomic_set (&dev->active_tx_urbs,0 ); + dev->can.state =CAN_STATE_STOPPED ; +/* reset the device */ rc =gs_cmd_reset (parent, dev);if (rc <0 )
Greg Kroah-Hartman
maintainerPATCH 167/204 usb: ohci-at91: Fix the unhandle interrupt when resume
In reply to Greg Kroah-HartmanFrom: Guiting Shen <[email protected]>
commit c55afcbeaa7a6f4fffdbc999a9bf3f0b29a5186f upstream.
The ohci_hcd_at91_drv_suspend() sets ohci->rh_state to OHCI_RH_HALTED when suspend which will let the ohci_irq() skip the interrupt after resume. And nobody to handle this interrupt.
According to the comment in ohci_hcd_at91_drv_suspend(), it need to reset when resume from suspend(MEM) to fix by setting "hibernated" argument of ohci_resume().
--- drivers/usb/host/ohci-at91.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/usb/host/ohci-at91.c +7 -1
@@ -641,7 +641,13 @@ ohci_hcd_at91_drv_resume(struct device *at91_start_clock (ohci_at91); -ohci_resume (hcd, false); +/* +* According to the comment in ohci_hcd_at91_drv_suspend() +* we need to do a reset if the 48Mhz clock was stopped, +* that is, if ohci_at91->wakeup is clear. Tell ohci_resume() +* to reset in this case by setting its "hibernated" flag. +*/ +ohci_resume (hcd, !ohci_at91->wakeup);ohci_at91_port_suspend (ohci_at91->sfr_regmap,0 );
Greg Kroah-Hartman
maintainerPATCH 168/204 usb: xhci-mtk: set the dma max_seg_size
In reply to Greg Kroah-HartmanFrom: Ricardo Ribalda <[email protected]>
commit 9fd10829a9eb482e192a845675ecc5480e0bfa10 upstream.
Allow devices to have dma operations beyond 64K, and avoid warnings such as:
DMA-API: xhci-mtk 11200000.usb: mapping sg segment longer than device claims to support [len=98304] [max=65536]
--- drivers/usb/host/xhci-mtk.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/xhci-mtk.c +1 -0
@@ -674,6 +674,7 @@ static int xhci_mtk_probe(struct platfor goto exit_phys;device_init_wakeup (dev, true); +dma_set_max_seg_size (dev,UINT_MAX ); xhci =hcd_to_xhci (hcd); xhci->main_hcd = hcd;
Greg Kroah-Hartman
maintainerPATCH 169/204 Documentation: security-bugs.rst: update preferences when dealing with the linux-distros group
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
commit 4fee0915e649bd0cea56dece6d96f8f4643df33c upstream.
Because the linux-distros group forces reporters to release information about reported bugs, and they impose arbitrary deadlines in having those bugs fixed despite not actually being kernel developers, the kernel security team recommends not interacting with them at all as this just causes confusion and the early-release of reported security problems.
--- Documentation/admin-guide/security-bugs.rst | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-)
Documentation/admin-guide/security-bugs.rst +11 -13
@@ -42,20 +42,18 @@ disclosure is from immediate (esp. if it to a few weeks. As a basic default policy, we expect report date to disclosure date to be on the order of 7 days. -Coordination ------------- +Coordination with other groups +------------------------------ -Fixes for sensitive bugs, such as those that might lead to privilege -escalations, may need to be coordinated with the private -<[email protected]> mailing list so that distribution vendors -are well prepared to issue a fixed kernel upon public disclosure of the -upstream fix. Distros will need some time to test the proposed patch and -will generally request at least a few days of embargo, and vendor update -publication prefers to happen Tuesday through Thursday. When appropriate, -the security team can assist with this coordination, or the reporter can -include linux-distros from the start. In this case, remember to prefix -the email Subject line with "[vs]" as described in the linux-distros wiki: -<http://oss-security.openwall.org/wiki/mailing-lists/distros#how-to-use-the-lists> +The kernel security team strongly recommends that reporters of potential +security issues NEVER contact the "linux-distros" mailing list until +AFTER discussing it with the kernel security team. Do not Cc: both +lists at once. You may contact the linux-distros mailing list after a +fix has been agreed on and you fully understand the requirements that +doing so will impose on you and the kernel community. + +The different lists have different goals and the linux-distros rules do +not contribute to actually fixing any potential security problems. CVE assignment --------------
Greg Kroah-Hartman
maintainerPATCH 170/204 staging: ks7010: potential buffer overflow in ks_wlan_set_encode_ext()
In reply to Greg Kroah-HartmanFrom: Zhang Shurong <[email protected]>
commit 5f1c7031e044cb2fba82836d55cc235e2ad619dc upstream.
The "exc->key_len" is a u16 that comes from the user. If it's over IW_ENCODING_TOKEN_MAX (64) that could lead to memory corruption.
--- drivers/staging/ks7010/ks_wlan_net.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/ks7010/ks_wlan_net.c +4 -2
@@ -1787,8 +1787,10 @@ static int ks_wlan_set_encode_ext(struct commit |=SME_WEP_FLAG ; }if (enc->key_len) { -memcpy (&key->key_val[0 ], &enc->key[0 ], enc->key_len); - key->key_len = enc->key_len; +int key_len =clamp_val (enc->key_len,0 ,IW_ENCODING_TOKEN_MAX ); + +memcpy (&key->key_val[0 ], &enc->key[0 ], key_len); + key->key_len = key_len; commit |= (SME_WEP_VAL1 << index); }break ;
Greg Kroah-Hartman
maintainerPATCH 171/204 hwmon: (nct7802) Fix for temp6 (PECI1) processed even if PECI1 disabled
In reply to Greg Kroah-HartmanFrom: Gilles Buloz <[email protected]>
commit 54685abe660a59402344d5045ce08c43c6a5ac42 upstream.
Because of hex value 0x46 used instead of decimal 46, the temp6 (PECI1) temperature is always declared visible and then displayed even if disabled in the chip
--- drivers/hwmon/nct7802.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/nct7802.c +1 -1
@@ -698,7 +698,7 @@ static umode_t nct7802_temp_is_visible(sif (index >=38 && index <46 && !(reg &0x01 ))/* PECI 0 */ return 0 ; -if (index >=0x46 && (!(reg &0x02 )))/* PECI 1 */ +if (index >=46 && !(reg &0x02 ))/* PECI 1 */ return 0 ;return attr->mode;
Greg Kroah-Hartman
maintainerPATCH 172/204 tpm_tis: Explicitly check for error code
In reply to Greg Kroah-HartmanFrom: Alexander Steffen <[email protected]>
commit 513253f8c293c0c8bd46d09d337fc892bf8f9f48 upstream.
recv_data either returns the number of received bytes, or a negative value representing an error code. Adding the return value directly to the total number of received bytes therefore looks a little weird, since it might add a negative error code to a sum of bytes.
The following check for size < expected usually makes the function return ETIME in that case, so it does not cause too many problems in practice. But to make the code look cleaner and because the caller might still be interested in the original error code, explicitly check for the presence of an error code and pass that through.
--- drivers/char/tpm/tpm_tis_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm_tis_core.c +8 -2
@@ -209,6 +209,7 @@ static int tpm_tis_recv(struct tpm_chipint size =0 ;int status;u32 expected; +int rc;if (count <TPM_HEADER_SIZE ) { size = -EIO ;
@@ -228,8 +229,13 @@ static int tpm_tis_recv(struct tpm_chip goto out; } - size +=recv_data (chip, &buf[TPM_HEADER_SIZE ], - expected -TPM_HEADER_SIZE ); + rc =recv_data (chip, &buf[TPM_HEADER_SIZE ], + expected -TPM_HEADER_SIZE ); +if (rc <0 ) { + size = rc; + goto out; + } + size += rc;if (size < expected) {dev_err (&chip->dev,"Unable to read remainder of result\n" ); size = -ETIME ;
Greg Kroah-Hartman
maintainerPATCH 173/204 irq-bcm6345-l1: Do not assume a fixed block to cpu mapping
In reply to Greg Kroah-HartmanFrom: Jonas Gorski <[email protected]>
[ Upstream commit 55ad24857341c36616ecc1d9580af5626c226cf1 ]
The irq to block mapping is fixed, and interrupts from the first block will always be routed to the first parent IRQ. But the parent interrupts themselves can be routed to any available CPU.
This is used by the bootloader to map the first parent interrupt to the boot CPU, regardless wether the boot CPU is the first one or the second one.
When booting from the second CPU, the assumption that the first block's IRQ is mapped to the first CPU breaks, and the system hangs because interrupts do not get routed correctly.
Fix this by passing the appropriate bcm6434_l1_cpu to the interrupt handler instead of the chip itself, so the handler always has the right block.
--- drivers/irqchip/irq-bcm6345-l1.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/irqchip/irq-bcm6345-l1.c +5 -9
@@ -85,6 +85,7 @@ struct bcm6345_l1_chip { };struct bcm6345_l1_cpu { +struct bcm6345_l1_chip *intc;void __iomem *map_base;unsigned int parent_irq;u32 enable_cache[];
@@ -118,17 +119,11 @@ static inline unsigned int cpu_for_irq(struct bcm6345_l1_chip *intc,static void bcm6345_l1_irq_handle (struct irq_desc *desc) { -struct bcm6345_l1_chip *intc =irq_desc_get_handler_data (desc); -struct bcm6345_l1_cpu *cpu; +struct bcm6345_l1_cpu *cpu =irq_desc_get_handler_data (desc); +struct bcm6345_l1_chip *intc = cpu->intc;struct irq_chip *chip =irq_desc_get_chip (desc);unsigned int idx; -#ifdef CONFIG_SMP - cpu = intc->cpus[cpu_logical_map (smp_processor_id ())]; -#else - cpu = intc->cpus[0 ]; -#endif -chained_irq_enter (chip, desc);for (idx =0 ; idx < intc->n_words; idx++) {
@@ -260,6 +255,7 @@ static int __init bcm6345_l1_init_one(struct device_node *dn,if (!cpu)return -ENOMEM ; + cpu->intc = intc; cpu->map_base =ioremap (res.start, sz);if (!cpu->map_base)return -ENOMEM ;
@@ -275,7 +271,7 @@ static int __init bcm6345_l1_init_one(struct device_node *dn,return -EINVAL ; }irq_set_chained_handler_and_data (cpu->parent_irq, - bcm6345_l1_irq_handle, intc); + bcm6345_l1_irq_handle, cpu);return 0 ; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 174/204 s390/dasd: fix hanging device after quiesce/resume
In reply to Greg Kroah-HartmanFrom: Stefan Haberland <[email protected]>
commit 05f1d8ed03f547054efbc4d29bb7991c958ede95 upstream.
Quiesce and resume are functions that tell the DASD driver to stop/resume issuing I/Os to a specific DASD.
On resume dasd_schedule_block_bh() is called to kick handling of IO requests again. This does unfortunately not cover internal requests which are used for path verification for example.
This could lead to a hanging device when a path event or anything else that triggers internal requests occurs on a quiesced device.
Fix by also calling dasd_schedule_device_bh() which triggers handling of internal requests on resume.
--- drivers/s390/block/dasd_ioctl.c | 1 + 1 file changed, 1 insertion(+)
drivers/s390/block/dasd_ioctl.c +1 -0
@@ -138,6 +138,7 @@ static int dasd_ioctl_resume(struct dasdspin_unlock_irqrestore (get_ccwdev_lock (base->cdev), flags);dasd_schedule_block_bh (block); +dasd_schedule_device_bh (base);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 175/204 ASoC: wm8904: Fill the cache for WM8904_ADC_TEST_0 register
In reply to Greg Kroah-HartmanFrom: Mark Brown <[email protected]>
commit f061e2be8689057cb4ec0dbffa9f03e1a23cdcb2 upstream.
The WM8904_ADC_TEST_0 register is modified as part of updating the OSR controls but does not have a cache default, leading to errors when we try to modify these controls in cache only mode with no prior read:
wm8904 3-001a: ASoC: error at snd_soc_component_update_bits on wm8904.3-001a for register: [0x000000c6] -16
Add a read of the register to probe() to fill the cache and avoid both the error messages and the misconfiguration of the chip which will result.
--- sound/soc/codecs/wm8904.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/codecs/wm8904.c +3 -0
@@ -2261,6 +2261,9 @@ static int wm8904_i2c_probe(struct i2c_cregmap_update_bits (wm8904->regmap,WM8904_BIAS_CONTROL_0 ,WM8904_POBCTRL ,0 ); +/* Fill the cache for the ADC test register */ +regmap_read (wm8904->regmap,WM8904_ADC_TEST_0 , &val); +/* Can leave the device powered off until we need it */ regcache_cache_only (wm8904->regmap, true);regulator_bulk_disable (ARRAY_SIZE (wm8904->supplies), wm8904->supplies);
Greg Kroah-Hartman
maintainerPATCH 176/204 dm cache policy smq: ensure IO doesnt prevent cleaner policy progress
In reply to Greg Kroah-HartmanFrom: Joe Thornber <[email protected]>
commit 1e4ab7b4c881cf26c1c72b3f56519e03475486fb upstream.
When using the cleaner policy to decommission the cache, there is never any writeback started from the cache as it is constantly delayed due to normal I/O keeping the device busy. Meaning @idle=false was always being passed to clean_target_met()
Fix this by adding a specific 'cleaner' flag that is set when the cleaner policy is configured. This flag serves to always allow the cleaner's writeback work to be queued until the cache is decommissioned (even if the cache isn't idle).
--- drivers/md/dm-cache-policy-smq.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-)
drivers/md/dm-cache-policy-smq.c +18 -10
@@ -841,7 +841,13 @@ struct smq_policy {struct background_tracker *bg_work; -bool migrations_allowed; + bool migrations_allowed:1; + +/* +* If this is set the policy will try and clean the whole cache +* even if the device is not idle. +*/ + bool cleaner:1; };/*----------------------------------------------------------------*/
@@ -1120,7 +1126,7 @@ static bool clean_target_met(struct smq_* Cache entries may not be populated. So we cannot rely on the * size of the clean queue. */ -if (idle) { +if (idle || mq->cleaner) {/* * We'd like to clean everything. */
@@ -1692,11 +1698,9 @@ static void calc_hotspot_params(sector_t *hotspot_block_size /=2u ; } -static struct dm_cache_policy *__smq_create (dm_cblock_t cache_size, -sector_t origin_size, -sector_t cache_block_size, -bool mimic_mq, -bool migrations_allowed) +static struct dm_cache_policy * +__smq_create (dm_cblock_t cache_size,sector_t origin_size,sector_t cache_block_size, +bool mimic_mq,bool migrations_allowed,bool cleaner) {unsigned i;unsigned nr_sentinels_per_queue =2u *NR_CACHE_LEVELS ;
@@ -1783,6 +1787,7 @@ static struct dm_cache_policy *__smq_cre goto bad_btracker; mq->migrations_allowed = migrations_allowed; + mq->cleaner = cleaner;return &mq->policy;
@@ -1806,21 +1811,24 @@ static struct dm_cache_policy *smq_creatsector_t origin_size, sector_t cache_block_size) { - return __smq_create(cache_size, origin_size, cache_block_size, false, true); + return __smq_create(cache_size, origin_size, cache_block_size, +false ,true ,false ); }static struct dm_cache_policy *mq_create (dm_cblock_t cache_size,sector_t origin_size,sector_t cache_block_size) { -return __smq_create (cache_size, origin_size, cache_block_size, true, true); +return __smq_create (cache_size, origin_size, cache_block_size, + true, true, false); }static struct dm_cache_policy *cleaner_create (dm_cblock_t cache_size,sector_t origin_size,sector_t cache_block_size) { -return __smq_create (cache_size, origin_size, cache_block_size, false, false); +return __smq_create (cache_size, origin_size, cache_block_size, + false, false, true); }/*----------------------------------------------------------------*/
Greg Kroah-Hartman
maintainerPATCH 177/204 drm/client: Fix memory leak in drm_client_target_cloned
In reply to Greg Kroah-HartmanFrom: Jocelyn Falempe <[email protected]>
commit c2a88e8bdf5f6239948d75283d0ae7e0c7945b03 upstream.
dmt_mode is allocated and never freed in this function.
It was found with the ast driver, but most drivers using generic fbdev setup are probably affected.
This fixes the following kmemleak report:
backtrace:
[<00000000b391296d>] drm_mode_duplicate+0x45/0x220 [drm]
[<00000000e45bb5b3>] drm_client_target_cloned.constprop.0+0x27b/0x480 [drm]
[<00000000ed2d3a37>] drm_client_modeset_probe+0x6bd/0xf50 [drm]
[<0000000010e5cc9d>] __drm_fb_helper_initial_config_and_unlock+0xb4/0x2c0 [drm_kms_helper]
[<00000000909f82ca>] drm_fbdev_client_hotplug+0x2bc/0x4d0 [drm_kms_helper]
[<00000000063a69aa>] drm_client_register+0x169/0x240 [drm]
[<00000000a8c61525>] ast_pci_probe+0x142/0x190 [ast]
[<00000000987f19bb>] local_pci_probe+0xdc/0x180
[<000000004fca231b>] work_for_cpu_fn+0x4e/0xa0
[<0000000000b85301>] process_one_work+0x8b7/0x1540
[<000000003375b17c>] worker_thread+0x70a/0xed0
[<00000000b0d43cd9>] kthread+0x29f/0x340
[<000000008d770833>] ret_from_fork+0x1f/0x30unreferenced object 0xff11000333089a00 (size 128):
--- drivers/gpu/drm/drm_fb_helper.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/drm_fb_helper.c +5 -0
@@ -2112,6 +2112,9 @@ static bool drm_target_cloned(struct drm can_clone = true; dmt_mode =drm_mode_find_dmt (fb_helper->dev,1024 ,768 ,60 , false); +if (!dmt_mode) + goto fail; +drm_fb_helper_for_each_connector (fb_helper, i) {if (!enabled[i])continue ;
@@ -2124,11 +2127,13 @@ static bool drm_target_cloned(struct drmif (!modes[i]) can_clone = false; } +kfree (dmt_mode);if (can_clone) {DRM_DEBUG_KMS ("can clone using 1024x768\n" );return true; } +fail:DRM_INFO ("kms: can't enable cloning when we probably wanted to.\n" );return false; }
Greg Kroah-Hartman
maintainerPATCH 178/204 net/sched: cls_fw: Fix improper refcount update leads to use-after-free
In reply to Greg Kroah-HartmanFrom: M A Ramdhan <[email protected]>
commit 0323bce598eea038714f941ce2b22541c46d488f upstream.
In the event of a failure in tcf_change_indev(), fw_set_parms() will immediately return an error after incrementing or decrementing reference counter in tcf_bind_filter(). If attacker can control reference counter to zero and make reference freed, leading to use after free.
In order to prevent this, move the point of possible failure above the point where the TC_FW_CLASSID is handled.
Message-ID: <[email protected]>
--- net/sched/cls_fw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
net/sched/cls_fw.c +5 -5
@@ -225,11 +225,6 @@ static int fw_set_parms(struct net *net,if (err <0 )return err; -if (tb[TCA_FW_CLASSID ]) { - f->res.classid =nla_get_u32 (tb[TCA_FW_CLASSID ]); -tcf_bind_filter (tp, &f->res, base); - } -#ifdef CONFIG_NET_CLS_IND if (tb[TCA_FW_INDEV ]) {int ret;
@@ -248,6 +243,11 @@ static int fw_set_parms(struct net *net, }else if (head->mask !=0xFFFFFFFF )return err; +if (tb[TCA_FW_CLASSID ]) { + f->res.classid =nla_get_u32 (tb[TCA_FW_CLASSID ]); +tcf_bind_filter (tp, &f->res, base); + } +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 179/204 net/sched: sch_qfq: account for stab overhead in qfq_enqueue
In reply to Greg Kroah-HartmanFrom: Pedro Tammela <[email protected]>
commit 3e337087c3b5805fe0b8a46ba622a962880b5d64 upstream.
Lion says:
-------
In the QFQ scheduler a similar issue to CVE-2023-31436 persists.
Consider the following code in net/sched/sch_qfq.c:
static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
struct sk_buff **to_free)
{
unsigned int len = qdisc_pkt_len(skb), gso_segs;
// ...
if (unlikely(cl->agg->lmax < len)) {
pr_debug("qfq: increasing maxpkt from %u to %u for class %u",
cl->agg->lmax, len, cl->common.classid);
err = qfq_change_agg(sch, cl, cl->agg->class_weight, len);
if (err) {
cl->qstats.drops++;
return qdisc_drop(skb, sch, to_free);
}
// ...
}Similarly to CVE-2023-31436, "lmax" is increased without any bounds checks according to the packet length "len". Usually this would not impose a problem because packet sizes are naturally limited.
This is however not the actual packet length, rather the "qdisc_pkt_len(skb)" which might apply size transformations according to "struct qdisc_size_table" as created by "qdisc_get_stab()" in net/sched/sch_api.c if the TCA_STAB option was set when modifying the qdisc.
A user may choose virtually any size using such a table.
As a result the same issue as in CVE-2023-31436 can occur, allowing heap out-of-bounds read / writes in the kmalloc-8192 cache.
-------
We can create the issue with the following commands:
tc qdisc add dev $DEV root handle 1: stab mtu 2048 tsize 512 mpu 0 \
overhead 999999999 linklayer ethernet qfq
tc class add dev $DEV parent 1: classid 1:1 htb rate 6mbit burst 15k tc filter add dev $DEV parent 1: matchall classid 1:1 ping -I $DEV 1.1.1.2
This is caused by incorrectly assuming that qdisc_pkt_len() returns a length within the QFQ_MIN_LMAX < len < QFQ_MAX_LMAX.
--- net/sched/sch_qfq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/sched/sch_qfq.c +6 -1
@@ -387,8 +387,13 @@ static int qfq_change_agg(struct Qdisc * u32 lmax) {struct qfq_sched *q =qdisc_priv (sch); -struct qfq_aggregate *new_agg =qfq_find_agg (q, lmax, weight); +struct qfq_aggregate *new_agg; +/* 'lmax' can range from [QFQ_MIN_LMAX, pktlen + stab overhead] */ +if (lmax > (1UL <<QFQ_MTU_SHIFT )) +return -EINVAL ; + + new_agg =qfq_find_agg (q, lmax, weight);if (new_agg ==NULL ) {/* create new aggregate */ new_agg =kzalloc (sizeof (*new_agg),GFP_ATOMIC );if (new_agg ==NULL )
Greg Kroah-Hartman
maintainerPATCH 180/204 net/sched: cls_u32: Fix reference counter leak leading to overflow
In reply to Greg Kroah-HartmanFrom: Lee Jones <[email protected]>
commit 04c55383fa5689357bcdd2c8036725a55ed632bc upstream.
In the event of a failure in tcf_change_indev(), u32_set_parms() will immediately return without decrementing the recently incremented reference counter. If this happens enough times, the counter will rollover and the reference freed, leading to a double free which can be used to do 'bad things'.
In order to prevent this, move the point of possible failure above the point where the reference counter is incremented. Also save any meaningful return values to be applied to the return data at the appropriate point in time.
This issue was caught with KASAN.
--- net/sched/cls_u32.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
net/sched/cls_u32.c +14 -7
@@ -774,11 +774,22 @@ static int u32_set_parms(struct net *net struct nlattr *est, bool ovr) { int err; +#ifdef CONFIG_NET_CLS_IND +int ifindex =-1 ; +#endif err =tcf_exts_validate (net, tp, tb, est, &n->exts, ovr);if (err <0 )return err; +#ifdef CONFIG_NET_CLS_IND +if (tb[TCA_U32_INDEV ]) { + ifindex =tcf_change_indev (net, tb[TCA_U32_INDEV ]); +if (ifindex <0 ) +return -EINVAL ; + } +#endif +if (tb[TCA_U32_LINK ]) {u32 handle =nla_get_u32 (tb[TCA_U32_LINK ]);struct tc_u_hnode *ht_down =NULL , *ht_old;
@@ -806,14 +817,10 @@ static int u32_set_parms(struct net *net }#ifdef CONFIG_NET_CLS_IND -if (tb[TCA_U32_INDEV ]) { -int ret; - ret =tcf_change_indev (net, tb[TCA_U32_INDEV ]); -if (ret <0 ) -return -EINVAL ; - n->ifindex = ret; - } +if (ifindex >=0 ) + n->ifindex = ifindex;#endif +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 181/204 perf: Fix function pointer case
In reply to Greg Kroah-HartmanFrom: Peter Zijlstra <[email protected]>
commit 1af6239d1d3e61d33fd2f0ba53d3d1a67cc50574 upstream.
With the advent of CFI it is no longer acceptible to cast function pointers.
The robot complains thusly:
kernel-events-core.c:warning:cast-from-int-(-)(struct-perf_cpu_pmu_context-)-to-remote_function_f-(aka-int-(-)(void-)-)-converts-to-incompatible-function-type
--- kernel/events/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
kernel/events/core.c +6 -2
@@ -1096,6 +1096,11 @@ static int perf_mux_hrtimer_restart(strureturn 0 ; } +static int perf_mux_hrtimer_restart_ipi (void *arg) +{ +return perf_mux_hrtimer_restart (arg); +} +void perf_pmu_disable (struct pmu *pmu) {int *count =this_cpu_ptr (pmu->pmu_disable_count);
@@ -9142,8 +9147,7 @@ perf_event_mux_interval_ms_store(struct cpuctx =per_cpu_ptr (pmu->pmu_cpu_context, cpu); cpuctx->hrtimer_interval =ns_to_ktime (NSEC_PER_MSEC * timer); -cpu_function_call (cpu, - (remote_function_f )perf_mux_hrtimer_restart, cpuctx); +cpu_function_call (cpu, perf_mux_hrtimer_restart_ipi, cpuctx); }cpus_read_unlock ();mutex_unlock (&mux_interval_mutex);
Greg Kroah-Hartman
maintainerPATCH 182/204 word-at-a-time: use the same return type for has_zero regardless of endianness
In reply to Greg Kroah-HartmanFrom: [email protected] <[email protected]>
[ Upstream commit 79e8328e5acbe691bbde029a52c89d70dcbc22f3 ]
Compiling big-endian targets with Clang produces the diagnostic:
fs/namei.c:2173:13: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
} while (!(has_zero(a, &adata, &constants) | has_zero(b, &bdata, &constants)));
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|| fs/namei.c:2173:13: note: cast one or both operands to int to silence this warning
It appears that when has_zero was introduced, two definitions were produced with different signatures (in particular different return types).
Looking at the usage in hash_name() in fs/namei.c, I suspect that has_zero() is meant to be invoked twice per while loop iteration; using logical-or would not update bdata when a did not have zeros. So I think it's preferred to always return an unsigned long rather than a bool than update the while loop in hash_name() to use a logical-or rather than bitwise-or.
[ Also changed powerpc version to do the same - Linus ]
--- arch/powerpc/include/asm/word-at-a-time.h | 2 +- include/asm-generic/word-at-a-time.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/word-at-a-time.h +1 -1
@@ -34,7 +34,7 @@ static inline long find_zero(unsigned long mask)return leading_zero_bits >>3 ; } -static inline bool has_zero (unsigned long val,unsigned long *data,const struct word_at_a_time *c) +static inline unsigned long has_zero (unsigned long val,unsigned long *data,const struct word_at_a_time *c) {unsigned long rhs = val | c->low_bits; *data = rhs;
include/asm-generic/word-at-a-time.h +1 -1
@@ -38,7 +38,7 @@ static inline long find_zero(unsigned long mask)return (mask >>8 ) ? byte : byte +1 ; } -static inline bool has_zero (unsigned long val,unsigned long *data,const struct word_at_a_time *c) +static inline unsigned long has_zero (unsigned long val,unsigned long *data,const struct word_at_a_time *c) {unsigned long rhs = val | c->low_bits; *data = rhs;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 183/204 net/mlx5e: fix return value check in mlx5e_ipsec_remove_trailer()
In reply to Greg Kroah-HartmanFrom: Yuanjun Gong <[email protected]>
[ Upstream commit e5bcb7564d3bd0c88613c76963c5349be9c511c5 ]
mlx5e_ipsec_remove_trailer() should return an error code if function pskb_trim() returns an unexpected value.
--- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c +3 -1
@@ -119,7 +119,9 @@ static int mlx5e_ipsec_remove_trailer(struct sk_buff *skb, struct xfrm_state *x) trailer_len = alen + plen +2 ; -pskb_trim (skb, skb->len - trailer_len); + ret =pskb_trim (skb, skb->len - trailer_len); +if (unlikely (ret)) +return ret;if (skb->protocol ==htons (ETH_P_IP )) { ipv4hdr->tot_len =htons (ntohs (ipv4hdr->tot_len) - trailer_len);ip_send_check (ipv4hdr);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 184/204 perf test uprobe_from_different_cu: Skip if there is no gcc
In reply to Greg Kroah-HartmanFrom: Georg Müller <[email protected]>
[ Upstream commit 98ce8e4a9dcfb448b30a2d7a16190f4a00382377 ]
Without gcc, the test will fail.
On cleanup, ignore probe removal errors. Otherwise, in case of an error adding the probe, the temporary directory is not removed.
--- tools/perf/tests/shell/test_uprobe_from_different_cu.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tools/perf/tests/shell/test_uprobe_from_different_cu.sh +7 -1
@@ -4,6 +4,12 @@ set -e +# skip if there's no gcc +if ! [ -x "$(command -v gcc)" ]; then + echo "failed: no gcc compiler" + exit 2 +fi + temp_dir=$(mktemp -d /tmp/perf-uprobe-different-cu-sh.XXXXXXXXXX) cleanup()
@@ -11,7 +17,7 @@ cleanup() trap - EXIT TERM INT if [[ "${temp_dir}" =~ ^/tmp/perf-uprobe-different-cu-sh.*$ ]]; then echo "--- Cleaning up ---" - perf probe -x ${temp_dir}/testfile -d foo + perf probe -x ${temp_dir}/testfile -d foo || true rm -f "${temp_dir}/"* rmdir "${temp_dir}" fi
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 185/204 net: add missing data-race annotations around sk->sk_peek_off
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 11695c6e966b0ec7ed1d16777d294cef865a5c91 ]
sk_getsockopt() runs locklessly, thus we need to annotate the read of sk->sk_peek_off.
While we are at it, add corresponding annotations to sk_set_peek_off() and unix_set_peek_off().
--- net/core/sock.c | 4 ++-- net/unix/af_unix.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
net/core/sock.c +2 -2
@@ -1329,7 +1329,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,if (!sock->ops->set_peek_off)return -EOPNOTSUPP ; - v.val = sk->sk_peek_off; + v.val =READ_ONCE (sk->sk_peek_off);break ;case SO_NOFCS : v.val =sock_flag (sk,SOCK_NOFCS );
@@ -2480,7 +2480,7 @@ EXPORT_SYMBOL(__sk_mem_reclaim);int sk_set_peek_off (struct sock *sk,int val) { - sk->sk_peek_off = val; +WRITE_ONCE (sk->sk_peek_off, val);return 0 ; }EXPORT_SYMBOL_GPL (sk_set_peek_off);
net/unix/af_unix.c +1 -1
@@ -701,7 +701,7 @@ static int unix_set_peek_off(struct sock *sk, int val)if (mutex_lock_interruptible (&u->iolock))return -EINTR ; - sk->sk_peek_off = val; +WRITE_ONCE (sk->sk_peek_off, val);mutex_unlock (&u->iolock);return 0 ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 186/204 net: add missing data-race annotation for sk_ll_usec
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit e5f0d2dd3c2faa671711dac6d3ff3cef307bcfe3 ]
In a prior commit I forgot that sk_getsockopt() reads sk->sk_ll_usec without holding a lock.
--- net/core/sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/sock.c +1 -1
@@ -1359,7 +1359,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,#ifdef CONFIG_NET_RX_BUSY_POLL case SO_BUSY_POLL : - v.val = sk->sk_ll_usec; + v.val =READ_ONCE (sk->sk_ll_usec);break ;#endif
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 187/204 net/sched: cls_u32: No longer copy tcf_result on update to avoid use-after-free
In reply to Greg Kroah-HartmanFrom: valis <[email protected]>
[ Upstream commit 3044b16e7c6fe5d24b1cdbcf1bd0a9d92d1ebd81 ]
When u32_change() is called on an existing filter, the whole tcf_result struct is always copied into the new instance of the filter.
This causes a problem when updating a filter bound to a class, as tcf_unbind_filter() is always called on the old instance in the success path, decreasing filter_cnt of the still referenced class and allowing it to be deleted, leading to a use-after-free.
Fix this by no longer copying the tcf_result struct from the old filter.
--- net/sched/cls_u32.c | 1 - 1 file changed, 1 deletion(-)
net/sched/cls_u32.c +0 -1
@@ -870,7 +870,6 @@ static struct tc_u_knode *u32_init_knode(struct tcf_proto *tp, new->ifindex = n->ifindex;#endif new->fshift = n->fshift; - new->res = n->res; new->flags = n->flags;RCU_INIT_POINTER (new->ht_down, n->ht_down);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 188/204 net/sched: cls_route: No longer copy tcf_result on update to avoid use-after-free
In reply to Greg Kroah-HartmanFrom: valis <[email protected]>
[ Upstream commit b80b829e9e2c1b3f7aae34855e04d8f6ecaf13c8 ]
When route4_change() is called on an existing filter, the whole tcf_result struct is always copied into the new instance of the filter.
This causes a problem when updating a filter bound to a class, as tcf_unbind_filter() is always called on the old instance in the success path, decreasing filter_cnt of the still referenced class and allowing it to be deleted, leading to a use-after-free.
Fix this by no longer copying the tcf_result struct from the old filter.
--- net/sched/cls_route.c | 1 - 1 file changed, 1 deletion(-)
net/sched/cls_route.c +0 -1
@@ -512,7 +512,6 @@ static int route4_change(struct net *net, struct sk_buff *in_skb,if (fold) { f->id = fold->id; f->iif = fold->iif; - f->res = fold->res; f->handle = fold->handle; f->tp = fold->tp;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 189/204 ip6mr: Fix skb_under_panic in ip6mr_cache_report()
In reply to Greg Kroah-HartmanFrom: Yue Haibing <[email protected]>
[ Upstream commit 30e0191b16e8a58e4620fa3e2839ddc7b9d4281c ]
skbuff: skb_under_panic: text:ffffffff88771f69 len:56 put:-4
head:ffff88805f86a800 data:ffff887f5f86a850 tail:0x88 end:0x2c0 dev:pim6reg
------------[ cut here ]------------ kernel BUG at net/core/skbuff.c:192! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 2 PID: 22968 Comm: kworker/2:11 Not tainted 6.5.0-rc3-00044-g0a8db05b571a #236 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Workqueue: ipv6_addrconf addrconf_dad_work RIP: 0010:skb_panic+0x152/0x1d0 Call Trace: <TASK> skb_push+0xc4/0xe0 ip6mr_cache_report+0xd69/0x19b0 reg_vif_xmit+0x406/0x690 dev_hard_start_xmit+0x17e/0x6e0 __dev_queue_xmit+0x2d6a/0x3d20 vlan_dev_hard_start_xmit+0x3ab/0x5c0 dev_hard_start_xmit+0x17e/0x6e0 __dev_queue_xmit+0x2d6a/0x3d20 neigh_connected_output+0x3ed/0x570 ip6_finish_output2+0x5b5/0x1950 ip6_finish_output+0x693/0x11c0 ip6_output+0x24b/0x880 NF_HOOK.constprop.0+0xfd/0x530 ndisc_send_skb+0x9db/0x1400 ndisc_send_rs+0x12a/0x6c0 addrconf_dad_completed+0x3c9/0xea0 addrconf_dad_work+0x849/0x1420 process_one_work+0xa22/0x16e0 worker_thread+0x679/0x10c0 ret_from_fork+0x28/0x60 ret_from_fork_asm+0x11/0x20
When setup a vlan device on dev pim6reg, DAD ns packet may sent on reg_vif_xmit(). reg_vif_xmit()
ip6mr_cache_report()
skb_push(skb, -skb_network_offset(pkt));//skb_network_offset(pkt) is 4
And skb_push declared as:
void *skb_push(struct sk_buff *skb, unsigned int len); skb->data -= len; //0xffff88805f86a84c - 0xfffffffc = 0xffff887f5f86a850
skb->data is set to 0xffff887f5f86a850, which is invalid mem addr, lead to skb_push() fails.
--- net/ipv6/ip6mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6mr.c +1 -1
@@ -1166,7 +1166,7 @@ static int ip6mr_cache_report(struct mr6_table *mrt, struct sk_buff *pkt,And all this only to mangle msg->im6_msgtype and to set msg->im6_mbz to "mbz" :-) */ -skb_push (skb, -skb_network_offset (pkt)); +__skb_pull (skb,skb_network_offset (pkt));skb_push (skb,sizeof (*msg));skb_reset_transport_header (skb);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 190/204 tcp_metrics: fix addr_same() helper
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit e6638094d7af6c7b9dcca05ad009e79e31b4f670 ]
Because v4 and v6 families use separate inetpeer trees (respectively net->ipv4.peers and net->ipv6.peers), inetpeer_addr_cmp(a, b) assumes a & b share the same family.
tcp_metrics use a common hash table, where entries can have different families.
We must therefore make sure to not call inetpeer_addr_cmp() if the families do not match.
--- net/ipv4/tcp_metrics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_metrics.c +1 -1
@@ -80,7 +80,7 @@ static void tcp_metric_set(struct tcp_metrics_block *tm,static bool addr_same (const struct inetpeer_addr *a,const struct inetpeer_addr *b) { -return inetpeer_addr_cmp (a, b) ==0 ; +return (a->family == b->family) && !inetpeer_addr_cmp (a, b); }struct tcpm_hash_bucket {
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 191/204 tcp_metrics: annotate data-races around tm->tcpm_stamp
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 949ad62a5d5311d36fce2e14fe5fed3f936da51c ]
tm->tcpm_stamp can be read or written locklessly.
Add needed READ_ONCE()/WRITE_ONCE() to document this.
Also constify tcpm_check_stamp() dst argument.
--- net/ipv4/tcp_metrics.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
net/ipv4/tcp_metrics.c +13 -6
@@ -99,7 +99,7 @@ static void tcpm_suck_dst(struct tcp_metrics_block *tm,u32 msval;u32 val; - tm->tcpm_stamp = jiffies; +WRITE_ONCE (tm->tcpm_stamp, jiffies); val =0 ;if (dst_metric_locked (dst,RTAX_RTT ))
@@ -133,9 +133,15 @@ static void tcpm_suck_dst(struct tcp_metrics_block *tm,#define TCP_METRICS_TIMEOUT (60 * 60 * HZ) -static void tcpm_check_stamp (struct tcp_metrics_block *tm,struct dst_entry *dst) +static void tcpm_check_stamp (struct tcp_metrics_block *tm, +const struct dst_entry *dst) { -if (tm &&unlikely (time_after (jiffies, tm->tcpm_stamp +TCP_METRICS_TIMEOUT ))) +unsigned long limit; + +if (!tm) +return ; + limit =READ_ONCE (tm->tcpm_stamp) +TCP_METRICS_TIMEOUT ; +if (unlikely (time_after (jiffies, limit)))tcpm_suck_dst (tm, dst, false); }
@@ -176,7 +182,8 @@ static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst, oldest =deref_locked (tcp_metrics_hash[hash].chain);for (tm =deref_locked (oldest->tcpm_next); tm; tm =deref_locked (tm->tcpm_next)) { -if (time_before (tm->tcpm_stamp, oldest->tcpm_stamp)) +if (time_before (READ_ONCE (tm->tcpm_stamp), +READ_ONCE (oldest->tcpm_stamp))) oldest = tm; } tm = oldest;
@@ -432,7 +439,7 @@ void tcp_update_metrics(struct sock *sk) tp->reordering); } } - tm->tcpm_stamp = jiffies; +WRITE_ONCE (tm->tcpm_stamp, jiffies); out_unlock:rcu_read_unlock (); }
@@ -658,7 +665,7 @@ static int tcp_metrics_fill_info(struct sk_buff *msg, }if (nla_put_msecs (msg,TCP_METRICS_ATTR_AGE , - jiffies - tm->tcpm_stamp, + jiffies -READ_ONCE (tm->tcpm_stamp),TCP_METRICS_ATTR_PAD ) <0 ) goto nla_put_failure;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 192/204 tcp_metrics: annotate data-races around tm->tcpm_lock
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 285ce119a3c6c4502585936650143e54c8692788 ]
tm->tcpm_lock can be read or written locklessly.
Add needed READ_ONCE()/WRITE_ONCE() to document this.
--- net/ipv4/tcp_metrics.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/ipv4/tcp_metrics.c +4 -2
@@ -61,7 +61,8 @@ static inline struct net *tm_net(struct tcp_metrics_block *tm)static bool tcp_metric_locked (struct tcp_metrics_block *tm,enum tcp_metric_index idx) { -return tm->tcpm_lock & (1 << idx); +/* Paired with WRITE_ONCE() in tcpm_suck_dst() */ +return READ_ONCE (tm->tcpm_lock) & (1 << idx); } static u32 tcp_metric_get(struct tcp_metrics_block *tm,
@@ -112,7 +113,8 @@ static void tcpm_suck_dst(struct tcp_metrics_block *tm, val |=1 <<TCP_METRIC_CWND ;if (dst_metric_locked (dst,RTAX_REORDERING )) val |=1 <<TCP_METRIC_REORDERING ; - tm->tcpm_lock = val; +/* Paired with READ_ONCE() in tcp_metric_locked() */ +WRITE_ONCE (tm->tcpm_lock, val); msval =dst_metric_raw (dst,RTAX_RTT ); tm->tcpm_vals[TCP_METRIC_RTT ] = msval *USEC_PER_MSEC ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 193/204 tcp_metrics: annotate data-races around tm->tcpm_vals[]
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 8c4d04f6b443869d25e59822f7cec88d647028a9 ]
tm->tcpm_vals[] values can be read or written locklessly.
Add needed READ_ONCE()/WRITE_ONCE() to document this, and force use of tcp_metric_get() and tcp_metric_set()
--- net/ipv4/tcp_metrics.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
net/ipv4/tcp_metrics.c +14 -9
@@ -65,17 +65,19 @@ static bool tcp_metric_locked(struct tcp_metrics_block *tm,return READ_ONCE (tm->tcpm_lock) & (1 << idx); } -static u32 tcp_metric_get (struct tcp_metrics_block *tm, +static u32 tcp_metric_get (const struct tcp_metrics_block *tm,enum tcp_metric_index idx) { -return tm->tcpm_vals[idx]; +/* Paired with WRITE_ONCE() in tcp_metric_set() */ +return READ_ONCE (tm->tcpm_vals[idx]); }static void tcp_metric_set (struct tcp_metrics_block *tm,enum tcp_metric_index idx,u32 val) { - tm->tcpm_vals[idx] = val; +/* Paired with READ_ONCE() in tcp_metric_get() */ +WRITE_ONCE (tm->tcpm_vals[idx], val); } static bool addr_same(const struct inetpeer_addr *a,
@@ -117,13 +119,16 @@ static void tcpm_suck_dst(struct tcp_metrics_block *tm,WRITE_ONCE (tm->tcpm_lock, val); msval =dst_metric_raw (dst,RTAX_RTT ); - tm->tcpm_vals[TCP_METRIC_RTT ] = msval *USEC_PER_MSEC ; +tcp_metric_set (tm,TCP_METRIC_RTT , msval *USEC_PER_MSEC ); msval =dst_metric_raw (dst,RTAX_RTTVAR ); - tm->tcpm_vals[TCP_METRIC_RTTVAR ] = msval *USEC_PER_MSEC ; - tm->tcpm_vals[TCP_METRIC_SSTHRESH ] =dst_metric_raw (dst,RTAX_SSTHRESH ); - tm->tcpm_vals[TCP_METRIC_CWND ] =dst_metric_raw (dst,RTAX_CWND ); - tm->tcpm_vals[TCP_METRIC_REORDERING ] =dst_metric_raw (dst,RTAX_REORDERING ); +tcp_metric_set (tm,TCP_METRIC_RTTVAR , msval *USEC_PER_MSEC ); +tcp_metric_set (tm,TCP_METRIC_SSTHRESH , +dst_metric_raw (dst,RTAX_SSTHRESH )); +tcp_metric_set (tm,TCP_METRIC_CWND , +dst_metric_raw (dst,RTAX_CWND )); +tcp_metric_set (tm,TCP_METRIC_REORDERING , +dst_metric_raw (dst,RTAX_REORDERING ));if (fastopen_clear) { tm->tcpm_fastopen.mss =0 ; tm->tcpm_fastopen.syn_loss =0 ;
@@ -678,7 +683,7 @@ static int tcp_metrics_fill_info(struct sk_buff *msg,if (!nest) goto nla_put_failure;for (i =0 ; i <TCP_METRIC_MAX_KERNEL +1 ; i++) { -u32 val = tm->tcpm_vals[i]; +u32 val =tcp_metric_get (tm, i);if (!val)continue ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 194/204 tcp_metrics: annotate data-races around tm->tcpm_net
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit d5d986ce42c71a7562d32c4e21e026b0f87befec ]
tm->tcpm_net can be read or written locklessly.
Instead of changing write_pnet() and read_pnet() and potentially hurt performance, add the needed READ_ONCE()/WRITE_ONCE() in tm_net() and tcpm_new().
--- net/ipv4/tcp_metrics.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
net/ipv4/tcp_metrics.c +7 -4
@@ -42,7 +42,7 @@ struct tcp_fastopen_metrics {struct tcp_metrics_block {struct tcp_metrics_block __rcu *tcpm_next; -possible_net_t tcpm_net; +struct net *tcpm_net;struct inetpeer_addr tcpm_saddr;struct inetpeer_addr tcpm_daddr;unsigned long tcpm_stamp;
@@ -53,9 +53,10 @@ struct tcp_metrics_block {struct rcu_head rcu_head; }; -static inline struct net *tm_net (struct tcp_metrics_block *tm) +static inline struct net *tm_net (const struct tcp_metrics_block *tm) { -return read_pnet (&tm->tcpm_net); +/* Paired with the WRITE_ONCE() in tcpm_new() */ +return READ_ONCE (tm->tcpm_net); } static bool tcp_metric_locked(struct tcp_metrics_block *tm,
@@ -199,7 +200,9 @@ static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst,if (!tm) goto out_unlock; } -write_pnet (&tm->tcpm_net, net); +/* Paired with the READ_ONCE() in tm_net() */ +WRITE_ONCE (tm->tcpm_net, net); + tm->tcpm_saddr = *saddr; tm->tcpm_daddr = *daddr;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 195/204 tcp_metrics: fix data-race in tcpm_suck_dst() vs fastopen
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit ddf251fa2bc1d3699eec0bae6ed0bc373b8fda79 ]
Whenever tcpm_new() reclaims an old entry, tcpm_suck_dst() would overwrite data that could be read from tcp_fastopen_cache_get() or tcp_metrics_fill_info().
We need to acquire fastopen_seqlock to maintain consistency.
For newly allocated objects, tcpm_new() can switch to kzalloc() to avoid an extra fastopen_seqlock acquisition.
--- net/ipv4/tcp_metrics.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
net/ipv4/tcp_metrics.c +5 -4
@@ -95,6 +95,7 @@ static struct tcpm_hash_bucket *tcp_metrics_hash __read_mostly;static unsigned int tcp_metrics_hash_log__read_mostly ;static DEFINE_SPINLOCK (tcp_metrics_lock); +static DEFINE_SEQLOCK (fastopen_seqlock); static void tcpm_suck_dst(struct tcp_metrics_block *tm, const struct dst_entry *dst,
@@ -131,11 +132,13 @@ static void tcpm_suck_dst(struct tcp_metrics_block *tm,tcp_metric_set (tm,TCP_METRIC_REORDERING ,dst_metric_raw (dst,RTAX_REORDERING ));if (fastopen_clear) { +write_seqlock (&fastopen_seqlock); tm->tcpm_fastopen.mss =0 ; tm->tcpm_fastopen.syn_loss =0 ; tm->tcpm_fastopen.try_exp =0 ; tm->tcpm_fastopen.cookie.exp = false; tm->tcpm_fastopen.cookie.len =0 ; +write_sequnlock (&fastopen_seqlock); } }
@@ -196,7 +199,7 @@ static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst, } tm = oldest; }else { - tm =kmalloc (sizeof (*tm),GFP_ATOMIC ); + tm =kzalloc (sizeof (*tm),GFP_ATOMIC );if (!tm) goto out_unlock; }
@@ -206,7 +209,7 @@ static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst, tm->tcpm_saddr = *saddr; tm->tcpm_daddr = *daddr; -tcpm_suck_dst (tm, dst, true); +tcpm_suck_dst (tm, dst, reclaim);if (likely (!reclaim)) { tm->tcpm_next = tcp_metrics_hash[hash].chain;
@@ -564,8 +567,6 @@ bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst)return ret; } -static DEFINE_SEQLOCK (fastopen_seqlock); -void tcp_fastopen_cache_get (struct sock *sk,u16 *mss,struct tcp_fastopen_cookie *cookie,int *syn_loss,unsigned long *last_syn_loss)
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 196/204 loop: Select I/O scheduler none from inside add_disk()
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
commit 2112f5c1330a671fa852051d85cb9eadc05d7eb7 upstream.
We noticed that the user interface of Android devices becomes very slow under memory pressure. This is because Android uses the zram driver on top of the loop driver for swapping, because under memory pressure the swap code alternates reads and writes quickly, because mq-deadline is the default scheduler for loop devices and because mq-deadline delays writes by five seconds for such a workload with default settings. Fix this by making the kernel select I/O scheduler 'none' from inside add_disk() for loop devices. This default can be overridden at any time from user space, e.g. via a udev rule. This approach has an advantage compared to changing the I/O scheduler from userspace from 'mq-deadline' into 'none', namely that synchronize_rcu() does not get called.
This patch changes the default I/O scheduler for loop devices from 'mq-deadline' into 'none'.
Additionally, this patch reduces the Android boot time on my test setup with 0.5 seconds compared to configuring the loop I/O scheduler from user space.
--- drivers/block/loop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/block/loop.c +2 -1
@@ -1846,7 +1846,8 @@ static int loop_add(struct loop_device * lo->tag_set.queue_depth =128 ; lo->tag_set.numa_node =NUMA_NO_NODE ; lo->tag_set.cmd_size =sizeof (struct loop_cmd ); - lo->tag_set.flags =BLK_MQ_F_SHOULD_MERGE |BLK_MQ_F_SG_MERGE ; + lo->tag_set.flags =BLK_MQ_F_SHOULD_MERGE |BLK_MQ_F_SG_MERGE | +BLK_MQ_F_NO_SCHED ; lo->tag_set.driver_data = lo; err =blk_mq_alloc_tag_set (&lo->tag_set);
Greg Kroah-Hartman
maintainerPATCH 197/204 libceph: fix potential hang in ceph_osdc_notify()
In reply to Greg Kroah-HartmanFrom: Ilya Dryomov <[email protected]>
commit e6e2843230799230fc5deb8279728a7218b0d63c upstream.
If the cluster becomes unavailable, ceph_osdc_notify() may hang even with osd_request_timeout option set because linger_notify_finish_wait() waits for MWatchNotify NOTIFY_COMPLETE message with no associated OSD request in flight -- it's completely asynchronous.
Introduce an additional timeout, derived from the specified notify timeout. While at it, switch both waits to killable which is more correct.
--- net/ceph/osd_client.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
net/ceph/osd_client.c +14 -6
@@ -3041,17 +3041,24 @@ static int linger_reg_commit_wait(structint ret;dout ("%s lreq %p linger_id %llu\n" , __func__, lreq, lreq->linger_id); - ret =wait_for_completion_interruptible (&lreq->reg_commit_wait); + ret =wait_for_completion_killable (&lreq->reg_commit_wait);return ret ?: lreq->reg_commit_error; } -static int linger_notify_finish_wait (struct ceph_osd_linger_request *lreq) +static int linger_notify_finish_wait (struct ceph_osd_linger_request *lreq, +unsigned long timeout) { -int ret; +long left;dout ("%s lreq %p linger_id %llu\n" , __func__, lreq, lreq->linger_id); - ret =wait_for_completion_interruptible (&lreq->notify_finish_wait); -return ret ?: lreq->notify_finish_error; + left =wait_for_completion_killable_timeout (&lreq->notify_finish_wait, +ceph_timeout_jiffies (timeout)); +if (left <=0 ) + left = left ?: -ETIMEDOUT ; +else + left = lreq->notify_finish_error;/* completed */ + +return left; }/*
@@ -4666,7 +4673,8 @@ int ceph_osdc_notify(struct ceph_osd_cli ret =linger_reg_commit_wait (lreq);if (!ret) - ret =linger_notify_finish_wait (lreq); + ret =linger_notify_finish_wait (lreq, +msecs_to_jiffies (2 * timeout *MSEC_PER_SEC ));else dout ("lreq %p failed to initiate notify %d\n" , lreq, ret);
Greg Kroah-Hartman
maintainerPATCH 198/204 USB: zaurus: Add ID for A-300/B-500/C-700
In reply to Greg Kroah-HartmanFrom: Ross Maynard <[email protected]>
commit b99225b4fe297d07400f9e2332ecd7347b224f8d upstream.
The SL-A300, B500/5600, and C700 devices no longer auto-load because of "usbnet: Remove over-broad module alias from zaurus."
This patch adds IDs for those 3 devices.
--- drivers/net/usb/cdc_ether.c | 21 +++++++++++++++++++++ drivers/net/usb/zaurus.c | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+)
drivers/net/usb/cdc_ether.c +21 -0
@@ -618,6 +618,13 @@ static const struct usb_device_id produc .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | USB_DEVICE_ID_MATCH_DEVICE, .idVendor = 0x04DD, + .idProduct =0x8005 ,/* A-300 */ +ZAURUS_FAKE_INTERFACE , + .driver_info = 0, +}, { + .match_flags =USB_DEVICE_ID_MATCH_INT_INFO + |USB_DEVICE_ID_MATCH_DEVICE , + .idVendor = 0x04DD, .idProduct = 0x8006, /* B-500/SL-5600 */ZAURUS_MASTER_INTERFACE , .driver_info = 0,
@@ -625,11 +632,25 @@ static const struct usb_device_id produc .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | USB_DEVICE_ID_MATCH_DEVICE, .idVendor = 0x04DD, + .idProduct =0x8006 ,/* B-500/SL-5600 */ +ZAURUS_FAKE_INTERFACE , + .driver_info = 0, +}, { + .match_flags =USB_DEVICE_ID_MATCH_INT_INFO + |USB_DEVICE_ID_MATCH_DEVICE , + .idVendor = 0x04DD, .idProduct = 0x8007, /* C-700 */ZAURUS_MASTER_INTERFACE , .driver_info = 0, }, { .match_flags =USB_DEVICE_ID_MATCH_INT_INFO + |USB_DEVICE_ID_MATCH_DEVICE , + .idVendor = 0x04DD, + .idProduct = 0x8007, /* C-700 */ +ZAURUS_FAKE_INTERFACE , + .driver_info = 0, +}, { + .match_flags =USB_DEVICE_ID_MATCH_INT_INFO |USB_DEVICE_ID_MATCH_DEVICE , .idVendor = 0x04DD, .idProduct = 0x9031, /* C-750 C-760 */
drivers/net/usb/zaurus.c +21 -0
@@ -301,11 +301,25 @@ static const struct usb_device_id produc .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | USB_DEVICE_ID_MATCH_DEVICE, .idVendor = 0x04DD, + .idProduct =0x8005 ,/* A-300 */ +ZAURUS_FAKE_INTERFACE , + .driver_info = (unsigned long)&bogus_mdlm_info, +}, { + .match_flags =USB_DEVICE_ID_MATCH_INT_INFO + |USB_DEVICE_ID_MATCH_DEVICE , + .idVendor = 0x04DD, .idProduct = 0x8006, /* B-500/SL-5600 */ZAURUS_MASTER_INTERFACE , .driver_info = ZAURUS_PXA_INFO, }, { .match_flags =USB_DEVICE_ID_MATCH_INT_INFO + |USB_DEVICE_ID_MATCH_DEVICE , + .idVendor = 0x04DD, + .idProduct = 0x8006, /* B-500/SL-5600 */ +ZAURUS_FAKE_INTERFACE , + .driver_info = (unsigned long)&bogus_mdlm_info, +}, { + .match_flags =USB_DEVICE_ID_MATCH_INT_INFO |USB_DEVICE_ID_MATCH_DEVICE , .idVendor = 0x04DD, .idProduct = 0x8007, /* C-700 */
@@ -313,6 +327,13 @@ static const struct usb_device_id produc .driver_info = ZAURUS_PXA_INFO, }, { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO + | USB_DEVICE_ID_MATCH_DEVICE, + .idVendor = 0x04DD, + .idProduct =0x8007 ,/* C-700 */ +ZAURUS_FAKE_INTERFACE , + .driver_info = (unsigned long)&bogus_mdlm_info, +}, { + .match_flags =USB_DEVICE_ID_MATCH_INT_INFO |USB_DEVICE_ID_MATCH_DEVICE , .idVendor = 0x04DD, .idProduct = 0x9031, /* C-750 C-760 */
Greg Kroah-Hartman
maintainerPATCH 199/204 fs/sysv: Null check to prevent null-ptr-deref bug
In reply to Greg Kroah-HartmanFrom: Prince Kumar Maurya <[email protected]>
commit ea2b62f305893992156a798f665847e0663c9f41 upstream.
sb_getblk(inode->i_sb, parent) return a null ptr and taking lock on that leads to the null-ptr-deref bug.
Message-Id: <[email protected]>
--- fs/sysv/itree.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/sysv/itree.c +4 -0
@@ -145,6 +145,10 @@ static int alloc_branch(struct inode *in*/ parent =block_to_cpu (SYSV_SB (inode->i_sb), branch[n-1 ].key); bh =sb_getblk (inode->i_sb, parent); +if (!bh) { +sysv_free_block (inode->i_sb, branch[n].key); +break ; + }lock_buffer (bh);memset (bh->b_data,0 , blocksize); branch[n].bh = bh;
Greg Kroah-Hartman
maintainerPATCH 200/204 Bluetooth: L2CAP: Fix use-after-free in l2cap_sock_ready_cb
In reply to Greg Kroah-HartmanFrom: Sungwoo Kim <[email protected]>
commit 1728137b33c00d5a2b5110ed7aafb42e7c32e4a1 upstream.
l2cap_sock_release(sk) frees sk. However, sk's children are still alive and point to the already free'd sk's address.
To fix this, l2cap_sock_release(sk) also cleans sk's children.
==================================================================
BUG: KASAN: use-after-free in l2cap_sock_ready_cb+0xb7/0x100 net/bluetooth/l2cap_sock.c:1650 Read of size 8 at addr ffff888104617aa8 by task kworker/u3:0/276 CPU: 0 PID: 276 Comm: kworker/u3:0 Not tainted 6.2.0-00001-gef397bd4d5fb-dirty #59 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Workqueue: hci2 hci_rx_work Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x72/0x95 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x175/0x478 mm/kasan/report.c:417 kasan_report+0xb1/0x130 mm/kasan/report.c:517 l2cap_sock_ready_cb+0xb7/0x100 net/bluetooth/l2cap_sock.c:1650 l2cap_chan_ready+0x10e/0x1e0 net/bluetooth/l2cap_core.c:1386 l2cap_config_req+0x753/0x9f0 net/bluetooth/l2cap_core.c:4480 l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:5739 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:6509 [inline] l2cap_recv_frame+0xe2e/0x43c0 net/bluetooth/l2cap_core.c:7788 l2cap_recv_acldata+0x6ed/0x7e0 net/bluetooth/l2cap_core.c:8506 hci_acldata_packet net/bluetooth/hci_core.c:3813 [inline] hci_rx_work+0x66e/0xbc0 net/bluetooth/hci_core.c:4048 process_one_work+0x4ea/0x8e0 kernel/workqueue.c:2289 worker_thread+0x364/0x8e0 kernel/workqueue.c:2436 kthread+0x1b9/0x200 kernel/kthread.c:376 ret_from_fork+0x2c/0x50 arch/x86/entry/entry_64.S:308 </TASK> Allocated by task 288: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x82/0x90 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:968 [inline] __kmalloc+0x5a/0x140 mm/slab_common.c:981 kmalloc include/linux/slab.h:584 [inline] sk_prot_alloc+0x113/0x1f0 net/core/sock.c:2040 sk_alloc+0x36/0x3c0 net/core/sock.c:2093 l2cap_sock_alloc.constprop.0+0x39/0x1c0 net/bluetooth/l2cap_sock.c:1852 l2cap_sock_create+0x10d/0x220 net/bluetooth/l2cap_sock.c:1898 bt_sock_create+0x183/0x290 net/bluetooth/af_bluetooth.c:132 __sock_create+0x226/0x380 net/socket.c:1518 sock_create net/socket.c:1569 [inline] __sys_socket_create net/socket.c:1606 [inline] __sys_socket_create net/socket.c:1591 [inline] __sys_socket+0x112/0x200 net/socket.c:1639 __do_sys_socket net/socket.c:1652 [inline] __se_sys_socket net/socket.c:1650 [inline] __x64_sys_socket+0x40/0x50 net/socket.c:1650 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc Freed by task 288: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:523 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free mm/kasan/common.c:200 [inline] __kasan_slab_free+0x10a/0x190 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0x88/0x1f0 mm/slub.c:3800 sk_prot_free net/core/sock.c:2076 [inline] __sk_destruct+0x347/0x430 net/core/sock.c:2168 sk_destruct+0x9c/0xb0 net/core/sock.c:2183 __sk_free+0x82/0x220 net/core/sock.c:2194 sk_free+0x7c/0xa0 net/core/sock.c:2205 sock_put include/net/sock.h:1991 [inline] l2cap_sock_kill+0x256/0x2b0 net/bluetooth/l2cap_sock.c:1257 l2cap_sock_release+0x1a7/0x220 net/bluetooth/l2cap_sock.c:1428 __sock_release+0x80/0x150 net/socket.c:650 sock_close+0x19/0x30 net/socket.c:1368 __fput+0x17a/0x5c0 fs/file_table.c:320 task_work_run+0x132/0x1c0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x113/0x120 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x21/0x50 kernel/entry/common.c:296 do_syscall_64+0x4c/0x90 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x72/0xdc The buggy address belongs to the object at ffff888104617800 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 680 bytes inside of
1024-byte region [ffff888104617800, ffff888104617c00)
The buggy address belongs to the physical page:
page:00000000dbca6a80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888104614000 pfn:0x104614
head:00000000dbca6a80 order:2 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0
flags: 0x200000000010200(slab|head|node=0|zone=2)
raw: 0200000000010200 ffff888100041dc0 ffffea0004212c10 ffffea0004234b10
raw: ffff888104614000 0000000000080002 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888104617980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888104617a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888104617a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888104617b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888104617b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================Ack: This bug is found by FuzzBT with a modified Syzkaller. Other contributors are Ruoyu Wu and Hui Peng.
--- net/bluetooth/l2cap_sock.c | 2 ++ 1 file changed, 2 insertions(+)
net/bluetooth/l2cap_sock.c +2 -0
@@ -45,6 +45,7 @@ static const struct proto_ops l2cap_sockstatic void l2cap_sock_init (struct sock *sk,struct sock *parent);static struct sock *l2cap_sock_alloc (struct net *net,struct socket *sock,int proto,gfp_t prio,int kern); +static void l2cap_sock_cleanup_listen (struct sock *parent);bool l2cap_is_socket (struct socket *sock) {
@@ -1206,6 +1207,7 @@ static int l2cap_sock_release(struct socif (!sk)return 0 ; +l2cap_sock_cleanup_listen (sk);bt_sock_unlink (&l2cap_sk_list, sk); err =l2cap_sock_shutdown (sock,2 );
Greg Kroah-Hartman
maintainerPATCH 201/204 net: usbnet: Fix WARNING in usbnet_start_xmit/usb_submit_urb
In reply to Greg Kroah-HartmanFrom: Alan Stern <[email protected]>
commit 5e1627cb43ddf1b24b92eb26f8d958a3f5676ccb upstream.
The syzbot fuzzer identified a problem in the usbnet driver:
usb 1-1: BOGUS urb xfer, pipe 3 != type 1
WARNING: CPU: 0 PID: 754 at drivers/usb/core/urb.c:504 usb_submit_urb+0xed6/0x1880 drivers/usb/core/urb.c:504 Modules linked in: CPU: 0 PID: 754 Comm: kworker/0:2 Not tainted 6.4.0-rc7-syzkaller-00014-g692b7dc87ca6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Workqueue: mld mld_ifc_work RIP: 0010:usb_submit_urb+0xed6/0x1880 drivers/usb/core/urb.c:504 Code: 7c 24 18 e8 2c b4 5b fb 48 8b 7c 24 18 e8 42 07 f0 fe 41 89 d8 44 89 e1 4c 89 ea 48 89 c6 48 c7 c7 a0 c9 fc 8a e8 5a 6f 23 fb <0f> 0b e9 58 f8 ff ff e8 fe b3 5b fb 48 81 c5 c0 05 00 00 e9 84 f7 RSP: 0018:ffffc9000463f568 EFLAGS: 00010086 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000 RDX: ffff88801eb28000 RSI: ffffffff814c03b7 RDI: 0000000000000001 RBP: ffff8881443b7190 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000003 R13: ffff88802a77cb18 R14: 0000000000000003 R15: ffff888018262500 FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000556a99c15a18 CR3: 0000000028c71000 CR4: 0000000000350ef0 Call Trace: <TASK> usbnet_start_xmit+0xfe5/0x2190 drivers/net/usb/usbnet.c:1453 __netdev_start_xmit include/linux/netdevice.h:4918 [inline] netdev_start_xmit include/linux/netdevice.h:4932 [inline] xmit_one net/core/dev.c:3578 [inline] dev_hard_start_xmit+0x187/0x700 net/core/dev.c:3594
...
This bug is caused by the fact that usbnet trusts the bulk endpoint addresses its probe routine receives in the driver_info structure, and it does not check to see that these endpoints actually exist and have the expected type and directions.
The fix is simply to add such a check.
--- drivers/net/usb/usbnet.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/usb/usbnet.c +6 -0
@@ -1771,6 +1771,10 @@ usbnet_probe (struct usb_interface *udev }else if (!info->in || !info->out) status =usbnet_get_endpoints (dev, udev);else { +u8 ep_addrs[3 ] = { + info->in +USB_DIR_IN , info->out +USB_DIR_OUT ,0 + }; + dev->in =usb_rcvbulkpipe (xdev, info->in); dev->out =usb_sndbulkpipe (xdev, info->out);if (!(info->flags &FLAG_NO_SETINT ))
@@ -1780,6 +1784,8 @@ usbnet_probe (struct usb_interface *udevelse status =0 ; +if (status ==0 && !usb_check_bulk_endpoints (udev, ep_addrs)) + status = -EINVAL ; }if (status >=0 && dev->status) status =init_status (dev, udev);
Greg Kroah-Hartman
maintainerPATCH 202/204 ext2: Drop fragment support
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 404615d7f1dcd4cca200e9a7a9df3a1dcae1dd62 upstream.
Ext2 has fields in superblock reserved for subblock allocation support. However that never landed. Drop the many years dead code.
--- fs/ext2/ext2.h | 12 ------------ fs/ext2/super.c | 23 ++++------------------- 2 files changed, 4 insertions(+), 31 deletions(-)
fs/ext2/ext2.h +0 -12
@@ -68,10 +68,7 @@ struct mb_cache;* second extended-fs super-block data in memory */ struct ext2_sb_info { -unsigned long s_frag_size;/* Size of a fragment in bytes */ -unsigned long s_frags_per_block;/* Number of fragments per block */ unsigned long s_inodes_per_block;/* Number of inodes per block */ -unsigned long s_frags_per_group;/* Number of fragments in a group */ unsigned long s_blocks_per_group;/* Number of blocks in a group */ unsigned long s_inodes_per_group;/* Number of inodes in a group */ unsigned long s_itb_per_group;/* Number of inode table blocks per group */
@@ -186,15 +183,6 @@ static inline struct ext2_sb_info *EXT2_#define EXT2_FIRST_INO (s) (EXT2_SB(s)->s_first_ino)/* -* Macro-instructions used to manage fragments -*/ -#define EXT2_MIN_FRAG_SIZE 1024 -#define EXT2_MAX_FRAG_SIZE 4096 -#define EXT2_MIN_FRAG_LOG_SIZE 10 -#define EXT2_FRAG_SIZE (s) (EXT2_SB(s)->s_frag_size) -#define EXT2_FRAGS_PER_BLOCK (s) (EXT2_SB(s)->s_frags_per_block) - -/* * Structure of a blocks group descriptor */ struct ext2_group_desc
fs/ext2/super.c +4 -19
@@ -684,10 +684,9 @@ static int ext2_setup_super (struct supe es->s_max_mnt_count =cpu_to_le16 (EXT2_DFL_MAX_MNT_COUNT );le16_add_cpu (&es->s_mnt_count,1 );if (test_opt (sb,DEBUG )) - ext2_msg(sb, KERN_INFO, "%s, %s, bs=%lu, fs=%lu, gc=%lu, " + ext2_msg(sb, KERN_INFO, "%s, %s, bs=%lu, gc=%lu, " "bpg=%lu, ipg=%lu, mo=%04lx]", EXT2FS_VERSION, EXT2FS_DATE, sb->s_blocksize, - sbi->s_frag_size, sbi->s_groups_count, EXT2_BLOCKS_PER_GROUP(sb), EXT2_INODES_PER_GROUP(sb),
@@ -1024,14 +1023,7 @@ static int ext2_fill_super(struct super_ } } - sbi->s_frag_size =EXT2_MIN_FRAG_SIZE << -le32_to_cpu (es->s_log_frag_size); -if (sbi->s_frag_size ==0 ) - goto cantfind_ext2; - sbi->s_frags_per_block = sb->s_blocksize / sbi->s_frag_size; - sbi->s_blocks_per_group =le32_to_cpu (es->s_blocks_per_group); - sbi->s_frags_per_group =le32_to_cpu (es->s_frags_per_group); sbi->s_inodes_per_group =le32_to_cpu (es->s_inodes_per_group);if (EXT2_INODE_SIZE (sb) ==0 )
@@ -1059,11 +1051,10 @@ static int ext2_fill_super(struct super_ goto failed_mount; } -if (sb->s_blocksize != sbi->s_frag_size) { +if (es->s_log_frag_size != es->s_log_block_size) {ext2_msg (sb,KERN_ERR , -"error: fragsize %lu != blocksize %lu" -"(not supported yet)" , - sbi->s_frag_size, sb->s_blocksize); +"error: fragsize log %u != blocksize log %u" , +le32_to_cpu (es->s_log_frag_size), sb->s_blocksize_bits); goto failed_mount; }
@@ -1073,12 +1064,6 @@ static int ext2_fill_super(struct super_ sbi->s_blocks_per_group); goto failed_mount; } -if (sbi->s_frags_per_group > sb->s_blocksize *8 ) { -ext2_msg (sb,KERN_ERR , -"error: #fragments per group too big: %lu" , - sbi->s_frags_per_group); - goto failed_mount; - }if (sbi->s_inodes_per_group < sbi->s_inodes_per_block || sbi->s_inodes_per_group > sb->s_blocksize *8 ) { ext2_msg(sb, KERN_ERR,
Greg Kroah-Hartman
maintainerPATCH 203/204 test_firmware: fix a memory leak with reqs buffer
In reply to Greg Kroah-HartmanFrom: Mirsad Goran Todorovac <[email protected]>
commit be37bed754ed90b2655382f93f9724b3c1aae847 upstream.
Dan Carpenter spotted that test_fw_config->reqs will be leaked if trigger_batched_requests_store() is called two or more times. The same appears with trigger_batched_requests_async_store().
This bug wasn't trigger by the tests, but observed by Dan's visual inspection of the code.
The recommended workaround was to return -EBUSY if test_fw_config->reqs is already allocated.
--- lib/test_firmware.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
lib/test_firmware.c +10 -0
@@ -621,6 +621,11 @@ static ssize_t trigger_batched_requests_mutex_lock (&test_fw_mutex); +if (test_fw_config->reqs) { + rc = -EBUSY ; + goto out_bail; + } + test_fw_config->reqs =vzalloc (sizeof (struct test_batched_req ) * test_fw_config->num_requests *2 );if (!test_fw_config->reqs) {
@@ -723,6 +728,11 @@ ssize_t trigger_batched_requests_async_smutex_lock (&test_fw_mutex); +if (test_fw_config->reqs) { + rc = -EBUSY ; + goto out_bail; + } + test_fw_config->reqs =vzalloc (sizeof (struct test_batched_req ) * test_fw_config->num_requests *2 );if (!test_fw_config->reqs) {
Greg Kroah-Hartman
maintainerPATCH 204/204 mtd: rawnand: omap_elm: Fix incorrect type in assignment
In reply to Greg Kroah-HartmanFrom: Roger Quadros <[email protected]>
[ Upstream commit d8403b9eeee66d5dd81ecb9445800b108c267ce3 ]
Once the ECC word endianness is converted to BE32, we force cast it to u32 so we can use elm_write_reg() which in turn uses writel().
Fixes below sparse warnings:
drivers/mtd/nand/raw/omap_elm.c:180:37: sparse: expected unsigned int [usertype] val drivers/mtd/nand/raw/omap_elm.c:180:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:185:37: sparse: expected unsigned int [usertype] val drivers/mtd/nand/raw/omap_elm.c:185:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:190:37: sparse: expected unsigned int [usertype] val drivers/mtd/nand/raw/omap_elm.c:190:37: sparse: got restricted __be32 [usertype]
Quoted 1 line
Quoted 1 line
drivers/mtd/nand/raw/omap_elm.c:200:40: sparse: sparse: restricted__be32degrades to integer
drivers/mtd/nand/raw/omap_elm.c:206:39: sparse: sparse: restricted __be32 degrades to integer
drivers/mtd/nand/raw/omap_elm.c:210:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:210:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:213:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:213:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:216:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:216:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:219:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:219:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:222:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:222:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:225:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:225:37: sparse: got restricted __be32 [usertype]
drivers/mtd/nand/raw/omap_elm.c:228:39: sparse: sparse: restricted __be32 degrades to integer
--- drivers/mtd/nand/omap_elm.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/mtd/nand/omap_elm.c +12 -12
@@ -184,17 +184,17 @@ static void elm_load_syndrome(struct elm_info *info,switch (info->bch_type) {case BCH8_ECC :/* syndrome fragment 0 = ecc[9-12B] */ - val =cpu_to_be32 (*(u32 *) &ecc[9 ]); + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[9 ]);elm_write_reg (info, offset, val);/* syndrome fragment 1 = ecc[5-8B] */ offset +=4 ; - val =cpu_to_be32 (*(u32 *) &ecc[5 ]); + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[5 ]);elm_write_reg (info, offset, val);/* syndrome fragment 2 = ecc[1-4B] */ offset +=4 ; - val =cpu_to_be32 (*(u32 *) &ecc[1 ]); + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[1 ]);elm_write_reg (info, offset, val);/* syndrome fragment 3 = ecc[0B] */
@@ -204,35 +204,35 @@ static void elm_load_syndrome(struct elm_info *info,break ;case BCH4_ECC :/* syndrome fragment 0 = ecc[20-52b] bits */ - val = (cpu_to_be32 (*(u32 *) &ecc[3 ]) >>4 ) | + val = ((__force u32 )cpu_to_be32 (*(u32 *)&ecc[3 ]) >>4 ) | ((ecc[2 ] &0xf ) <<28 );elm_write_reg (info, offset, val);/* syndrome fragment 1 = ecc[0-20b] bits */ offset +=4 ; - val =cpu_to_be32 (*(u32 *) &ecc[0 ]) >>12 ; + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[0 ]) >>12 ;elm_write_reg (info, offset, val);break ;case BCH16_ECC : - val =cpu_to_be32 (*(u32 *) &ecc[22 ]); + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[22 ]);elm_write_reg (info, offset, val); offset +=4 ; - val =cpu_to_be32 (*(u32 *) &ecc[18 ]); + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[18 ]);elm_write_reg (info, offset, val); offset +=4 ; - val =cpu_to_be32 (*(u32 *) &ecc[14 ]); + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[14 ]);elm_write_reg (info, offset, val); offset +=4 ; - val =cpu_to_be32 (*(u32 *) &ecc[10 ]); + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[10 ]);elm_write_reg (info, offset, val); offset +=4 ; - val =cpu_to_be32 (*(u32 *) &ecc[6 ]); + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[6 ]);elm_write_reg (info, offset, val); offset +=4 ; - val =cpu_to_be32 (*(u32 *) &ecc[2 ]); + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[2 ]);elm_write_reg (info, offset, val); offset +=4 ; - val =cpu_to_be32 (*(u32 *) &ecc[0 ]) >>16 ; + val = (__force u32 )cpu_to_be32 (*(u32 *)&ecc[0 ]) >>16 ;elm_write_reg (info, offset, val);break ;default :
Signature · 1 line
2.40.1
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.14.322 release. There are 204 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 Fri, 11 Aug 2023 10:36:10 +0000. Anything received after that time might be too late.
No problems seen on x86_64 and aarch64.
Thanks,
Harshit
Quoted 9 lines
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.322-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.14.y
and the diffstat can be found below.thanks,
greg k-h
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.14.322 release. There are 204 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.
Building sparc64:allnoconfig ... failed
--------------
Error log:
sparc64-linux-ld: init/main.o: in function `start_kernel':
main.c:(.init.text+0x77c): undefined reference to `arch_cpu_finalize_init' make[1]: *** [Makefile:1049: vmlinux] Error 1
make: *** [Makefile:153: sub-make] Error 2
--------------
Building sparc64:tinyconfig ... failed
--------------
Error log:
sparc64-linux-ld: init/main.o: in function `start_kernel':
main.c:(.init.text+0x764): undefined reference to `arch_cpu_finalize_init' make[1]: *** [Makefile:1049: vmlinux] Error 1
make: *** [Makefile:153: sub-make] Error 2
Quoted 7 lines · Guenter Roeck
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.14.322 release. There are 204 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.
Quoted 15 lines
Building sparc64:allnoconfig ... failed
--------------
Error log:
sparc64-linux-ld:init/main.o: in function `start_kernel':
main.c:(.init.text+0x77c): undefined reference to `arch_cpu_finalize_init' make[1]: *** [Makefile:1049: vmlinux] Error 1
make: *** [Makefile:153: sub-make] Error 2
--------------
Building sparc64:tinyconfig ... failed
--------------
Error log:
sparc64-linux-ld:init/main.o: in function `start_kernel':
main.c:(.init.text+0x764): undefined reference to `arch_cpu_finalize_init' make[1]: *** [Makefile:1049: vmlinux] Error 1
make: *** [Makefile:153: sub-make] Error 2
Those build failures were introduced with v4.14.321.
Guenter
Greg Kroah-Hartman
maintainerQuoted 24 lines · Guenter Roeck
Quoted 7 lines · Guenter Roeck
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.14.322 release. There are 204 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.
Quoted 15 lines
Building sparc64:allnoconfig ... failed
--------------
Error log:
sparc64-linux-ld:init/main.o: in function `start_kernel':
main.c:(.init.text+0x77c): undefined reference to `arch_cpu_finalize_init' make[1]: *** [Makefile:1049: vmlinux] Error 1
make: *** [Makefile:153: sub-make] Error 2
--------------
Building sparc64:tinyconfig ... failed
--------------
Error log:
sparc64-linux-ld:init/main.o: in function `start_kernel':
main.c:(.init.text+0x764): undefined reference to `arch_cpu_finalize_init' make[1]: *** [Makefile:1049: vmlinux] Error 1
make: *** [Makefile:153: sub-make] Error 2
Quoted 1 line
Those build failures were introduced with v4.14.321.
Thanks, let me leave them for now so I can get these updates out and then work on the build breakages that the releases earlier this week caused on arches and different compilers (i.e. clang).
thanks,
greg k-h
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.14.322 release. There are 204 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 Fri, 11 Aug 2023 10:36:10 +0000. Anything received after that time might be too late.
Build results:
total: 159 pass: 157 fail: 2
Failed builds:
sparc64:allnoconfig
sparc64:tinyconfig
Qemu test results:
total: 431 pass: 429 fail: 2 Failed tests: sparc64:sun4u:nodebug:nosmp:ata:net,e1000:hd sparc64:sun4v:nodebug:nosmp:ata:net,pcnet:hd
All errors as already reported, introduced with 4.14.321 which wasn't tested. The errors are seen in nosmp builds.
Guenter
Hello!
Quoted 23 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.14.322 release. There are 204 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 Fri, 11 Aug 2023 10:36:10 +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.322-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.14.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Greg Kroah-Hartman <[email protected]>
Linux 4.14.322-rc1
[...]
Quoted 2 lines
Lyude Paul <[email protected]>
drm/edid: Fix uninitialized variable indrm_cvt_modes()
[...]
Two new warnings are introduced on x86_64 with GCC-8 (defconfig):
drivers/gpu/drm/drm_edid.o: warning: objtool:
drm_mode_std.isra.30()+0x98: return with modified stack frame
drivers/gpu/drm/drm_edid.o: warning: objtool:
drm_mode_std.isra.30()+0x0: stack state mismatch: cfa1=7+104 cfa2=7+8
Bisection points to the quoted commit ("drm/edid: Fix uninitialized variable in drm_cvt_modes()"), 991fcb77f490 upstream.
Greetings!
Daniel Díaz
[email protected]