hwmon: (f71882fg) Fix negative temperature
Subsystems (4)
Sasha Levin
maintainerPATCH 5/5 tcp: resalt the secret every 10 seconds
In reply to Sasha LevinFrom: Eric Dumazet <[email protected]>
[ Upstream commit 4dfa9b438ee34caca4e6a4e5e961641807367f6f ]
In order to limit the ability for an observer to recognize the source ports sequence used to contact a set of destinations, we should periodically shuffle the secret. 10 seconds looks effective enough without causing particular issues.
--- net/core/secure_seq.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
net/core/secure_seq.c +9 -3
@@ -22,6 +22,8 @@static siphash_key_t net_secret__read_mostly ;static siphash_key_t ts_secret__read_mostly ; +#define EPHEMERAL_PORT_SHUFFLE_PERIOD (10 * HZ) + static __always_inline void net_secret_init(void) {net_get_random_once (&net_secret,sizeof (net_secret));
@@ -100,11 +102,13 @@ u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,const struct {struct in6_addr saddr;struct in6_addr daddr; +unsigned int timeseed;__be16 dport; }__aligned(SIPHASH_ALIGNMENT) combined = { .saddr = *(struct in6_addr *)saddr, .daddr = *(struct in6_addr *)daddr, - .dport = dport + .timeseed = jiffies /EPHEMERAL_PORT_SHUFFLE_PERIOD , + .dport = dport, };net_secret_init (); return siphash(&combined, offsetofend(typeof(combined), dport),
@@ -144,8 +148,10 @@ u32 secure_tcp_seq(__be32 saddr, __be32 daddr,u32 secure_ipv4_port_ephemeral (__be32 saddr,__be32 daddr,__be16 dport) {net_secret_init (); -return siphash_3u32 ((__force u32 )saddr, (__force u32 )daddr, - (__force u16 )dport, &net_secret); +return siphash_4u32 ((__force u32 )saddr, (__force u32 )daddr, + (__force u16 )dport, + jiffies /EPHEMERAL_PORT_SHUFFLE_PERIOD , + &net_secret); }EXPORT_SYMBOL_GPL (secure_ipv4_port_ephemeral);#endif
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 1/5 hwmon: (f71882fg) Fix negative temperature
From: "Ji-Ze Hong (Peter Hong)" <[email protected]>
[ Upstream commit 4aaaaf0f279836f06d3b9d0ffeec7a1e1a04ceef ]
All temperature of Fintek superio hwmonitor that using 1-byte reg will use 2's complement.
In show_temp()
temp = data->temp[nr] * 1000;
When data->temp[nr] read as 255, it indicate -1C, but this code will report 255C to userspace. It'll be ok when change to:
temp = ((s8)data->temp[nr]) * 1000;
--- drivers/hwmon/f71882fg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hwmon/f71882fg.c +3 -2
@@ -1590,8 +1590,9 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr, temp *=125 ;if (sign) temp -=128000 ; - }else - temp = data->temp[nr] *1000 ; + }else { + temp = ((s8 )data->temp[nr]) *1000 ; + }return sprintf (buf,"%d\n" , temp); }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 4/5 ASoC: ops: Validate input values in snd_soc_put_volsw_range()
From: Mark Brown <[email protected]>
[ Upstream commit aa22125c57f9e577f0a667e4fa07fc3fa8ca1e60 ]
Check that values written via snd_soc_put_volsw_range() are within the range advertised by the control, ensuring that we don't write out of spec values to the hardware.
--- sound/soc/soc-ops.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
sound/soc/soc-ops.c +17 -1
@@ -528,7 +528,15 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,unsigned int mask = (1 <<fls (max)) -1 ;unsigned int invert = mc->invert;unsigned int val, val_mask; -int err, ret; +int err, ret, tmp; + + tmp = ucontrol->value.integer.value[0 ]; +if (tmp <0 ) +return -EINVAL ; +if (mc->platform_max && tmp > mc->platform_max) +return -EINVAL ; +if (tmp > mc->max - mc->min +1 ) +return -EINVAL ;if (invert) val = (max - ucontrol->value.integer.value[0 ]) & mask;
@@ -543,6 +551,14 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, ret = err;if (snd_soc_volsw_is_stereo (mc)) { + tmp = ucontrol->value.integer.value[1 ]; +if (tmp <0 ) +return -EINVAL ; +if (mc->platform_max && tmp > mc->platform_max) +return -EINVAL ; +if (tmp > mc->max - mc->min +1 ) +return -EINVAL ; +if (invert) val = (max - ucontrol->value.integer.value[1 ]) & mask;else
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 2/5 ASoC: max98090: Reject invalid values in custom control put()
In reply to Sasha LevinFrom: Mark Brown <[email protected]>
[ Upstream commit 2fbe467bcbfc760a08f08475eea6bbd4c2874319 ]
The max98090 driver has a custom put function for some controls which can only be updated in certain circumstances which makes no effort to validate that input is suitable for the control, allowing out of spec values to be written to the hardware and presented to userspace. Fix this by returning an error when invalid values are written.
--- sound/soc/codecs/max98090.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/codecs/max98090.c +3 -0
@@ -419,6 +419,9 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, val = (val >> mc->shift) & mask; +if (sel <0 || sel > mc->max) +return -EINVAL ; + *select = sel;/* Setting a volume is only valid if it is already On */
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 3/5 ASoC: max98090: Generate notifications on changes for custom control
In reply to Sasha LevinFrom: Mark Brown <[email protected]>
[ Upstream commit 13fcf676d9e102594effc686d98521ff5c90b925 ]
The max98090 driver has some custom controls which share a put() function which returns 0 unconditionally, meaning that events are not generated when the value changes. Fix that.
--- sound/soc/codecs/max98090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/max98090.c +1 -1
@@ -436,7 +436,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, mask << mc->shift, sel << mc->shift); -return 0 ; +return *select != val; } static const char *max98090_perf_pwr_text[] =
Signature · 1 line
2.35.1