4.17.4-stable review
Subsystems (17)
Greg Kroah-Hartman
maintainerPATCH 165/220 remoteproc: Prevent incorrect rproc state on xfer mem ownership failure
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sibi Sankar <[email protected]>
commit 2724807f7f70a6a3e67b3f6bf921cc77ed39c8a1 upstream.
Any failure in the secure call for transferring mem ownership of mba region to Q6 would result in reporting that the remoteproc device is running. This is because the previous q6v5_clk_enable would have been a success. Prevent this by updating variable 'ret' accordingly.
--- drivers/remoteproc/qcom_q6v5_pil.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/remoteproc/qcom_q6v5_pil.c +4 -6
@@ -761,13 +761,11 @@ static int q6v5_start(struct rproc *rpro }/* Assign MBA image access in DDR to q6 */ - xfermemop_ret =q6v5_xfer_mem_ownership (qproc, &qproc->mba_perm, true, - qproc->mba_phys, - qproc->mba_size); -if (xfermemop_ret) { + ret =q6v5_xfer_mem_ownership (qproc, &qproc->mba_perm, true, + qproc->mba_phys, qproc->mba_size); +if (ret) {dev_err (qproc->dev, -"assigning Q6 access to mba memory failed: %d\n" , - xfermemop_ret); +"assigning Q6 access to mba memory failed: %d\n" , ret); goto disable_active_clks; }
Greg Kroah-Hartman
maintainerPATCH 166/220 arm: dts: mt7623: fix invalid memory node being generated
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Wang <[email protected]>
commit c0b0d540db1a8bfb041166c4991dd6f624e8de45 upstream.
Below two wrong nodes in existing DTS files would cause a fail boot since in fact the address 0 is not the correct place the memory device locates at.
memory {
device_type = "memory";
reg = <0x0 0x0 0x0 0x0>;
};memory@80000000 {
reg = <0x0 0x80000000 0x0 0x40000000>;
};In order to avoid having a memory node starting at address 0, we can't include file skeleton64.dtsi and instead need to explicitly manually define a few of properties the DTS relies on such as #address-cells and #size-cells in root node and device_type in the node memory@80000000.
--- arch/arm/boot/dts/mt7623.dtsi | 3 ++- arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 1 + arch/arm/boot/dts/mt7623n-rfb.dtsi | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/boot/dts/mt7623.dtsi +2 -1
@@ -22,11 +22,12 @@ #include <dt-bindings/phy/phy.h> #include <dt-bindings/reset/mt2701-resets.h> #include <dt-bindings/thermal/thermal.h> -#include "skeleton64.dtsi" / { compatible = "mediatek,mt7623"; interrupt-parent = <&sysirq>; + #address-cells = <2>; + #size-cells = <2>; cpu_opp_table: opp-table { compatible = "operating-points-v2";
arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts +1 -0
@@ -109,6 +109,7 @@ }; memory@80000000 { + device_type = "memory"; reg = <0 0x80000000 0 0x40000000>; }; };
arch/arm/boot/dts/mt7623n-rfb.dtsi +1 -0
@@ -47,6 +47,7 @@ }; memory@80000000 { + device_type = "memory"; reg = <0 0x80000000 0 0x40000000>; };
Greg Kroah-Hartman
maintainerPATCH 167/220 perf tools: Fix symbol and object code resolution for vdso32 and vdsox32
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
commit aef4feace285f27c8ed35830a5d575bec7f3e90a upstream.
Fix __kmod_path__parse() so that perf tools does not treat vdso32 and vdsox32 as kernel modules and fail to find the object.
--- tools/perf/util/dso.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/util/dso.c +2 -0
@@ -354,6 +354,8 @@ int __kmod_path__parse(struct kmod_pathif ((strncmp (name,"[kernel.kallsyms]" ,17 ) ==0 ) || (strncmp (name,"[guest.kernel.kallsyms" ,22 ) ==0 ) || (strncmp (name,"[vdso]" ,6 ) ==0 ) || + (strncmp (name,"[vdso32]" ,8 ) ==0 ) || + (strncmp (name,"[vdsox32]" ,9 ) ==0 ) || (strncmp (name,"[vsyscall]" ,10 ) ==0 )) { m->kmod = false;
Greg Kroah-Hartman
maintainerPATCH 168/220 perf intel-pt: Fix sync_switch INTEL_PT_SS_NOT_TRACING
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
commit dbcb82b93f3e8322891e47472c89e63058b81e99 upstream.
sync_switch is a facility to synchronize decoding more closely with the point in the kernel when the context actually switched.
In one case, INTEL_PT_SS_NOT_TRACING state was not correctly transitioning to INTEL_PT_SS_TRACING state due to a missing case clause. Add it.
--- tools/perf/util/intel-pt.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/intel-pt.c +1 -0
@@ -1523,6 +1523,7 @@ static int intel_pt_sample(struct intel_if (intel_pt_is_switch_ip (ptq, state->to_ip)) {switch (ptq->switch_state) { +case INTEL_PT_SS_NOT_TRACING :case INTEL_PT_SS_UNKNOWN :case INTEL_PT_SS_EXPECTING_SWITCH_IP : err =intel_pt_next_tid (pt, ptq);
Greg Kroah-Hartman
maintainerPATCH 169/220 perf intel-pt: Fix decoding to accept CBR between FUP and corresponding TIP
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
commit bd2e49ec48feb1855f7624198849eea4610e2286 upstream.
It is possible to have a CBR packet between a FUP packet and corresponding TIP packet. Stop treating it as an error.
--- tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +4 -1
@@ -1604,7 +1604,6 @@ static int intel_pt_walk_fup_tip(structcase INTEL_PT_PSB :case INTEL_PT_TSC :case INTEL_PT_TMA : -case INTEL_PT_CBR :case INTEL_PT_MODE_TSX :case INTEL_PT_BAD :case INTEL_PT_PSBEND :
@@ -1620,6 +1619,10 @@ static int intel_pt_walk_fup_tip(struct decoder->pkt_step =0 ;return -ENOENT ; +case INTEL_PT_CBR : +intel_pt_calc_cbr (decoder); +break ; +case INTEL_PT_OVF :return intel_pt_overflow (decoder);
Greg Kroah-Hartman
maintainerPATCH 170/220 perf intel-pt: Fix MTC timing after overflow
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
commit dd27b87ab5fcf3ea1c060b5e3ab5d31cc78e9f4c upstream.
On some platforms, overflows will clear before MTC wraparound, and there is no following TSC/TMA packet. In that case the previous TMA is valid. Since there will be a valid TMA either way, stop setting 'have_tma' to false upon overflow.
--- tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 1 - 1 file changed, 1 deletion(-)
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +0 -1
@@ -1376,7 +1376,6 @@ static int intel_pt_overflow(struct inte {intel_pt_log ("ERROR: Buffer overflow\n" );intel_pt_clear_tx_flags (decoder); - decoder->have_tma = false; decoder->cbr =0 ; decoder->timestamp_insn_cnt =0 ; decoder->pkt_state =INTEL_PT_STATE_ERR_RESYNC ;
Greg Kroah-Hartman
maintainerPATCH 171/220 perf intel-pt: Fix "Unexpected indirect branch" error
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
commit 9fb523363f6e3984457fee95bb7019395384ffa7 upstream.
Some Atom CPUs can produce FUP packets that contain NLIP (next linear instruction pointer) instead of CLIP (current linear instruction pointer). That will result in "Unexpected indirect branch" errors. Fix by comparing IP to NLIP in that case.
--- tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 17 +++++++++++++++-- tools/perf/util/intel-pt-decoder/intel-pt-decoder.h | 9 +++++++++ tools/perf/util/intel-pt.c | 4 ++++ 3 files changed, 28 insertions(+), 2 deletions(-)
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +15 -2
@@ -113,6 +113,7 @@ struct intel_pt_decoder {bool have_cyc;bool fixup_last_mtc;bool have_last_ip; +enum intel_pt_param_flags flags;uint64_t pos;uint64_t last_ip;uint64_t ip;
@@ -226,6 +227,8 @@ struct intel_pt_decoder *intel_pt_decode decoder->return_compression = params->return_compression; decoder->branch_enable = params->branch_enable; + decoder->flags = params->flags; + decoder->period = params->period; decoder->period_type = params->period_type;
@@ -1097,6 +1100,15 @@ static bool intel_pt_fup_event(struct inreturn ret; } +static inline bool intel_pt_fup_with_nlip (struct intel_pt_decoder *decoder, +struct intel_pt_insn *intel_pt_insn, +uint64_t ip,int err) +{ +return decoder->flags &INTEL_PT_FUP_WITH_NLIP && !err && + intel_pt_insn->branch ==INTEL_PT_BR_INDIRECT && + ip == decoder->ip + intel_pt_insn->length; +} +static int intel_pt_walk_fup (struct intel_pt_decoder *decoder) {struct intel_pt_insn intel_pt_insn;
@@ -1109,10 +1121,11 @@ static int intel_pt_walk_fup(struct inte err =intel_pt_walk_insn (decoder, &intel_pt_insn, ip);if (err ==INTEL_PT_RETURN )return 0 ; -if (err == -EAGAIN ) { +if (err == -EAGAIN || +intel_pt_fup_with_nlip (decoder, &intel_pt_insn, ip, err)) {if (intel_pt_fup_event (decoder))return 0 ; -return err; +return -EAGAIN ; } decoder->set_fup_tx_flags = false;if (err)
tools/perf/util/intel-pt-decoder/intel-pt-decoder.h +9 -0
@@ -60,6 +60,14 @@ enum { INTEL_PT_ERR_MAX, }; +enum intel_pt_param_flags { +/* +* FUP packet can contain next linear instruction pointer instead of +* current linear instruction pointer. +*/ +INTEL_PT_FUP_WITH_NLIP =1 <<0 , +}; +struct intel_pt_state {enum intel_pt_sample_type type;int err;
@@ -106,6 +114,7 @@ struct intel_pt_params {unsigned int mtc_period;uint32_t tsc_ctc_ratio_n;uint32_t tsc_ctc_ratio_d; +enum intel_pt_param_flags flags; };struct intel_pt_decoder ;
tools/perf/util/intel-pt.c +4 -0
@@ -751,6 +751,7 @@ static struct intel_pt_queue *intel_pt_a unsigned int queue_nr) {struct intel_pt_params params = { .get_trace =0 , }; +struct perf_env *env = pt->machine->env;struct intel_pt_queue *ptq; ptq =zalloc (sizeof (struct intel_pt_queue ));
@@ -832,6 +833,9 @@ static struct intel_pt_queue *intel_pt_a } } +if (env->cpuid && !strncmp (env->cpuid,"GenuineIntel,6,92," ,18 )) + params.flags |=INTEL_PT_FUP_WITH_NLIP ; + ptq->decoder =intel_pt_decoder_new (¶ms);if (!ptq->decoder) goto out_free;
Greg Kroah-Hartman
maintainerPATCH 172/220 perf intel-pt: Fix packet decoding of CYC packets
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
commit 621a5a327c1e36ffd7bb567f44a559f64f76358f upstream.
Use a 64-bit type so that the cycle count is not limited to 32-bits.
--- tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +1 -1
@@ -366,7 +366,7 @@ static int intel_pt_get_cyc(unsigned intif (len < offs)return INTEL_PT_NEED_MORE_BYTES ; byte = buf[offs++]; - payload |= (byte >>1 ) << shift; + payload |= ((uint64_t )byte >>1 ) << shift; } packet->type =INTEL_PT_CYC ;
Greg Kroah-Hartman
maintainerPATCH 173/220 media: vsp1: Release buffers for each video node
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kieran Bingham <[email protected]>
commit 83967993f2320575c0ab27a80bf1d7535909c2f4 upstream.
Commit 372b2b0399fc ("media: v4l: vsp1: Release buffers in start_streaming error path") introduced a helper to clean up buffers on error paths, but inadvertently changed the code such that only the output WPF buffers were cleaned, rather than the video node being operated on.
Since then vsp1_video_cleanup_pipeline() has grown to perform both video node cleanup, as well as pipeline cleanup. Split the implementation into two distinct functions that perform the required work, so that each video node can release its buffers correctly on streamoff. The pipe cleanup that was performed in the vsp1_video_stop_streaming() (releasing the pipe->dl) is moved to the function for clarity.
--- drivers/media/platform/vsp1/vsp1_video.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/media/platform/vsp1/vsp1_video.c +13 -8
@@ -849,9 +849,8 @@ static int vsp1_video_setup_pipeline(strreturn 0 ; } -static void vsp1_video_cleanup_pipeline (struct vsp1_pipeline *pipe) +static void vsp1_video_release_buffers (struct vsp1_video *video) { -struct vsp1_video *video = pipe->output->video;struct vsp1_vb2_buffer *buffer;unsigned long flags;
@@ -861,12 +860,18 @@ static void vsp1_video_cleanup_pipeline(vb2_buffer_done (&buffer->buf.vb2_buf,VB2_BUF_STATE_ERROR );INIT_LIST_HEAD (&video->irqqueue);spin_unlock_irqrestore (&video->irqlock, flags); +} + +static void vsp1_video_cleanup_pipeline (struct vsp1_pipeline *pipe) +{ +lockdep_assert_held (&pipe->lock);/* Release our partition table allocation */ -mutex_lock (&pipe->lock);kfree (pipe->part_table); pipe->part_table =NULL ; -mutex_unlock (&pipe->lock); + +vsp1_dl_list_put (pipe->dl); + pipe->dl =NULL ; }static int vsp1_video_start_streaming (struct vb2_queue *vq,unsigned int count)
@@ -881,8 +886,9 @@ static int vsp1_video_start_streaming(stif (pipe->stream_count == pipe->num_inputs) { ret =vsp1_video_setup_pipeline (pipe);if (ret <0 ) { -mutex_unlock (&pipe->lock); +vsp1_video_release_buffers (video);vsp1_video_cleanup_pipeline (pipe); +mutex_unlock (&pipe->lock);return ret; }
@@ -932,13 +938,12 @@ static void vsp1_video_stop_streaming(stif (ret == -ETIMEDOUT )dev_err (video->vsp1->dev,"pipeline stop timeout\n" ); -vsp1_dl_list_put (pipe->dl); - pipe->dl =NULL ; +vsp1_video_cleanup_pipeline (pipe); }mutex_unlock (&pipe->lock);media_pipeline_stop (&video->video.entity); -vsp1_video_cleanup_pipeline (pipe); +vsp1_video_release_buffers (video);vsp1_video_pipeline_put (pipe); }
Greg Kroah-Hartman
maintainerPATCH 174/220 media: uvcvideo: Support realteks UVC 1.5 device
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: ming_qian <[email protected]>
commit f620d1d7afc7db57ab59f35000752840c91f67e7 upstream.
media: uvcvideo: Support UVC 1.5 video probe & commit controls
The length of UVC 1.5 video control is 48, and it is 34 for UVC 1.1. Change it to 48 for UVC 1.5 device, and the UVC 1.5 device can be recognized.
More changes to the driver are needed for full UVC 1.5 compatibility. However, at least the UVC 1.5 Realtek RTS5847/RTS5852 cameras have been reported to work well.
[[email protected]: Factor out code to helper function, update size checks]
--- drivers/media/usb/uvc/uvc_video.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
drivers/media/usb/uvc/uvc_video.c +18 -6
@@ -163,14 +163,27 @@ static void uvc_fixup_video_ctrl(struct } } +static size_t uvc_video_ctrl_size (struct uvc_streaming *stream) +{ +/* +* Return the size of the video probe and commit controls, which depends +* on the protocol version. +*/ +if (stream->dev->uvc_version <0x0110 ) +return 26 ; +else if (stream->dev->uvc_version <0x0150 ) +return 34 ; +else +return 48 ; +} +static int uvc_get_video_ctrl (struct uvc_streaming *stream,struct uvc_streaming_control *ctrl,int probe,u8 query) { +u16 size =uvc_video_ctrl_size (stream);u8 *data; -u16 size;int ret; - size = stream->dev->uvc_version >=0x0110 ?34 :26 ;if ((stream->dev->quirks &UVC_QUIRK_PROBE_DEF ) && query ==UVC_GET_DEF )return -EIO ;
@@ -225,7 +238,7 @@ static int uvc_get_video_ctrl(struct uvc ctrl->dwMaxVideoFrameSize =get_unaligned_le32 (&data[18 ]); ctrl->dwMaxPayloadTransferSize =get_unaligned_le32 (&data[22 ]); -if (size ==34 ) { +if (size >=34 ) { ctrl->dwClockFrequency =get_unaligned_le32 (&data[26 ]); ctrl->bmFramingInfo = data[30 ]; ctrl->bPreferedVersion = data[31 ];
@@ -254,11 +267,10 @@ out:static int uvc_set_video_ctrl (struct uvc_streaming *stream,struct uvc_streaming_control *ctrl,int probe) { +u16 size =uvc_video_ctrl_size (stream);u8 *data; -u16 size;int ret; - size = stream->dev->uvc_version >=0x0110 ?34 :26 ; data =kzalloc (size,GFP_KERNEL );if (data ==NULL )return -ENOMEM ;
@@ -275,7 +287,7 @@ static int uvc_set_video_ctrl(struct uvcput_unaligned_le32 (ctrl->dwMaxVideoFrameSize, &data[18 ]);put_unaligned_le32 (ctrl->dwMaxPayloadTransferSize, &data[22 ]); -if (size ==34 ) { +if (size >=34 ) {put_unaligned_le32 (ctrl->dwClockFrequency, &data[26 ]); data[30 ] = ctrl->bmFramingInfo; data[31 ] = ctrl->bPreferedVersion;
Greg Kroah-Hartman
maintainerPATCH 175/220 media: cx231xx: Ignore an i2c mux adapter
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brad Love <[email protected]>
commit 13a257f8d5a530bd2aa004a067ba1f2b8f5ef76d upstream.
Hauppauge 935C cannot communicate with the si2157 when using the mux adapter returned by the si2168, so disable it to fix the device.
--- drivers/media/usb/cx231xx/cx231xx-dvb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/cx231xx/cx231xx-dvb.c +1 -1
@@ -1151,7 +1151,7 @@ static int dvb_init(struct cx231xx *dev) info.platform_data = &si2157_config;request_module ("si2157" ); - client =i2c_new_device (adapter, &info); + client =i2c_new_device (tuner_i2c, &info);if (client ==NULL || client->dev.driver ==NULL ) {module_put (dvb->i2c_client_demod[0 ]->dev.driver->owner);i2c_unregister_device (dvb->i2c_client_demod[0 ]);
Greg Kroah-Hartman
maintainerPATCH 176/220 media: v4l2-compat-ioctl32: prevent go past max size
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mauro Carvalho Chehab <[email protected]>
commit ea72fbf588ac9c017224dcdaa2019ff52ca56fee upstream.
As warned by smatch:
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:879 put_v4l2_ext_controls32() warn: check for integer overflow 'count'
The access_ok() logic should check for too big arrays too.
--- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/v4l2-core/v4l2-compat-ioctl32.c +1 -1
@@ -871,7 +871,7 @@ static int put_v4l2_ext_controls32(struc get_user(kcontrols, &kp->controls))return -EFAULT ; -if (!count) +if (!count || count > (U32_MAX /sizeof (*ucontrols)))return 0 ;if (get_user (p, &up->controls))return -EFAULT ;
Greg Kroah-Hartman
maintainerPATCH 177/220 media: cx231xx: Add support for AverMedia DVD EZMaker 7
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kai-Heng Feng <[email protected]>
commit 29e61d6ef061b012d320327af7dbb3990e75be45 upstream.
User reports AverMedia DVD EZMaker 7 can be driven by VIDEO_GRABBER. Add the device to the id_table to make it work.
--- drivers/media/usb/cx231xx/cx231xx-cards.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/usb/cx231xx/cx231xx-cards.c +3 -0
@@ -1024,6 +1024,9 @@ struct usb_device_id cx231xx_id_table[] .driver_info = CX231XX_BOARD_CNXT_RDE_250}, {USB_DEVICE(0x0572, 0x58A0), .driver_info = CX231XX_BOARD_CNXT_RDU_250}, + /* AverMedia DVD EZMaker 7 */ + {USB_DEVICE(0x07ca, 0xc039), + .driver_info = CX231XX_BOARD_CNXT_VIDEO_GRABBER}, {USB_DEVICE(0x2040, 0xb110), .driver_info = CX231XX_BOARD_HAUPPAUGE_USB2_FM_PAL}, {USB_DEVICE(0x2040, 0xb111),
Greg Kroah-Hartman
maintainerPATCH 178/220 media: rc: mce_kbd decoder: fix stuck keys
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Young <[email protected]>
commit 63039c29f7a4ce8a8bd165173840543c0098d7b0 upstream.
The MCE Remote sends a 0 scancode when keys are released. If this is not received or decoded, then keys can get "stuck"; the keyup event is not sent since the input_sync() is missing from the timeout handler.
--- drivers/media/rc/ir-mce_kbd-decoder.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/rc/ir-mce_kbd-decoder.c +2 -0
@@ -130,6 +130,8 @@ static void mce_kbd_rx_timeout(struct tifor (i =0 ; i <MCIR2_MASK_KEYS_START ; i++)input_report_key (raw->mce_kbd.idev, kbd_keycodes[i],0 ); + +input_sync (raw->mce_kbd.idev); }static enum mce_kbd_mode mce_kbd_mode (struct mce_kbd_dec *data)
Greg Kroah-Hartman
maintainerPATCH 179/220 media: dvb_frontend: fix locking issues at dvb_frontend_get_event()
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mauro Carvalho Chehab <[email protected]>
commit 76d81243a487c09619822ef8e7201a756e58a87d upstream.
As warned by smatch:
drivers/media/dvb-core/dvb_frontend.c:314 dvb_frontend_get_event() warn: inconsistent returns 'sem:&fepriv->sem'. Locked on: line 288 line 295 line 306 line 314 Unlocked on: line 303
The lock implementation for get event is wrong, as, if an interrupt occurs, down_interruptible() will fail, and the routine will call up() twice when userspace calls the ioctl again.
The bad code is there since when Linux migrated to git, in 2005.
--- drivers/media/dvb-core/dvb_frontend.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/media/dvb-core/dvb_frontend.c +15 -8
@@ -275,8 +275,20 @@ static void dvb_frontend_add_event(strucwake_up_interruptible (&events->wait_queue); } +static int dvb_frontend_test_event (struct dvb_frontend_private *fepriv, +struct dvb_fe_events *events) +{ +int ret; + +up (&fepriv->sem); + ret = events->eventw != events->eventr; +down (&fepriv->sem); + +return ret; +} +static int dvb_frontend_get_event (struct dvb_frontend *fe, -struct dvb_frontend_event *event,int flags) +struct dvb_frontend_event *event,int flags) {struct dvb_frontend_private *fepriv = fe->frontend_priv;struct dvb_fe_events *events = &fepriv->events;
@@ -294,13 +306,8 @@ static int dvb_frontend_get_event(structif (flags &O_NONBLOCK )return -EWOULDBLOCK ; -up (&fepriv->sem); - - ret =wait_event_interruptible (events->wait_queue, - events->eventw != events->eventr); - -if (down_interruptible (&fepriv->sem)) -return -ERESTARTSYS ; + ret =wait_event_interruptible (events->wait_queue, +dvb_frontend_test_event (fepriv, events));if (ret <0 )return ret;
Greg Kroah-Hartman
maintainerPATCH 180/220 nfsd: restrict rd_maxcount to svc_max_payload in nfsd_encode_readdir
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Scott Mayhew <[email protected]>
commit 9c2ece6ef67e9d376f32823086169b489c422ed0 upstream.
nfsd4_readdir_rsize restricts rd_maxcount to svc_max_payload when estimating the size of the readdir reply, but nfsd_encode_readdir restricts it to INT_MAX when encoding the reply. This can result in log messages like "kernel: RPC request reserved 32896 but used 1049444".
Restrict rd_dircount similarly (no reason it should be larger than svc_max_payload).
--- fs/nfsd/nfs4xdr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/nfsd/nfs4xdr.c +3 -2
@@ -3651,7 +3651,8 @@ nfsd4_encode_readdir(struct nfsd4_compou nfserr = nfserr_resource; goto err_no_verf; } - maxcount =min_t (u32, readdir->rd_maxcount,INT_MAX ); + maxcount =svc_max_payload (resp->rqstp); + maxcount =min_t (u32, readdir->rd_maxcount, maxcount);/* * Note the rfc defines rd_maxcount as the size of the * READDIR4resok structure, which includes the verifier above
@@ -3665,7 +3666,7 @@ nfsd4_encode_readdir(struct nfsd4_compou/* RFC 3530 14.2.24 allows us to ignore dircount when it's 0: */ if (!readdir->rd_dircount) - readdir->rd_dircount =INT_MAX ; + readdir->rd_dircount =svc_max_payload (resp->rqstp); readdir->xdr = xdr; readdir->rd_maxcount = maxcount;
Greg Kroah-Hartman
maintainerPATCH 181/220 NFSv4: Fix possible 1-byte stack overflow in nfs_idmap_read_and_verify_message
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Wysochanski <[email protected]>
commit d68894800ec5712d7ddf042356f11e36f87d7f78 upstream.
In nfs_idmap_read_and_verify_message there is an incorrect sprintf '%d' that converts the __u32 'im_id' from struct idmap_msg to 'id_str', which is a stack char array variable of length NFS_UINT_MAXLEN == 11. If a uid or gid value is > 2147483647 = 0x7fffffff, the conversion overflows into a negative value, for example:
crash> p (unsigned) (0x80000000)
$1 = 2147483648
crash> p (signed) (0x80000000)
$2 = -2147483648
The '-' sign is written to the buffer and this causes a 1 byte overflow when the NULL byte is written, which corrupts kernel stack memory. If CONFIG_CC_STACKPROTECTOR_STRONG is set we see a stack-protector panic:
[11558053.616565] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: ffffffffa05b8a8c [11558053.639063] CPU: 6 PID: 9423 Comm: rpc.idmapd Tainted: G W ------------ T 3.10.0-514.el7.x86_64 #1 [11558053.641990] Hardware name: Red Hat OpenStack Compute, BIOS 1.10.2-3.el7_4.1 04/01/2014 [11558053.644462] ffffffff818c7bc0 00000000b1f3aec1 ffff880de0f9bd48 ffffffff81685eac [11558053.646430] ffff880de0f9bdc8 ffffffff8167f2b3 ffffffff00000010 ffff880de0f9bdd8 [11558053.648313] ffff880de0f9bd78 00000000b1f3aec1 ffffffff811dcb03 ffffffffa05b8a8c [11558053.650107] Call Trace: [11558053.651347] [<ffffffff81685eac>] dump_stack+0x19/0x1b [11558053.653013] [<ffffffff8167f2b3>] panic+0xe3/0x1f2 [11558053.666240] [<ffffffff811dcb03>] ? kfree+0x103/0x140 [11558053.682589] [<ffffffffa05b8a8c>] ? idmap_pipe_downcall+0x1cc/0x1e0 [nfsv4] [11558053.689710] [<ffffffff810855db>] __stack_chk_fail+0x1b/0x30 [11558053.691619] [<ffffffffa05b8a8c>] idmap_pipe_downcall+0x1cc/0x1e0 [nfsv4] [11558053.693867] [<ffffffffa00209d6>] rpc_pipe_write+0x56/0x70 [sunrpc] [11558053.695763] [<ffffffff811fe12d>] vfs_write+0xbd/0x1e0 [11558053.702236] [<ffffffff810acccc>] ? task_work_run+0xac/0xe0 [11558053.704215] [<ffffffff811fec4f>] SyS_write+0x7f/0xe0 [11558053.709674] [<ffffffff816964c9>] system_call_fastpath+0x16/0x1b
Fix this by calling the internally defined nfs_map_numeric_to_string() function which properly uses '%u' to convert this __u32. For consistency, also replace the one other place where snprintf is called.
--- fs/nfs/nfs4idmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/nfs/nfs4idmap.c +3 -2
@@ -343,7 +343,7 @@ static ssize_t nfs_idmap_lookup_name(__uint id_len;ssize_t ret; - id_len =snprintf (id_str,sizeof (id_str),"%u" , id); + id_len =nfs_map_numeric_to_string (id, id_str,sizeof (id_str)); ret =nfs_idmap_get_key (id_str, id_len, type, buf, buflen, idmap);if (ret <0 )return -EINVAL ;
@@ -627,7 +627,8 @@ static int nfs_idmap_read_and_verify_mesif (strcmp (upcall->im_name, im->im_name) !=0 )break ;/* Note: here we store the NUL terminator too */ - len =sprintf (id_str,"%d" , im->im_id) +1 ; + len =1 +nfs_map_numeric_to_string (im->im_id, id_str, +sizeof (id_str)); ret =nfs_idmap_instantiate (key, authkey, id_str, len);break ;case IDMAP_CONV_IDTONAME :
Greg Kroah-Hartman
maintainerPATCH 182/220 NFSv4: Revert commit 5f83d86cf531d ("NFSv4.x: Fix wraparound issues..")
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit fc40724fc6731d90cc7fb6d62d66135f85a33dd2 upstream.
The correct behaviour for NFSv4 sequence IDs is to wrap around to the value 0 after 0xffffffff.
See https://tools.ietf.org/html/rfc5661#section-2.10.6.1
--- fs/nfs/callback_proc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
fs/nfs/callback_proc.c +2 -5
@@ -420,11 +420,8 @@ validate_seqid(const struct nfs4_slot_tareturn htonl (NFS4ERR_SEQ_FALSE_RETRY ); } -/* Wraparound */ -if (unlikely (slot->seq_nr ==0xFFFFFFFFU )) { -if (args->csa_sequenceid ==1 ) -return htonl (NFS4_OK ); - }else if (likely (args->csa_sequenceid == slot->seq_nr +1 )) +/* Note: wraparound relies on seq_nr being of type u32 */ +if (likely (args->csa_sequenceid == slot->seq_nr +1 ))return htonl (NFS4_OK );/* Misordered request */
Greg Kroah-Hartman
maintainerPATCH 183/220 NFSv4: Fix a typo in nfs41_sequence_process
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 995891006ccbb73c0c9c3923cf9d25c4d07ec16b upstream.
We want to compare the slot_id to the highest slot number advertised by the server.
--- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs4proc.c +1 -1
@@ -751,7 +751,7 @@ static int nfs41_sequence_process(struct* The slot id we used was probably retired. Try again * using a different slot id. */ -if (slot->seq_nr < slot->table->target_highest_slotid) +if (slot->slot_nr < slot->table->target_highest_slotid) goto session_recover; goto retry_nowait;case -NFS4ERR_SEQ_MISORDERED :
Greg Kroah-Hartman
maintainerPATCH 184/220 video: uvesafb: Fix integer overflow in allocation
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
commit 9f645bcc566a1e9f921bdae7528a01ced5bc3713 upstream.
cmap->len can get close to INT_MAX/2, allowing for an integer overflow in allocation. This uses kmalloc_array() instead to catch the condition.
--- drivers/video/fbdev/uvesafb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/fbdev/uvesafb.c +2 -1
@@ -1044,7 +1044,8 @@ static int uvesafb_setcmap(struct fb_cma info->cmap.len || cmap->start < info->cmap.start)return -EINVAL ; - entries =kmalloc (sizeof (*entries) * cmap->len,GFP_KERNEL ); + entries =kmalloc_array (cmap->len,sizeof (*entries), +GFP_KERNEL );if (!entries)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 185/220 ACPI / LPSS: Add missing prv_offset setting for byt/cht PWM devices
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit fdcb613d49321b5bf5d5a1bd0fba8e7c241dcc70 upstream.
The LPSS PWM device on on Bay Trail and Cherry Trail devices has a set of private registers at offset 0x800, the current lpss_device_desc for them already sets the LPSS_SAVE_CTX flag to have these saved/restored over device-suspend, but the current lpss_device_desc was not setting the prv_offset field, leading to the regular device registers getting saved/restored instead.
This is causing the PWM controller to no longer work, resulting in a black screen, after a suspend/resume on systems where the firmware clears the APB clock and reset bits at offset 0x804.
This commit fixes this by properly setting prv_offset to 0x800 for the PWM devices.
--- drivers/acpi/acpi_lpss.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/acpi_lpss.c +2 -0
@@ -230,11 +230,13 @@ static const struct lpss_device_desc lptstatic const struct lpss_device_desc byt_pwm_dev_desc = { .flags =LPSS_SAVE_CTX , + .prv_offset =0x800 , .setup = byt_pwm_setup, };static const struct lpss_device_desc bsw_pwm_dev_desc = { .flags =LPSS_SAVE_CTX |LPSS_NO_D3_DELAY , + .prv_offset =0x800 , .setup = bsw_pwm_setup, };
Greg Kroah-Hartman
maintainerPATCH 186/220 Input: silead - add MSSL0002 ACPI HID
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit fc573af632b44f355f8fa15ab505f5593368078d upstream.
The Silead touchscreen on the Chuwi Vi8 tablet uses MSSL0002 as ACPI HID, rather then the usual MSSL1680 id.
--- drivers/input/touchscreen/silead.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/touchscreen/silead.c +1 -0
@@ -603,6 +603,7 @@ static const struct acpi_device_id silea { "GSL3692", 0 }, { "MSSL1680", 0 }, { "MSSL0001", 0 }, + { "MSSL0002", 0 }, { } };MODULE_DEVICE_TABLE (acpi, silead_ts_acpi_match);
Greg Kroah-Hartman
maintainerPATCH 187/220 Input: elan_i2c - add ELAN0618 (Lenovo v330 15IKB) ACPI ID
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandr Savca <[email protected]>
commit 8938fc7b8fe9ccfa11751ead502a8d385b607967 upstream.
Add ELAN0618 to the list of supported touchpads; this ID is used in Lenovo v330 15IKB devices.
--- drivers/input/mouse/elan_i2c_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/elan_i2c_core.c +1 -0
@@ -1263,6 +1263,7 @@ static const struct acpi_device_id elan_ { "ELAN060C", 0 }, { "ELAN0611", 0 }, { "ELAN0612", 0 }, + { "ELAN0618", 0 }, { "ELAN1000", 0 }, { } };
Greg Kroah-Hartman
maintainerPATCH 188/220 pwm: lpss: platform: Save/restore the ctrl register over a suspend/resume
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 1d375b58c12f08d8570b30b865def4734517f04f upstream.
On some devices the contents of the ctrl register get lost over a suspend/resume and the PWM comes back up disabled after the resume.
This is seen on some Bay Trail devices with the PWM in ACPI enumerated mode, so it shows up as a platform device instead of a PCI device.
If we still think it is enabled and then try to change the duty-cycle after this, we end up with a "PWM_SW_UPDATE was not cleared" error and the PWM is stuck in that state from then on.
This commit adds suspend and resume pm callbacks to the pwm-lpss-platform code, which save/restore the ctrl register over a suspend/resume, fixing this.
Note that:
1) There is no need to do this over a runtime suspend, since we only runtime suspend when disabled and then we properly set the enable bit and reprogram the timings when we re-enable the PWM.
2) This may be happening on more systems then we realize, but has been covered up sofar by a bug in the acpi-lpss.c code which was save/restoring the regular device registers instead of the lpss private registers due to lpss_device_desc.prv_offset not being set. This is fixed by a later patch in this series.
--- drivers/pwm/pwm-lpss-platform.c | 5 +++++ drivers/pwm/pwm-lpss.c | 30 ++++++++++++++++++++++++++++++ drivers/pwm/pwm-lpss.h | 2 ++ 3 files changed, 37 insertions(+)
drivers/pwm/pwm-lpss-platform.c +5 -0
@@ -74,6 +74,10 @@ static int pwm_lpss_remove_platform(strureturn pwm_lpss_remove (lpwm); } +static SIMPLE_DEV_PM_OPS(pwm_lpss_platform_pm_ops, + pwm_lpss_suspend, + pwm_lpss_resume); +static const struct acpi_device_id pwm_lpss_acpi_match[] = { {"80860F09" , (unsigned long )&pwm_lpss_byt_info }, {"80862288" , (unsigned long )&pwm_lpss_bsw_info },
@@ -86,6 +90,7 @@ static struct platform_driver pwm_lpss_d .driver = { .name = "pwm-lpss", .acpi_match_table = pwm_lpss_acpi_match, + .pm = &pwm_lpss_platform_pm_ops, }, .probe = pwm_lpss_probe_platform, .remove = pwm_lpss_remove_platform,
drivers/pwm/pwm-lpss.c +30 -0
@@ -32,10 +32,13 @@/* Size of each PWM register space if multiple */ #define PWM_SIZE 0x400 +#define MAX_PWMS 4 +struct pwm_lpss_chip {struct pwm_chip chip;void __iomem *regs;const struct pwm_lpss_boardinfo *info; +u32 saved_ctrl[MAX_PWMS ]; };static inline struct pwm_lpss_chip *to_lpwm (struct pwm_chip *chip)
@@ -177,6 +180,9 @@ struct pwm_lpss_chip *pwm_lpss_probe(strunsigned long c;int ret; +if (WARN_ON (info->npwm >MAX_PWMS )) +return ERR_PTR (-ENODEV ); + lpwm =devm_kzalloc (dev,sizeof (*lpwm),GFP_KERNEL );if (!lpwm)return ERR_PTR (-ENOMEM );
@@ -212,6 +218,30 @@ int pwm_lpss_remove(struct pwm_lpss_chip }EXPORT_SYMBOL_GPL (pwm_lpss_remove); +int pwm_lpss_suspend (struct device *dev) +{ +struct pwm_lpss_chip *lpwm =dev_get_drvdata (dev); +int i; + +for (i =0 ; i < lpwm->info->npwm; i++) + lpwm->saved_ctrl[i] =readl (lpwm->regs + i *PWM_SIZE +PWM ); + +return 0 ; +} +EXPORT_SYMBOL_GPL (pwm_lpss_suspend); + +int pwm_lpss_resume (struct device *dev) +{ +struct pwm_lpss_chip *lpwm =dev_get_drvdata (dev); +int i; + +for (i =0 ; i < lpwm->info->npwm; i++) +writel (lpwm->saved_ctrl[i], lpwm->regs + i *PWM_SIZE +PWM ); + +return 0 ; +} +EXPORT_SYMBOL_GPL (pwm_lpss_resume); +MODULE_DESCRIPTION ("PWM driver for Intel LPSS" );MODULE_AUTHOR ("Mika Westerberg <[email protected]>" );MODULE_LICENSE ("GPL v2" );
drivers/pwm/pwm-lpss.h +2 -0
@@ -28,5 +28,7 @@ struct pwm_lpss_boardinfo {struct pwm_lpss_chip *pwm_lpss_probe (struct device *dev,struct resource *r,const struct pwm_lpss_boardinfo *info);int pwm_lpss_remove (struct pwm_lpss_chip *lpwm); +int pwm_lpss_suspend (struct device *dev); +int pwm_lpss_resume (struct device *dev);#endif /* __PWM_LPSS_H */
Greg Kroah-Hartman
maintainerPATCH 189/220 rbd: flush rbd_dev->watch_dwork after watch is unregistered
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dongsheng Yang <[email protected]>
commit 23edca864951250af845a11da86bb3ea63522ed2 upstream.
There is a problem if we are going to unmap a rbd device and the watch_dwork is going to queue delayed work for watch:
unmap Thread watch Thread timerdo_rbd_remove
cancel_tasks_sync(rbd_dev)
queue_delayed_work for watch
destroy_workqueue(rbd_dev->task_wq)
drain_workqueue(wq)
destroy other resources in wq
call_timer_fn
__queue_work()
Then the delayed work escape the cancel_tasks_sync() and destroy_workqueue() and we will get an user-after-free call trace:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI Modules linked in: CPU: 7 PID: 0 Comm: swapper/7 Tainted: G OE 4.17.0-rc6+ #13 Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 RIP: 0010:__queue_work+0x6a/0x3b0 RSP: 0018:ffff9427df1c3e90 EFLAGS: 00010086 RAX: ffff9427deca8400 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff9427deca8400 RSI: ffff9427df1c3e50 RDI: 0000000000000000 RBP: ffff942783e39e00 R08: ffff9427deca8400 R09: ffff9427df1c3f00 R10: 0000000000000004 R11: 0000000000000005 R12: ffff9427cfb85970 R13: 0000000000002000 R14: 000000000001eca0 R15: 0000000000000007 FS: 0000000000000000(0000) GS:ffff9427df1c0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000004c900a005 CR4: 00000000000206e0 Call Trace: <IRQ> ? __queue_work+0x3b0/0x3b0 call_timer_fn+0x2d/0x130 run_timer_softirq+0x16e/0x430 ? tick_sched_timer+0x37/0x70 __do_softirq+0xd2/0x280 irq_exit+0xd5/0xe0 smp_apic_timer_interrupt+0x6c/0x130 apic_timer_interrupt+0xf/0x20
[ Move rbd_dev->watch_dwork cancellation so that rbd_reregister_watch()
either bails out early because the watch is UNREGISTERED at that point or just gets cancelled. ]
--- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rbd.c +1 -1
@@ -3397,7 +3397,6 @@ static void cancel_tasks_sync(struct rbd {dout ("%s rbd_dev %p\n" , __func__, rbd_dev); -cancel_delayed_work_sync (&rbd_dev->watch_dwork);cancel_work_sync (&rbd_dev->acquired_lock_work);cancel_work_sync (&rbd_dev->released_lock_work);cancel_delayed_work_sync (&rbd_dev->lock_dwork);
@@ -3415,6 +3414,7 @@ static void rbd_unregister_watch(struct rbd_dev->watch_state =RBD_WATCH_STATE_UNREGISTERED ;mutex_unlock (&rbd_dev->watch_mutex); +cancel_delayed_work_sync (&rbd_dev->watch_dwork);ceph_osdc_flush_notifies (&rbd_dev->rbd_client->client->osdc); }
Greg Kroah-Hartman
maintainerPATCH 190/220 mm/ksm.c: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm()
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia He <[email protected]>
commit 1105a2fc022f3c7482e32faf516e8bc44095f778 upstream.
In our armv8a server(QDF2400), I noticed lots of WARN_ON caused by PAGE_SIZE unaligned for rmap_item->address under memory pressure tests(start 20 guests and run memhog in the host).
WARNING: CPU: 4 PID: 4641 at virt/kvm/arm/mmu.c:1826 kvm_age_hva_handler+0xc0/0xc8 CPU: 4 PID: 4641 Comm: memhog Tainted: G W 4.17.0-rc3+ #8 Call trace: kvm_age_hva_handler+0xc0/0xc8 handle_hva_to_gpa+0xa8/0xe0 kvm_age_hva+0x4c/0xe8 kvm_mmu_notifier_clear_flush_young+0x54/0x98 __mmu_notifier_clear_flush_young+0x6c/0xa0 page_referenced_one+0x154/0x1d8 rmap_walk_ksm+0x12c/0x1d0 rmap_walk+0x94/0xa0 page_referenced+0x194/0x1b0 shrink_page_list+0x674/0xc28 shrink_inactive_list+0x26c/0x5b8 shrink_node_memcg+0x35c/0x620 shrink_node+0x100/0x430 do_try_to_free_pages+0xe0/0x3a8 try_to_free_pages+0xe4/0x230 __alloc_pages_nodemask+0x564/0xdc0 alloc_pages_vma+0x90/0x228 do_anonymous_page+0xc8/0x4d0 __handle_mm_fault+0x4a0/0x508 handle_mm_fault+0xf8/0x1b0 do_page_fault+0x218/0x4b8 do_translation_fault+0x90/0xa0 do_mem_abort+0x68/0xf0 el0_da+0x24/0x28
In rmap_walk_ksm, the rmap_item->address might still have the STABLE_FLAG, then the start and end in handle_hva_to_gpa might not be PAGE_SIZE aligned. Thus it will cause exceptions in handle_hva_to_gpa on arm64.
This patch fixes it by ignoring (not removing) the low bits of address when doing rmap_walk_ksm.
IMO, it should be backported to stable tree. the storm of WARN_ONs is very easy for me to reproduce. More than that, I watched a panic (not reproducible) as follows:
page:ffff7fe003742d80 count:-4871 mapcount:-2126053375 mapping: (null) index:0x0
flags: 0x1fffc00000000000()
raw: 1fffc00000000000 0000000000000000 0000000000000000 ffffecf981470000
raw: dead000000000100 dead000000000200 ffff8017c001c000 0000000000000000
page dumped because: nonzero _refcount
CPU: 29 PID: 18323 Comm: qemu-kvm Tainted: G W 4.14.15-5.hxt.aarch64 #1
Hardware name: <snip for confidential issues>
Call trace:
dump_backtrace+0x0/0x22c
show_stack+0x24/0x2c
dump_stack+0x8c/0xb0
bad_page+0xf4/0x154
free_pages_check_bad+0x90/0x9c
free_pcppages_bulk+0x464/0x518
free_hot_cold_page+0x22c/0x300
__put_page+0x54/0x60
unmap_stage2_range+0x170/0x2b4
kvm_unmap_hva_handler+0x30/0x40
handle_hva_to_gpa+0xb0/0xec
kvm_unmap_hva_range+0x5c/0xd0I even injected a fault on purpose in kvm_unmap_hva_range by seting size=size-0x200, the call trace is similar as above. So I thought the panic is similarly caused by the root cause of WARN_ON.
Andrea said:
: It looks a straightforward safe fix, on x86 hva_to_gfn_memslot would : zap those bits and hide the misalignment caused by the low metadata : bits being erroneously left set in the address, but the arm code : notices when that's the last page in the memslot and the hva_end is : getting aligned and the size is below one page.
:
: I think the problem triggers in the addr += PAGE_SIZE of : unmap_stage2_ptes that never matches end because end is aligned but : addr is not.
:
: } while (pte++, addr += PAGE_SIZE, addr != end);
:
: x86 again only works on hva_start/hva_end after converting it to : gfn_start/end and that being in pfn units the bits are zapped before : they risk to cause trouble.
Jia He said:
: I've tested by myself in arm64 server (QDF2400,46 cpus,96G mem) Without : this patch, the WARN_ON is very easy for reproducing. After this patch, I : have run the same benchmarch for a whole day without any WARN_ONs
--- mm/ksm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
mm/ksm.c +10 -4
@@ -199,6 +199,8 @@ struct rmap_item {#define SEQNR_MASK 0x0ff/* low bits of unstable tree seqnr */ #define UNSTABLE_FLAG 0x100/* is a node of the unstable tree */ #define STABLE_FLAG 0x200/* is listed from the stable tree */ +#define KSM_FLAG_MASK (SEQNR_MASK|UNSTABLE_FLAG|STABLE_FLAG) +/* to mask all the flags */ /* The stable and unstable tree heads */ static struct rb_root one_stable_tree[1 ] = {RB_ROOT };
@@ -2570,10 +2572,15 @@ again:anon_vma_lock_read (anon_vma);anon_vma_interval_tree_foreach (vmac, &anon_vma->rb_root, 0, ULONG_MAX) { +unsigned long addr; +cond_resched (); vma = vmac->vma; -if (rmap_item->address < vma->vm_start || - rmap_item->address >= vma->vm_end) + +/* Ignore the stable/unstable/sqnr flags */ + addr = rmap_item->address & ~KSM_FLAG_MASK ; + +if (addr < vma->vm_start || addr >= vma->vm_end)continue ;/* * Initially we examine only the vma which covers this
@@ -2587,8 +2594,7 @@ again:if (rwc->invalid_vma && rwc->invalid_vma (vma, rwc->arg))continue ; -if (!rwc->rmap_one (page, vma, - rmap_item->address, rwc->arg)) { +if (!rwc->rmap_one (page, vma, addr, rwc->arg)) {anon_vma_unlock_read (anon_vma);return ; }
Greg Kroah-Hartman
maintainerPATCH 191/220 mm: fix devmem_is_allowed() for sub-page System RAM intersections
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit 2bdce74412c249ac01dfe36b6b0043ffd7a5361e upstream.
Hussam reports:
I was poking around and for no real reason, I did cat /dev/mem and
strings /dev/mem. Then I saw the following warning in dmesg. I saved it
and rebooted immediately.
memremap attempted on mixed range 0x000000000009c000 size: 0x1000
------------[ cut here ]------------
WARNING: CPU: 0 PID: 11810 at kernel/memremap.c:98 memremap+0x104/0x170
[..]
Call Trace:
xlate_dev_mem_ptr+0x25/0x40
read_mem+0x89/0x1a0
__vfs_read+0x36/0x170The memremap() implementation checks for attempts to remap System RAM with MEMREMAP_WB and instead redirects those mapping attempts to the linear map. However, that only works if the physical address range being remapped is page aligned. In low memory we have situations like the following:
00000000-00000fff : Reserved
00001000-0009fbff : System RAM
0009fc00-0009ffff : Reserved...where System RAM intersects Reserved ranges on a sub-page page granularity.
Given that devmem_is_allowed() special cases any attempt to map System RAM in the first 1MB of memory, replace page_is_ram() with the more precise region_intersects() to trap attempts to map disallowed ranges.
--- arch/x86/mm/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/mm/init.c +3 -1
@@ -706,7 +706,9 @@ void __init init_mem_mapping(void)*/ int devmem_is_allowed (unsigned long pagenr) { -if (page_is_ram (pagenr)) { +if (region_intersects (PFN_PHYS (pagenr),PAGE_SIZE , +IORESOURCE_SYSTEM_RAM ,IORES_DESC_NONE ) + !=REGION_DISJOINT ) {/* * For disallowed memory regions in the low 1MB range, * request that the page be shown as all zeros.
Greg Kroah-Hartman
maintainerPATCH 192/220 tracing: Check for no filter when processing event filters
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt (VMware) <[email protected]>
commit 70303420b5721c38998cf987e6b7d30cc62d4ff1 upstream.
The syzkaller detected a out-of-bounds issue with the events filter code, specifically here:
prog[N].pred = NULL; /* #13 */ prog[N].target = 1; /* TRUE */ prog[N+1].pred = NULL; prog[N+1].target = 0; /* FALSE */ -> prog[N-1].target = N; prog[N-1].when_to_branch = false;
As that's the first reference to a "N-1" index, it appears that the code got here with N = 0, which means the filter parser found no filter to parse (which shouldn't ever happen, but apparently it did).
Add a new error to the parsing code that will check to make sure that N is not zero before going into this part of the code. If N = 0, then -EINVAL is returned, and a error message is added to the filter.
bugzilla url: https://bugzilla.kernel.org/show_bug.cgi?id=200019
--- kernel/trace/trace_events_filter.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
kernel/trace/trace_events_filter.c +9 -1
@@ -78,7 +78,8 @@ static const char * ops[] = { OPS };C (TOO_MANY_PREDS ,"Too many terms in predicate expression" ), \C (INVALID_FILTER ,"Meaningless filter expression" ), \C (IP_FIELD_ONLY ,"Only 'ip' field is supported for function trace" ), \ -C (INVALID_VALUE ,"Invalid value (did you forget quotes)?" ), +C (INVALID_VALUE ,"Invalid value (did you forget quotes)?" ), \ +C (NO_FILTER ,"No filter found" ), #undef C #define C(a, b) FILT_ERR_##a
@@ -550,6 +551,13 @@ predicate_parse(const char *str, int nr_ goto out_free; } +if (!N ) { +/* No program? */ + ret = -EINVAL ; +parse_error (pe,FILT_ERR_NO_FILTER , ptr - str); + goto out_free; + } + prog[N ].pred =NULL ;/* #13 */ prog[N ].target =1 ;/* TRUE */ prog[N +1 ].pred =NULL ;
Greg Kroah-Hartman
maintainerPATCH 193/220 xen: Remove unnecessary BUG_ON from __unbind_from_irq()
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Ostrovsky <[email protected]>
commit eef04c7b3786ff0c9cb1019278b6c6c2ea0ad4ff upstream.
Commit 910f8befdf5b ("xen/pirq: fix error path cleanup when binding MSIs") fixed a couple of errors in error cleanup path of xen_bind_pirq_msi_to_irq(). This cleanup allowed a call to __unbind_from_irq() with an unbound irq, which would result in triggering the BUG_ON there.
Since there is really no reason for the BUG_ON (xen_free_irq() can operate on unbound irqs) we can remove it.
--- drivers/xen/events/events_base.c | 2 -- 1 file changed, 2 deletions(-)
drivers/xen/events/events_base.c +0 -2
@@ -628,8 +628,6 @@ static void __unbind_from_irq(unsigned ixen_irq_info_cleanup (info); } -BUG_ON (info_for_irq (irq)->type ==IRQT_UNBOUND ); -xen_free_irq (irq); }
Greg Kroah-Hartman
maintainerPATCH 194/220 net: ethernet: fix suspend/resume in davinci_emac
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
commit dc45519eb181b5687ac8382361a8aa085acd1fe1 upstream.
This patch reverts commit 3243ff2a05ec ("net: ethernet: davinci_emac:
Deduplicate bus_find_device() by name matching") and adds a comment which should stop anyone from reintroducing the same "fix" in the future.
We can't use bus_find_device_by_name() here because the device name is not guaranteed to be 'davinci_mdio'. On some systems it can be 'davinci_mdio.0' so we need to use strncmp() against the first part of the string to correctly match it.
--- drivers/net/ethernet/ti/davinci_emac.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/davinci_emac.c +13 -2
@@ -1385,6 +1385,11 @@ static int emac_devioctl(struct net_devireturn -EOPNOTSUPP ; } +static int match_first_device (struct device *dev,void *data) +{ +return !strncmp (dev_name (dev),"davinci_mdio" ,12 ); +} +/** * emac_dev_open - EMAC device open * @ndev: The DaVinci EMAC network adapter
@@ -1484,8 +1489,14 @@ static int emac_dev_open(struct net_devi/* use the first phy on the bus if pdata did not give us a phy id */ if (!phydev && !priv->phy_id) { - phy =bus_find_device_by_name (&mdio_bus_type,NULL , -"davinci_mdio" ); +/* NOTE: we can't use bus_find_device_by_name() here because +* the device name is not guaranteed to be 'davinci_mdio'. On +* some systems it can be 'davinci_mdio.0' so we need to use +* strncmp() against the first part of the string to correctly +* match it. +*/ + phy =bus_find_device (&mdio_bus_type,NULL ,NULL , + match_first_device);if (phy) { priv->phy_id =dev_name (phy);if (!priv->phy_id || !*priv->phy_id)
Greg Kroah-Hartman
maintainerPATCH 195/220 udf: Detect incorrect directory size
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit fa65653e575fbd958bdf5fb9c4a71a324e39510d upstream.
Detect when a directory entry is (possibly partially) beyond directory size and return EIO in that case since it means the filesystem is corrupted. Otherwise directory operations can further corrupt the directory and possibly also oops the kernel.
--- fs/udf/directory.c | 3 +++ 1 file changed, 3 insertions(+)
fs/udf/directory.c +3 -0
@@ -152,6 +152,9 @@ struct fileIdentDesc *udf_fileident_read sizeof(struct fileIdentDesc)); } } +/* Got last entry outside of dir size - fs is corrupted! */ +if (*nf_pos > dir->i_size) +return NULL ;return fi; }
Greg Kroah-Hartman
maintainerPATCH 196/220 Input: xpad - fix GPD Win 2 controller name
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Enno Boland <[email protected]>
commit dd6bee81c942c0ea01030da9356026afb88f9d18 upstream.
This fixes using the controller with SDL2.
SDL2 has a naive algorithm to apply the correct settings to a controller. For X-Box compatible controllers it expects that the controller name contains a variation of a 'XBOX'-string.
This patch changes the identifier to contain "X-Box" as substring. Tested with Steam and C-Dogs-SDL which both detect the controller properly after adding this patch.
--- drivers/input/joystick/xpad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joystick/xpad.c +1 -1
@@ -123,7 +123,7 @@ static const struct xpad_device {u8 mapping;u8 xtype; } xpad_device[] = { - { 0x0079, 0x18d4, "GPD Win 2 Controller", 0, XTYPE_XBOX360 }, + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 }, { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX }, { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX }, { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
Greg Kroah-Hartman
maintainerPATCH 197/220 Input: psmouse - fix button reporting for basic protocols
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <[email protected]>
commit 03ae3a9caf4a59edd32b65c89c375a98ce3ea1ef upstream.
The commit ba667650c568 ("Input: psmouse - clean up code") was pretty brain-dead and broke extra buttons reporting for variety of PS/2 mice:
Genius, Thinkmouse and Intellimouse Explorer. We need to actually inspect the data coming from the device when reporting events.
--- drivers/input/mouse/psmouse-base.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/input/mouse/psmouse-base.c +6 -6
@@ -192,8 +192,8 @@ psmouse_ret_t psmouse_process_byte(strucelse input_report_rel (dev,REL_WHEEL , -wheel); -input_report_key (dev,BTN_SIDE ,BIT (4 )); -input_report_key (dev,BTN_EXTRA ,BIT (5 )); +input_report_key (dev,BTN_SIDE , packet[3 ] &BIT (4 )); +input_report_key (dev,BTN_EXTRA , packet[3 ] &BIT (5 ));break ; }break ;
@@ -203,13 +203,13 @@ psmouse_ret_t psmouse_process_byte(strucinput_report_rel (dev,REL_WHEEL , -(s8 ) packet[3 ]);/* Extra buttons on Genius NewNet 3D */ -input_report_key (dev,BTN_SIDE ,BIT (6 )); -input_report_key (dev,BTN_EXTRA ,BIT (7 )); +input_report_key (dev,BTN_SIDE , packet[0 ] &BIT (6 )); +input_report_key (dev,BTN_EXTRA , packet[0 ] &BIT (7 ));break ;case PSMOUSE_THINKPS :/* Extra button on ThinkingMouse */ -input_report_key (dev,BTN_EXTRA ,BIT (3 )); +input_report_key (dev,BTN_EXTRA , packet[0 ] &BIT (3 ));/* * Without this bit of weirdness moving up gives wildly
@@ -223,7 +223,7 @@ psmouse_ret_t psmouse_process_byte(struc* Cortron PS2 Trackball reports SIDE button in the * 4th bit of the first byte. */ -input_report_key (dev,BTN_SIDE ,BIT (3 )); +input_report_key (dev,BTN_SIDE , packet[0 ] &BIT (3 )); packet[0 ] |=BIT (3 );break ;
Greg Kroah-Hartman
maintainerPATCH 198/220 Input: elan_i2c_smbus - fix more potential stack buffer overflows
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit 50fc7b61959af4b95fafce7fe5dd565199e0b61a upstream.
Commit 40f7090bb1b4 ("Input: elan_i2c_smbus - fix corrupted stack") fixed most of the functions using i2c_smbus_read_block_data() to allocate a buffer with the maximum block size. However three functions were left unchanged:
* In elan_smbus_initialize(), increase the buffer size in the same way.
* In elan_smbus_calibrate_result(), the buffer is provided by the caller (calibrate_store()), so introduce a bounce buffer. Also name the result buffer size.
* In elan_smbus_get_report(), the buffer is provided by the caller but happens to be the right length. Add a compile-time assertion to ensure this remains the case.
--- drivers/input/mouse/elan_i2c.h | 2 ++ drivers/input/mouse/elan_i2c_core.c | 2 +- drivers/input/mouse/elan_i2c_smbus.c | 10 ++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/input/mouse/elan_i2c.h +2 -0
@@ -27,6 +27,8 @@#define ETP_DISABLE_POWER 0x0001#define ETP_PRESSURE_OFFSET 25 +#define ETP_CALIBRATE_MAX_LEN 3 +/* IAP Firmware handling */ #define ETP_PRODUCT_ID_FORMAT_STRING "%d.0"#define ETP_FW_NAME "elan_i2c_" ETP_PRODUCT_ID_FORMAT_STRING ".bin"
drivers/input/mouse/elan_i2c_core.c +1 -1
@@ -610,7 +610,7 @@ static ssize_t calibrate_store(struct deint tries =20 ;int retval;int error; -u8 val[3 ]; +u8 val[ETP_CALIBRATE_MAX_LEN ]; retval =mutex_lock_interruptible (&data->sysfs_mutex);if (retval)
drivers/input/mouse/elan_i2c_smbus.c +8 -2
@@ -56,7 +56,7 @@static int elan_smbus_initialize (struct i2c_client *client) {u8 check[ETP_SMBUS_HELLOPACKET_LEN ] = {0x55 ,0x55 ,0x55 ,0x55 ,0x55 }; -u8 values[ETP_SMBUS_HELLOPACKET_LEN ] = {0 ,0 ,0 ,0 ,0 }; +u8 values[I2C_SMBUS_BLOCK_MAX ] = {0 };int len, error;/* Get hello packet */
@@ -117,12 +117,16 @@ static int elan_smbus_calibrate(struct istatic int elan_smbus_calibrate_result (struct i2c_client *client,u8 *val) {int error; +u8 buf[I2C_SMBUS_BLOCK_MAX ] = {0 }; + +BUILD_BUG_ON (ETP_CALIBRATE_MAX_LEN >sizeof (buf)); error =i2c_smbus_read_block_data (client, -ETP_SMBUS_CALIBRATE_QUERY , val); +ETP_SMBUS_CALIBRATE_QUERY , buf);if (error <0 )return error; +memcpy (val, buf,ETP_CALIBRATE_MAX_LEN );return 0 ; }
@@ -472,6 +476,8 @@ static int elan_smbus_get_report(struct {int len; +BUILD_BUG_ON (I2C_SMBUS_BLOCK_MAX >ETP_SMBUS_REPORT_LEN ); + len =i2c_smbus_read_block_data (client,ETP_SMBUS_PACKET_QUERY , &report[ETP_SMBUS_REPORT_OFFSET ]);
Greg Kroah-Hartman
maintainerPATCH 199/220 Input: elantech - enable middle button of touchpads on ThinkPad P52
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Ma <[email protected]>
commit 24bb555e6e46d96e2a954aa0295029a81cc9bbaa upstream.
PNPID is better way to identify the type of touchpads. Enable middle button support on 2 types of touchpads on Lenovo P52.
--- drivers/input/mouse/elantech.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/input/mouse/elantech.c +8 -1
@@ -1169,6 +1169,12 @@ static const struct dmi_system_id elante { } }; +static const char *const middle_button_pnp_ids[] = { +"LEN2131" ,/* ThinkPad P52 w/ NFC */ +"LEN2132" ,/* ThinkPad P52 */ +NULL +}; +/* * Set the appropriate event bits for the input subsystem */
@@ -1188,7 +1194,8 @@ static int elantech_set_input_params(str__clear_bit (EV_REL , dev->evbit);__set_bit (BTN_LEFT , dev->keybit); -if (dmi_check_system (elantech_dmi_has_middle_button)) +if (dmi_check_system (elantech_dmi_has_middle_button) || +psmouse_matches_pnp_id (psmouse, middle_button_pnp_ids))__set_bit (BTN_MIDDLE , dev->keybit);__set_bit (BTN_RIGHT , dev->keybit);
Greg Kroah-Hartman
maintainerPATCH 200/220 Input: elantech - fix V4 report decoding for module with middle key
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: ??? <[email protected]>
commit e0ae2519ca004a628fa55aeef969c37edce522d3 upstream.
Some touchpad has middle key and it will be indicated in bit 2 of packet[0]. We need to fix V4 formation's byte mask to prevent error decoding.
--- drivers/input/mouse/elantech.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/mouse/elantech.c +1 -1
@@ -796,7 +796,7 @@ static int elantech_packet_check_v4(struelse if (ic_version ==7 && etd->samples[1 ] ==0x2A ) sanity_check = ((packet[3 ] &0x1c ) ==0x10 );else - sanity_check = ((packet[0 ] &0x0c ) ==0x04 && + sanity_check = ((packet[0 ] &0x08 ) ==0x00 && (packet[3 ] &0x1c ) ==0x10 );if (!sanity_check)
Greg Kroah-Hartman
maintainerPATCH 201/220 ALSA: timer: Fix UBSAN warning at SNDRV_TIMER_IOCTL_NEXT_DEVICE ioctl
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit b41f794f284966fd6ec634111e3b40d241389f96 upstream.
The kernel may spew a WARNING about UBSAN undefined behavior at handling ALSA timer ioctl SNDRV_TIMER_IOCTL_NEXT_DEVICE:
UBSAN: Undefined behaviour in sound/core/timer.c:1524:19 signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x122/0x1c8 lib/dump_stack.c:113 ubsan_epilogue+0x12/0x86 lib/ubsan.c:159 handle_overflow+0x1c2/0x21f lib/ubsan.c:190 __ubsan_handle_add_overflow+0x2a/0x31 lib/ubsan.c:198 snd_timer_user_next_device sound/core/timer.c:1524 [inline] __snd_timer_user_ioctl+0x204d/0x2520 sound/core/timer.c:1939 snd_timer_user_ioctl+0x67/0x95 sound/core/timer.c:1994 ....
It happens only when a value with INT_MAX is passed, as we're incrementing it unconditionally. So the fix is trivial, check the value with INT_MAX. Although the bug itself is fairly harmless, it's better to fix it so that fuzzers won't hit this again later.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200213
--- sound/core/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/timer.c +1 -1
@@ -1517,7 +1517,7 @@ static int snd_timer_user_next_device(st }else {if (id.subdevice <0 ) id.subdevice =0 ; -else +else if (id.subdevice <INT_MAX ) id.subdevice++; } }
Greg Kroah-Hartman
maintainerPATCH 203/220 ALSA: hda/realtek - Fix pop noise on Lenovo P50 & co
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit d5a6cabf02210b896a60eee7c04c670ee9ba6dca upstream.
Some Lenovo laptops, e.g. Lenovo P50, showed the pop noise at resume or runtime resume. It turned out to be reduced by applying alc_no_shutup() just like TPT440 quirk does.
Since there are many Lenovo models showing the same behavior, put this workaround in ALC269_FIXUP_THINKPAD_ACPI entry so that it's applied commonly to all such Lenovo machines.
--- sound/pci/hda/patch_realtek.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
sound/pci/hda/patch_realtek.c +8 -2
@@ -4985,7 +4985,6 @@ static void alc_fixup_tpt440_dock(structstruct alc_spec *spec = codec->spec;if (action ==HDA_FIXUP_ACT_PRE_PROBE ) { - spec->shutup = alc_no_shutup;/* reduce click noise */ spec->reboot_notify = alc_d3_at_reboot;/* reduce noise */ spec->parse_flags =HDA_PINCFG_NO_HP_FIXUP ; codec->power_save_node =0 ;/* avoid click noises */
@@ -5384,6 +5383,13 @@ static void alc274_fixup_bind_dacs(struc/* for hda_fixup_thinkpad_acpi() */ #include "thinkpad_helper.c" +static void alc_fixup_thinkpad_acpi (struct hda_codec *codec, +const struct hda_fixup *fix,int action) +{ +alc_fixup_no_shutup (codec, fix, action);/* reduce click noise */ +hda_fixup_thinkpad_acpi (codec, fix, action); +} +/* for dell wmi mic mute led */ #include "dell_wmi_helper.c"
@@ -5927,7 +5933,7 @@ static const struct hda_fixup alc269_fix }, [ALC269_FIXUP_THINKPAD_ACPI] = { .type = HDA_FIXUP_FUNC, - .v.func = hda_fixup_thinkpad_acpi, + .v.func = alc_fixup_thinkpad_acpi, .chained = true, .chain_id = ALC269_FIXUP_SKU_IGNORE, },
Greg Kroah-Hartman
maintainerPATCH 204/220 ALSA: hda/realtek - Add a quirk for FSC ESPRIMO U9210
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 275ec0cb946cb75ac8977f662e608fce92f8b8a8 upstream.
Fujitsu Seimens ESPRIMO Mobile U9210 requires the same fixup as H270 for the correct pin configs.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200107
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -2542,6 +2542,7 @@ static const struct snd_pci_quirk alc262SND_PCI_QUIRK (0x10cf ,0x1397 ,"Fujitsu Lifebook S7110" ,ALC262_FIXUP_FSC_S7110 ),SND_PCI_QUIRK (0x10cf ,0x142d ,"Fujitsu Lifebook E8410" ,ALC262_FIXUP_BENQ ),SND_PCI_QUIRK (0x10f1 ,0x2915 ,"Tyan Thunder n6650W" ,ALC262_FIXUP_TYAN ), +SND_PCI_QUIRK (0x1734 ,0x1141 ,"FSC ESPRIMO U9210" ,ALC262_FIXUP_FSC_H270 ),SND_PCI_QUIRK (0x1734 ,0x1147 ,"FSC Celsius H270" ,ALC262_FIXUP_FSC_H270 ),SND_PCI_QUIRK (0x17aa ,0x384e ,"Lenovo 3000" ,ALC262_FIXUP_LENOVO_3000 ), SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
Greg Kroah-Hartman
maintainerPATCH 205/220 ALSA: hda/realtek - Fix the problem of two front mics on more machines
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Wang <[email protected]>
commit e41fc8c5bd41b96bfae5ce4c66bee6edabc932e8 upstream.
We have 3 more Lenovo machines, they all have 2 front mics on them, so they need the fixup to change the location for one of two mics.
Among these 3 Lenovo machines, one of them has the same pin cfg as the machine with subid 0x17aa3138, so use the pin cfg table to apply fixup for them. The rest machines don't share the same pin cfg, so far use the subid to apply fixup for them.
--- sound/pci/hda/patch_realtek.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +8 -1
@@ -6584,8 +6584,9 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x17aa ,0x30bb ,"ThinkCentre AIO" ,ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY ),SND_PCI_QUIRK (0x17aa ,0x30e2 ,"ThinkCentre AIO" ,ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY ),SND_PCI_QUIRK (0x17aa ,0x310c ,"ThinkCentre Station" ,ALC294_FIXUP_LENOVO_MIC_LOCATION ), +SND_PCI_QUIRK (0x17aa ,0x312a ,"ThinkCentre Station" ,ALC294_FIXUP_LENOVO_MIC_LOCATION ),SND_PCI_QUIRK (0x17aa ,0x312f ,"ThinkCentre Station" ,ALC294_FIXUP_LENOVO_MIC_LOCATION ), -SND_PCI_QUIRK (0x17aa ,0x3138 ,"ThinkCentre Station" ,ALC294_FIXUP_LENOVO_MIC_LOCATION ), +SND_PCI_QUIRK (0x17aa ,0x3136 ,"ThinkCentre Station" ,ALC294_FIXUP_LENOVO_MIC_LOCATION ),SND_PCI_QUIRK (0x17aa ,0x313c ,"ThinkCentre Station" ,ALC294_FIXUP_LENOVO_MIC_LOCATION ),SND_PCI_QUIRK (0x17aa ,0x3902 ,"Lenovo E50-80" ,ALC269_FIXUP_DMIC_THINKPAD_ACPI ), SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
@@ -6763,6 +6764,12 @@ static const struct snd_hda_pin_quirk al {0x14, 0x90170110}, {0x19, 0x02a11030}, {0x21, 0x02211020}), + SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, + {0x14, 0x90170110}, + {0x19, 0x02a11030}, + {0x1a, 0x02a11040}, + {0x1b, 0x01014020}, + {0x21, 0x0221101f}), SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, {0x12, 0x90a60140}, {0x14, 0x90170110},
Greg Kroah-Hartman
maintainerPATCH 206/220 Revert "i2c: algo-bit: init the bus to a known state"
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wolfram Sang <[email protected]>
commit 2a2c8ee2d72c4f1ba0f7fbb02dc74f971df0f934 upstream.
This reverts commit 3e5f06bed72fe72166a6778f630241a893f67799. As per bugzilla #200045, this caused a regression. I don't really see a way to fix it without having the hardware. So, revert the patch and I will fix the issue I was seeing originally in the i2c-gpio driver itself. I couldn't find new users of this algorithm since, so there should be no one depending on the new behaviour.
--- drivers/i2c/algos/i2c-algo-bit.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/i2c/algos/i2c-algo-bit.c +0 -5
@@ -649,11 +649,6 @@ static int __i2c_bit_add_bus(struct i2c_if (bit_adap->getscl ==NULL ) adap->quirks = &i2c_bit_quirk_no_clk_stretch; -/* Bring bus to a known state. Looks like STOP if bus is not free yet */ -setscl (bit_adap,1 ); -udelay (bit_adap->udelay); -setsda (bit_adap,1 ); - ret =add_adapter (adap);if (ret <0 )return ret;
Greg Kroah-Hartman
maintainerPATCH 207/220 i2c: gpio: initialize SCL to HIGH again
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wolfram Sang <[email protected]>
commit 12b731dd46d9ee646318e6e9dc587314a3908a46 upstream.
It seems that during the conversion from gpio* to gpiod*, the initial state of SCL was wrongly switched to LOW. Fix it to be HIGH again.
--- drivers/i2c/busses/i2c-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-gpio.c +2 -2
@@ -279,9 +279,9 @@ static int i2c_gpio_probe(struct platfor* required for an I2C bus. */ if (pdata->scl_is_open_drain) - gflags =GPIOD_OUT_LOW ; + gflags =GPIOD_OUT_HIGH ;else - gflags =GPIOD_OUT_LOW_OPEN_DRAIN ; + gflags =GPIOD_OUT_HIGH_OPEN_DRAIN ; priv->scl =i2c_gpio_get_desc (dev,"scl" ,1 , gflags);if (IS_ERR (priv->scl))return PTR_ERR (priv->scl);
Greg Kroah-Hartman
maintainerPATCH 208/220 slub: fix failure when we delete and create a slab cache
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit d50d82faa0c964e31f7a946ba8aba7c715ca7ab0 upstream.
In kernel 4.17 I removed some code from dm-bufio that did slab cache merging (commit 21bb13276768: "dm bufio: remove code that merges slab caches") - both slab and slub support merging caches with identical attributes, so dm-bufio now just calls kmem_cache_create and relies on implicit merging.
This uncovered a bug in the slub subsystem - if we delete a cache and immediatelly create another cache with the same attributes, it fails because of duplicate filename in /sys/kernel/slab/. The slub subsystem offloads freeing the cache to a workqueue - and if we create the new cache before the workqueue runs, it complains because of duplicate filename in sysfs.
This patch fixes the bug by moving the call of kobject_del from sysfs_slab_remove_workfn to shutdown_cache. kobject_del must be called while we hold slab_mutex - so that the sysfs entry is deleted before a cache with the same attributes could be created.
Running device-mapper-test-suite with:
dmtest run --suite thin-provisioning -n /commit_failure_causes_fallback/
triggered:
Buffer I/O error on dev dm-0, logical block 1572848, async page read
device-mapper: thin: 253:1: metadata operation 'dm_pool_alloc_data_block' failed: error = -5
device-mapper: thin: 253:1: aborting current metadata transaction
sysfs: cannot create duplicate filename '/kernel/slab/:a-0000144'
CPU: 2 PID: 1037 Comm: kworker/u48:1 Not tainted 4.17.0.snitm+ #25 Hardware name: Supermicro SYS-1029P-WTR/X11DDW-L, BIOS 2.0a 12/06/2017 Workqueue: dm-thin do_worker [dm_thin_pool] Call Trace: dump_stack+0x5a/0x73 sysfs_warn_dup+0x58/0x70 sysfs_create_dir_ns+0x77/0x80 kobject_add_internal+0xba/0x2e0 kobject_init_and_add+0x70/0xb0 sysfs_slab_add+0xb1/0x250 __kmem_cache_create+0x116/0x150 create_cache+0xd9/0x1f0 kmem_cache_create_usercopy+0x1c1/0x250 kmem_cache_create+0x18/0x20 dm_bufio_client_create+0x1ae/0x410 [dm_bufio] dm_block_manager_create+0x5e/0x90 [dm_persistent_data] __create_persistent_data_objects+0x38/0x940 [dm_thin_pool] dm_pool_abort_metadata+0x64/0x90 [dm_thin_pool] metadata_operation_failed+0x59/0x100 [dm_thin_pool] alloc_data_block.isra.53+0x86/0x180 [dm_thin_pool] process_cell+0x2a3/0x550 [dm_thin_pool] do_worker+0x28d/0x8f0 [dm_thin_pool] process_one_work+0x171/0x370 worker_thread+0x49/0x3f0 kthread+0xf8/0x130 ret_from_fork+0x35/0x40 kobject_add_internal failed for :a-0000144 with -EEXIST, don't try to register things with the same name in the same directory. kmem_cache_create(dm_bufio_buffer-16) failed with error -17
--- include/linux/slub_def.h | 4 ++++ mm/slab_common.c | 4 ++++ mm/slub.c | 7 ++++++- 3 files changed, 14 insertions(+), 1 deletion(-)
include/linux/slub_def.h +4 -0
@@ -156,8 +156,12 @@ struct kmem_cache {#ifdef CONFIG_SYSFS #define SLAB_SUPPORTS_SYSFS +void sysfs_slab_unlink (struct kmem_cache *);void sysfs_slab_release (struct kmem_cache *);#else +static inline void sysfs_slab_unlink (struct kmem_cache *s) +{ +}static inline void sysfs_slab_release (struct kmem_cache *s) { }
mm/slab_common.c +4 -0
@@ -566,10 +566,14 @@ static int shutdown_cache(struct kmem_calist_del (&s->list);if (s->flags &SLAB_TYPESAFE_BY_RCU ) { +#ifdef SLAB_SUPPORTS_SYSFS +sysfs_slab_unlink (s); +#endif list_add_tail (&s->list, &slab_caches_to_rcu_destroy);schedule_work (&slab_caches_to_rcu_destroy_work); }else {#ifdef SLAB_SUPPORTS_SYSFS +sysfs_slab_unlink (s);sysfs_slab_release (s);#else slab_kmem_cache_release (s);
mm/slub.c +6 -1
@@ -5714,7 +5714,6 @@ static void sysfs_slab_remove_workfn(strkset_unregister (s->memcg_kset);#endif kobject_uevent (&s->kobj,KOBJ_REMOVE ); -kobject_del (&s->kobj); out:kobject_put (&s->kobj); }
@@ -5799,6 +5798,12 @@ static void sysfs_slab_remove(struct kmeschedule_work (&s->kobj_remove_work); } +void sysfs_slab_unlink (struct kmem_cache *s) +{ +if (slab_state >=FULL ) +kobject_del (&s->kobj); +} +void sysfs_slab_release (struct kmem_cache *s) {if (slab_state >=FULL )
Greg Kroah-Hartman
maintainerPATCH 209/220 kasan: depend on CONFIG_SLUB_DEBUG
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason A. Donenfeld <[email protected]>
commit dd275caf4a0d9b219fffe49288b6cc33cd564312 upstream.
KASAN depends on having access to some of the accounting that SLUB_DEBUG does; without it, there are immediate crashes [1]. So, the natural thing to do is to make KASAN select SLUB_DEBUG.
[1] http://lkml.kernel.org/r/CAHmME9rtoPwxUSnktxzKso14iuVCWT7BE_-_8PAC=pGw1iJnQg@mail.gmail.com
--- lib/Kconfig.kasan | 1 + 1 file changed, 1 insertion(+)
lib/Kconfig.kasan +1 -0
@@ -6,6 +6,7 @@ if HAVE_ARCH_KASAN config KASAN bool "KASan: runtime memory debugger" depends on SLUB || (SLAB && !DEBUG_SLAB) + select SLUB_DEBUG if SLUB select CONSTRUCTORS select STACKDEPOT help
Greg Kroah-Hartman
maintainerPATCH 210/220 dm: use bio_split() when splitting out the already processed bio
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <[email protected]>
commit f21c601a2bb319ec19eb4562eadc7797d90fd90e upstream.
Use of bio_clone_bioset() is inefficient if there is no need to clone the original bio's bio_vec array. Best to use the bio_clone_fast() variant. Also, just using bio_advance() is only part of what is needed to properly setup the clone -- it doesn't account for the various bio_integrity() related work that also needs to be performed (see bio_split).
Address both of these issues by switching from bio_clone_bioset() to bio_split().
--- drivers/md/dm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/md/dm.c +2 -3
@@ -1582,10 +1582,9 @@ static blk_qc_t __split_and_process_bio(* the usage of io->orig_bio in dm_remap_zone_report() * won't be affected by this reassignment. */ -struct bio *b =bio_clone_bioset (bio,GFP_NOIO , - md->queue->bio_split); +struct bio *b =bio_split (bio,bio_sectors (bio) - ci.sector_count, +GFP_NOIO , md->queue->bio_split); ci.io->orig_bio = b; -bio_advance (bio, (bio_sectors (bio) - ci.sector_count) <<9 );bio_chain (b, bio); ret =generic_make_request (bio);break ;
Greg Kroah-Hartman
maintainerPATCH 211/220 pmem: only set QUEUE_FLAG_DAX for fsdax mode
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ross Zwisler <[email protected]>
commit 4557641b4c7046625c026fb809c47ef0d43ae595 upstream.
QUEUE_FLAG_DAX is an indication that a given block device supports filesystem DAX and should not be set for PMEM namespaces which are in "raw" mode. These namespaces lack struct page and are prevented from participating in filesystem DAX as of commit 569d0365f571 ("dax: require 'struct page' by default for filesystem dax").
--- drivers/nvdimm/pmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvdimm/pmem.c +2 -1
@@ -387,7 +387,8 @@ static int pmem_attach_disk(struct devicblk_queue_logical_block_size (q,pmem_sector_size (ndns));blk_queue_max_hw_sectors (q,UINT_MAX );blk_queue_flag_set (QUEUE_FLAG_NONROT , q); -blk_queue_flag_set (QUEUE_FLAG_DAX , q); +if (pmem->pfn_flags &PFN_MAP ) +blk_queue_flag_set (QUEUE_FLAG_DAX , q); q->queuedata = pmem; disk =alloc_disk_node (0 , nid);
Greg Kroah-Hartman
maintainerPATCH 212/220 block: Fix transfer when chunk sectors exceeds max
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keith Busch <[email protected]>
commit 15bfd21fbc5d35834b9ea383dc458a1f0c9e3434 upstream.
A device may have boundary restrictions where the number of sectors between boundaries exceeds its max transfer size. In this case, we need to cap the max size to the smaller of the two limits.
--- include/linux/blkdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/blkdev.h +2 -2
@@ -1124,8 +1124,8 @@ static inline unsigned int blk_max_size_if (!q->limits.chunk_sectors)return q->limits.max_sectors; -return q->limits.chunk_sectors - - (offset & (q->limits.chunk_sectors -1 )); +return min (q->limits.max_sectors, (unsigned int )(q->limits.chunk_sectors - + (offset & (q->limits.chunk_sectors -1 )))); } static inline unsigned int blk_rq_get_max_sectors(struct request *rq,
Greg Kroah-Hartman
maintainerPATCH 213/220 block: Fix cloning of requests with a special payload
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 297ba57dcdec7ea37e702bcf1a577ac32a034e21 upstream.
This patch avoids that removing a path controlled by the dm-mpath driver while mkfs is running triggers the following kernel bug:
kernel BUG at block/blk-core.c:3347!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 20 PID: 24369 Comm: mkfs.ext4 Not tainted 4.18.0-rc1-dbg+ #2
RIP: 0010:blk_end_request_all+0x68/0x70
Call Trace:
<IRQ>
dm_softirq_done+0x326/0x3d0 [dm_mod]
blk_done_softirq+0x19b/0x1e0
__do_softirq+0x128/0x60d
irq_exit+0x100/0x110
smp_call_function_single_interrupt+0x90/0x330
call_function_single_interrupt+0xf/0x20
</IRQ>--- block/blk-core.c | 4 ++++ 1 file changed, 4 insertions(+)
block/blk-core.c +4 -0
@@ -3487,6 +3487,10 @@ static void __blk_rq_prep_clone(struct r dst->cpu = src->cpu; dst->__sector =blk_rq_pos (src); dst->__data_len =blk_rq_bytes (src); +if (src->rq_flags &RQF_SPECIAL_PAYLOAD ) { + dst->rq_flags |=RQF_SPECIAL_PAYLOAD ; + dst->special_vec = src->special_vec; + } dst->nr_phys_segments = src->nr_phys_segments; dst->ioprio = src->ioprio; dst->extra_len = src->extra_len;
Greg Kroah-Hartman
maintainerPATCH 214/220 x86/e820: put !E820_TYPE_RAM regions into memblock.reserved
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naoya Horiguchi <[email protected]>
commit 124049decbb121ec32742c94fb5d9d6bed8f24d8 upstream.
There is a kernel panic that is triggered when reading /proc/kpageflags on the kernel booted with kernel parameter 'memmap=nn[KMG]!ss[KMG]':
BUG: unable to handle kernel paging request at fffffffffffffffe PGD 9b20e067 P4D 9b20e067 PUD 9b210067 PMD 0 Oops: 0000 [#1] SMP PTI CPU: 2 PID: 1728 Comm: page-types Not tainted 4.17.0-rc6-mm1-v4.17-rc6-180605-0816-00236-g2dfb086ef02c+ #160 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.fc28 04/01/2014 RIP: 0010:stable_page_flags+0x27/0x3c0 Code: 00 00 00 0f 1f 44 00 00 48 85 ff 0f 84 a0 03 00 00 41 54 55 49 89 fc 53 48 8b 57 08 48 8b 2f 48 8d 42 ff 83 e2 01 48 0f 44 c7 <48> 8b 00 f6 c4 01 0f 84 10 03 00 00 31 db 49 8b 54 24 08 4c 89 e7 RSP: 0018:ffffbbd44111fde0 EFLAGS: 00010202 RAX: fffffffffffffffe RBX: 00007fffffffeff9 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000202 RDI: ffffed1182fff5c0 RBP: ffffffffffffffff R08: 0000000000000001 R09: 0000000000000001 R10: ffffbbd44111fed8 R11: 0000000000000000 R12: ffffed1182fff5c0 R13: 00000000000bffd7 R14: 0000000002fff5c0 R15: ffffbbd44111ff10 FS: 00007efc4335a500(0000) GS:ffff93a5bfc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: fffffffffffffffe CR3: 00000000b2a58000 CR4: 00000000001406e0 Call Trace: kpageflags_read+0xc7/0x120 proc_reg_read+0x3c/0x60 __vfs_read+0x36/0x170 vfs_read+0x89/0x130 ksys_pread64+0x71/0x90 do_syscall_64+0x5b/0x160 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7efc42e75e23 Code: 09 00 ba 9f 01 00 00 e8 ab 81 f4 ff 66 2e 0f 1f 84 00 00 00 00 00 90 83 3d 29 0a 2d 00 00 75 13 49 89 ca b8 11 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 34 c3 48 83 ec 08 e8 db d3 01 00 48 89 04 24
According to kernel bisection, this problem became visible due to commit f7f99100d8d9 ("mm: stop zeroing memory during allocation in vmemmap") which changes how struct pages are initialized.
Memblock layout affects the pfn ranges covered by node/zone. Consider that we have a VM with 2 NUMA nodes and each node has 4GB memory, and the default (no memmap= given) memblock layout is like below:
MEMBLOCK configuration:
memory size = 0x00000001fff75c00 reserved size = 0x000000000300c000 memory.cnt = 0x4
memory[0x0] [0x0000000000001000-0x000000000009efff], 0x000000000009e000 bytes on node 0 flags: 0x0 memory[0x1] [0x0000000000100000-0x00000000bffd6fff], 0x00000000bfed7000 bytes on node 0 flags: 0x0 memory[0x2] [0x0000000100000000-0x000000013fffffff], 0x0000000040000000 bytes on node 0 flags: 0x0 memory[0x3] [0x0000000140000000-0x000000023fffffff], 0x0000000100000000 bytes on node 1 flags: 0x0
...
If you give memmap=1G!4G (so it just covers memory[0x2]), the range [0x100000000-0x13fffffff] is gone:
MEMBLOCK configuration:
memory size = 0x00000001bff75c00 reserved size = 0x000000000300c000 memory.cnt = 0x3
memory[0x0] [0x0000000000001000-0x000000000009efff], 0x000000000009e000 bytes on node 0 flags: 0x0 memory[0x1] [0x0000000000100000-0x00000000bffd6fff], 0x00000000bfed7000 bytes on node 0 flags: 0x0 memory[0x2] [0x0000000140000000-0x000000023fffffff], 0x0000000100000000 bytes on node 1 flags: 0x0
...
This causes shrinking node 0's pfn range because it is calculated by the address range of memblock.memory. So some of struct pages in the gap range are left uninitialized.
We have a function zero_resv_unavail() which does zeroing the struct pages within the reserved unavailable range (i.e. memblock.memory && !memblock.reserved). This patch utilizes it to cover all unavailable ranges by putting them into memblock.reserved.
--- arch/x86/kernel/e820.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
arch/x86/kernel/e820.c +12 -3
@@ -1246,6 +1246,7 @@ void __init e820__memblock_setup(void) {int i;u64 end; +u64 addr =0 ;/* * The bootstrap memblock region count maximum is 128 entries
@@ -1262,13 +1263,21 @@ void __init e820__memblock_setup(void)struct e820_entry *entry = &e820_table->entries[i]; end = entry->addr + entry->size; +if (addr < entry->addr) +memblock_reserve (addr, entry->addr - addr); + addr = end;if (end != (resource_size_t )end)continue ; +/* +* all !E820_TYPE_RAM ranges (including gap ranges) are put +* into memblock.reserved to make sure that struct pages in +* such regions are not left uninitialized after bootup. +*/ if (entry->type !=E820_TYPE_RAM && entry->type !=E820_TYPE_RESERVED_KERN ) -continue ; - -memblock_add (entry->addr, entry->size); +memblock_reserve (entry->addr, entry->size); +else +memblock_add (entry->addr, entry->size); }/* Throw away partial pages: */
Greg Kroah-Hartman
maintainerPATCH 215/220 selinux: move user accesses in selinuxfs out of locked regions
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <[email protected]>
commit 0da74120c5341389b97c4ee27487a97224999ee1 upstream.
If a user is accessing a file in selinuxfs with a pointer to a userspace buffer that is backed by e.g. a userfaultfd, the userspace access can stall indefinitely, which can block fsi->mutex if it is held.
For sel_read_policy(), remove the locking, since this method doesn't seem to access anything that requires locking.
For sel_read_bool(), move the user access below the locked region.
For sel_write_bool() and sel_commit_bools_write(), move the user access up above the locked region.
--- security/selinux/selinuxfs.c | 78 ++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 45 deletions(-)
security/selinux/selinuxfs.c +33 -45
@@ -435,22 +435,16 @@ static int sel_release_policy(struct inostatic ssize_t sel_read_policy (struct file *filp,char __user *buf,size_t count,loff_t *ppos) { -struct selinux_fs_info *fsi =file_inode (filp)->i_sb->s_fs_info;struct policy_load_memory *plm = filp->private_data;int ret; -mutex_lock (&fsi->mutex); - ret =avc_has_perm (&selinux_state,current_sid (),SECINITSID_SECURITY ,SECCLASS_SECURITY ,SECURITY__READ_POLICY ,NULL );if (ret) - goto out; +return ret; - ret =simple_read_from_buffer (buf, count, ppos, plm->data, plm->len); -out: -mutex_unlock (&fsi->mutex); -return ret; +return simple_read_from_buffer (buf, count, ppos, plm->data, plm->len); }static int sel_mmap_policy_fault (struct vm_fault *vmf)
@@ -1182,25 +1176,29 @@ static ssize_t sel_read_bool(struct file ret = -EINVAL ;if (index >= fsi->bool_num ||strcmp (name, fsi->bool_pending_names[index])) - goto out; + goto out_unlock; ret = -ENOMEM ; page = (char *)get_zeroed_page (GFP_KERNEL );if (!page) - goto out; + goto out_unlock; cur_enforcing =security_get_bool_value (fsi->state, index);if (cur_enforcing <0 ) { ret = cur_enforcing; - goto out; + goto out_unlock; } length =scnprintf (page,PAGE_SIZE ,"%d %d" , cur_enforcing, fsi->bool_pending_values[index]); - ret =simple_read_from_buffer (buf, count, ppos, page, length); -out:mutex_unlock (&fsi->mutex); + ret =simple_read_from_buffer (buf, count, ppos, page, length); +out_free:free_page ((unsigned long )page);return ret; + +out_unlock: +mutex_unlock (&fsi->mutex); + goto out_free; } static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
@@ -1213,6 +1211,17 @@ static ssize_t sel_write_bool(struct filunsigned index =file_inode (filep)->i_ino &SEL_INO_MASK ;const char *name = filep->f_path.dentry->d_name.name; +if (count >=PAGE_SIZE ) +return -ENOMEM ; + +/* No partial writes. */ +if (*ppos !=0 ) +return -EINVAL ; + + page =memdup_user_nul (buf, count); +if (IS_ERR (page)) +return PTR_ERR (page); +mutex_lock (&fsi->mutex); length = avc_has_perm(&selinux_state,
@@ -1227,22 +1236,6 @@ static ssize_t sel_write_bool(struct fil fsi->bool_pending_names[index])) goto out; - length = -ENOMEM ; -if (count >=PAGE_SIZE ) - goto out; - -/* No partial writes. */ - length = -EINVAL ; -if (*ppos !=0 ) - goto out; - - page =memdup_user_nul (buf, count); -if (IS_ERR (page)) { - length =PTR_ERR (page); - page =NULL ; - goto out; - } - length = -EINVAL ;if (sscanf (page,"%d" , &new_value) !=1 ) goto out;
@@ -1274,6 +1267,17 @@ static ssize_t sel_commit_bools_write(stssize_t length;int new_value; +if (count >=PAGE_SIZE ) +return -ENOMEM ; + +/* No partial writes. */ +if (*ppos !=0 ) +return -EINVAL ; + + page =memdup_user_nul (buf, count); +if (IS_ERR (page)) +return PTR_ERR (page); +mutex_lock (&fsi->mutex); length = avc_has_perm(&selinux_state,
@@ -1283,22 +1287,6 @@ static ssize_t sel_commit_bools_write(stif (length) goto out; - length = -ENOMEM ; -if (count >=PAGE_SIZE ) - goto out; - -/* No partial writes. */ - length = -EINVAL ; -if (*ppos !=0 ) - goto out; - - page =memdup_user_nul (buf, count); -if (IS_ERR (page)) { - length =PTR_ERR (page); - page =NULL ; - goto out; - } - length = -EINVAL ;if (sscanf (page,"%d" , &new_value) !=1 ) goto out;
Greg Kroah-Hartman
maintainerPATCH 216/220 x86/entry/64/compat: Fix "x86/entry/64/compat: Preserve r8-r11 in int $0x80"
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Lutomirski <[email protected]>
commit 22cd978e598618e82c3c3348d2069184f6884182 upstream.
Commit:
8bb2610bc496 ("x86/entry/64/compat: Preserve r8-r11 in int $0x80")
was busted: my original patch had a minor conflict with some of the nospec changes, but "git apply" is very clever and silently accepted the patch by making the same changes to a different function in the same file. There was obviously a huge offset, but "git apply" for some reason doesn't feel any need to say so.
Move the changes to the correct function. Now the test_syscall_vdso_32 selftests passes.
If anyone cares to observe the original problem, try applying the patch at:
to the kernel at 316d097c4cd4e7f2ef50c40cff2db266593c4ec4:
- "git am" and "git apply" accept the patch without any complaints at all
- "patch -p1" at least prints out a message about the huge offset.
--- arch/x86/entry/entry_64_compat.S | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/x86/entry/entry_64_compat.S +8 -8
@@ -84,13 +84,13 @@ ENTRY(entry_SYSENTER_compat) pushq %rdx /* pt_regs->dx */ pushq %rcx /* pt_regs->cx */ pushq $-ENOSYS /* pt_regs->ax */ - pushq %r8 /* pt_regs->r8 */ + pushq $0 /* pt_regs->r8 = 0 */ xorl %r8d, %r8d /* nospec r8 */ - pushq %r9 /* pt_regs->r9 */ + pushq $0 /* pt_regs->r9 = 0 */ xorl %r9d, %r9d /* nospec r9 */ - pushq %r10 /* pt_regs->r10 */ + pushq $0 /* pt_regs->r10 = 0 */ xorl %r10d, %r10d /* nospec r10 */ - pushq %r11 /* pt_regs->r11 */ + pushq $0 /* pt_regs->r11 = 0 */ xorl %r11d, %r11d /* nospec r11 */ pushq %rbx /* pt_regs->rbx */ xorl %ebx, %ebx /* nospec rbx */
@@ -374,13 +374,13 @@ ENTRY(entry_INT80_compat) pushq %rcx /* pt_regs->cx */ xorl %ecx, %ecx /* nospec cx */ pushq $-ENOSYS /* pt_regs->ax */ - pushq $0 /* pt_regs->r8 = 0 */ + pushq %r8 /* pt_regs->r8 */ xorl %r8d, %r8d /* nospec r8 */ - pushq $0 /* pt_regs->r9 = 0 */ + pushq %r9 /* pt_regs->r9 */ xorl %r9d, %r9d /* nospec r9 */ - pushq $0 /* pt_regs->r10 = 0 */ + pushq %r10 /* pt_regs->r10*/ xorl %r10d, %r10d /* nospec r10 */ - pushq $0 /* pt_regs->r11 = 0 */ + pushq %r11 /* pt_regs->r11 */ xorl %r11d, %r11d /* nospec r11 */ pushq %rbx /* pt_regs->rbx */ xorl %ebx, %ebx /* nospec rbx */
Greg Kroah-Hartman
maintainerPATCH 217/220 x86/efi: Fix efi_call_phys_epilog() with CONFIG_X86_5LEVEL=y
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirill A. Shutemov <[email protected]>
commit cfe19577047e74cdac5826adbdc2337d8437f8fb upstream.
Open-coded page table entry checks don't work correctly when we fold the page table level at runtime.
pgd_present() on 4-level paging machine always returns true, but open-coded version of the check may return false-negative result and we silently skip the rest of the loop body in efi_call_phys_epilog().
Replace open-coded checks with proper helpers.
--- arch/x86/platform/efi/efi_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/platform/efi/efi_64.c +2 -2
@@ -166,14 +166,14 @@ void __init efi_call_phys_epilog(pgd_t * pgd =pgd_offset_k (pgd_idx *PGDIR_SIZE );set_pgd (pgd_offset_k (pgd_idx *PGDIR_SIZE ), save_pgd[pgd_idx]); -if (!(pgd_val (*pgd) & _PAGE_PRESENT)) +if (!pgd_present (*pgd))continue ;for (i =0 ; i <PTRS_PER_P4D ; i++) { p4d =p4d_offset (pgd, pgd_idx *PGDIR_SIZE + i *P4D_SIZE ); -if (!(p4d_val (*p4d) & _PAGE_PRESENT)) +if (!p4d_present (*p4d))continue ; pud = (pud_t *)p4d_page_vaddr (*p4d);
Greg Kroah-Hartman
maintainerPATCH 218/220 dm zoned: avoid triggering reclaim from inside dmz_map()
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 2d0b2d64d325e22939d9db3ba784f1236459ed98 upstream.
This patch avoids that lockdep reports the following:
======================================================
WARNING: possible circular locking dependency detected
4.18.0-rc1 #62 Not tainted
------------------------------------------------------
kswapd0/84 is trying to acquire lock:00000000c313516d (&xfs_nondir_ilock_class){++++}, at: xfs_free_eofblocks+0xa2/0x1e0
but task is already holding lock:00000000591c83ae (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x5/0x30
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (fs_reclaim){+.+.}:
kmem_cache_alloc+0x2c/0x2b0 radix_tree_node_alloc.constprop.19+0x3d/0xc0 __radix_tree_create+0x161/0x1c0 __radix_tree_insert+0x45/0x210 dmz_map+0x245/0x2d0 [dm_zoned] __map_bio+0x40/0x260 __split_and_process_non_flush+0x116/0x220 __split_and_process_bio+0x81/0x180 __dm_make_request.isra.32+0x5a/0x100 generic_make_request+0x36e/0x690 submit_bio+0x6c/0x140 mpage_readpages+0x19e/0x1f0 read_pages+0x6d/0x1b0 __do_page_cache_readahead+0x21b/0x2d0 force_page_cache_readahead+0xc4/0x100 generic_file_read_iter+0x7c6/0xd20 __vfs_read+0x102/0x180 vfs_read+0x9b/0x140 ksys_read+0x55/0xc0 do_syscall_64+0x5a/0x1f0 entry_SYSCALL_64_after_hwframe+0x49/0xbe
-> #1 (&dmz->chunk_lock){+.+.}:
dmz_map+0x133/0x2d0 [dm_zoned] __map_bio+0x40/0x260 __split_and_process_non_flush+0x116/0x220 __split_and_process_bio+0x81/0x180 __dm_make_request.isra.32+0x5a/0x100 generic_make_request+0x36e/0x690 submit_bio+0x6c/0x140 _xfs_buf_ioapply+0x31c/0x590 xfs_buf_submit_wait+0x73/0x520 xfs_buf_read_map+0x134/0x2f0 xfs_trans_read_buf_map+0xc3/0x580 xfs_read_agf+0xa5/0x1e0 xfs_alloc_read_agf+0x59/0x2b0 xfs_alloc_pagf_init+0x27/0x60 xfs_bmap_longest_free_extent+0x43/0xb0 xfs_bmap_btalloc_nullfb+0x7f/0xf0 xfs_bmap_btalloc+0x428/0x7c0 xfs_bmapi_write+0x598/0xcc0 xfs_iomap_write_allocate+0x15a/0x330 xfs_map_blocks+0x1cf/0x3f0 xfs_do_writepage+0x15f/0x7b0 write_cache_pages+0x1ca/0x540 xfs_vm_writepages+0x65/0xa0 do_writepages+0x48/0xf0 __writeback_single_inode+0x58/0x730 writeback_sb_inodes+0x249/0x5c0 wb_writeback+0x11e/0x550 wb_workfn+0xa3/0x670 process_one_work+0x228/0x670 worker_thread+0x3c/0x390 kthread+0x11c/0x140 ret_from_fork+0x3a/0x50
-> #0 (&xfs_nondir_ilock_class){++++}:
down_read_nested+0x43/0x70 xfs_free_eofblocks+0xa2/0x1e0 xfs_fs_destroy_inode+0xac/0x270 dispose_list+0x51/0x80 prune_icache_sb+0x52/0x70 super_cache_scan+0x127/0x1a0 shrink_slab.part.47+0x1bd/0x590 shrink_node+0x3b5/0x470 balance_pgdat+0x158/0x3b0 kswapd+0x1ba/0x600 kthread+0x11c/0x140 ret_from_fork+0x3a/0x50
other info that might help us debug this:
Chain exists of: &xfs_nondir_ilock_class --> &dmz->chunk_lock --> fs_reclaim Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(fs_reclaim);
lock(&dmz->chunk_lock);
lock(fs_reclaim);lock(&xfs_nondir_ilock_class);
--- drivers/md/dm-zoned-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-zoned-target.c +1 -1
@@ -788,7 +788,7 @@ static int dmz_ctr(struct dm_target *ti,/* Chunk BIO work */ mutex_init (&dmz->chunk_lock); -INIT_RADIX_TREE (&dmz->chunk_rxtree,GFP_KERNEL ); +INIT_RADIX_TREE (&dmz->chunk_rxtree,GFP_NOIO ); dmz->chunk_wq =alloc_workqueue ("dmz_cwq_%s" ,WQ_MEM_RECLAIM |WQ_UNBOUND ,0 , dev->name);if (!dmz->chunk_wq) {
Greg Kroah-Hartman
maintainerPATCH 219/220 dm thin: handle running out of data space vs concurrent discard
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <[email protected]>
commit a685557fbbc3122ed11e8ad3fa63a11ebc5de8c3 upstream.
Discards issued to a DM thin device can complete to userspace (via fstrim) _before_ the metadata changes associated with the discards is reflected in the thinp superblock (e.g. free blocks). As such, if a user constructs a test that loops repeatedly over these steps, block allocation can fail due to discards not having completed yet:
1) fill thin device via filesystem file
2) remove file
3) fstrim
Quoted 1 line
Quoted 1 line
From initial report, here:
https://www.redhat.com/archives/dm-devel/2018-April/msg00022.html
"The root cause of this issue is that dm-thin will first remove mapping and increase corresponding blocks' reference count to prevent them from being reused before DISCARD bios get processed by the underlying layers. However. increasing blocks' reference count could also increase the nr_allocated_this_transaction in struct sm_disk which makes smd->old_ll.nr_allocated + smd->nr_allocated_this_transaction bigger than smd->old_ll.nr_blocks. In this case, alloc_data_block() will never commit metadata to reset the begin pointer of struct sm_disk, because sm_disk_get_nr_free() always return an underflow value."
While there is room for improvement to the space-map accounting that thinp is making use of: the reality is this test is inherently racey and will result in the previous iteration's fstrim's discard(s) completing vs concurrent block allocation, via dd, in the next iteration of the loop.
No amount of space map accounting improvements will be able to allow user's to use a block before a discard of that block has completed.
So the best we can really do is allow DM thinp to gracefully handle such aggressive use of all the pool's data by degrading the pool into out-of-data-space (OODS) mode. We _should_ get that behaviour already (if space map accounting didn't falsely cause alloc_data_block() to believe free space was available).. but short of that we handle the current reality that dm_pool_alloc_data_block() can return -ENOSPC.
--- drivers/md/dm-thin.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/md/dm-thin.c +9 -2
@@ -1385,6 +1385,8 @@ static void schedule_external_copy(strucstatic void set_pool_mode (struct pool *pool,enum pool_mode new_mode); +static void requeue_bios (struct pool *pool); +static void check_for_space (struct pool *pool) {int r;
@@ -1397,8 +1399,10 @@ static void check_for_space(struct poolif (r)return ; -if (nr_free) +if (nr_free) {set_pool_mode (pool,PM_WRITE ); +requeue_bios (pool); + } }/*
@@ -1475,7 +1479,10 @@ static int alloc_data_block(struct thin_ r =dm_pool_alloc_data_block (pool->pmd, result);if (r) { -metadata_operation_failed (pool,"dm_pool_alloc_data_block" , r); +if (r == -ENOSPC ) +set_pool_mode (pool,PM_OUT_OF_DATA_SPACE ); +else +metadata_operation_failed (pool,"dm_pool_alloc_data_block" , r);return r; }
Greg Kroah-Hartman
maintainerPATCH 220/220 virt: vbox: Only copy_from_user the request-header once
In reply to Greg Kroah-Hartman4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenwen Wang <[email protected]>
commit bd23a7269834dc7c1f93e83535d16ebc44b75eba upstream.
In vbg_misc_device_ioctl(), the header of the ioctl argument is copied from the userspace pointer 'arg' and saved to the kernel object 'hdr'. Then the 'version', 'size_in', and 'size_out' fields of 'hdr' are verified.
Before this commit, after the checks a buffer for the entire request would be allocated and then all data including the verified header would be copied from the userspace 'arg' pointer again.
Given that the 'arg' pointer resides in userspace, a malicious userspace process can race to change the data pointed to by 'arg' between the two copies. By doing so, the user can bypass the verifications on the ioctl argument.
This commit fixes this by using the already checked copy of the header to fill the header part of the allocated buffer and only copying the remainder of the data from userspace.
--- drivers/virt/vboxguest/vboxguest_linux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/virt/vboxguest/vboxguest_linux.c +3 -1
@@ -121,7 +121,9 @@ static long vbg_misc_device_ioctl(structif (!buf)return -ENOMEM ; -if (copy_from_user (buf, (void *)arg, hdr.size_in)) { + *((struct vbg_ioctl_hdr *)buf) = hdr; +if (copy_from_user (buf +sizeof (hdr), (void *)arg +sizeof (hdr), + hdr.size_in -sizeof (hdr))) { ret = -EFAULT ; goto out; }
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.17.4 release. There are 220 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 Tue Jul 3 16:08:27 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.17.4-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.17.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm and x86_64.
Summary
------------------------------------------------------------------------
kernel: 4.17.4-rc1
git repo:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.17.y
git commit: 7cde32fbe2ccb991623eb74b50c45abf51eec58f
git describe: v4.17.3-221-g7cde32fbe2cc
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.17-oe\
/build/v4.17.3-221-g7cde32fbe2cc
^please join url
No regressions (compared to build v4.17.3-222-g5cff622a798f)
Ran 11389 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c - arm64
- hi6220-hikey - arm64
- juno-r2 - arm64
- qemu_arm
- qemu_arm64
- qemu_x86_64
- x15 - arm
- x86_64
Test Suites
-----------
* boot
* kselftest
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-containers-tests
* ltp-cve-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-timers-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Greg Kroah-Hartman
maintainerQuoted 15 lines · Naresh Kamboju
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.17.4 release. There are 220 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 Tue Jul 3 16:08:27 UTC 2018. 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.17.4-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.17.y
and the diffstat can be found below.
Quoted 6 lines
Quoted 3 lines
thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm andx86_64.
Great, thanks for testing 3 of these and letting me know.
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.17.4 release. There are 220 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 Tue Jul 3 16:08:27 UTC 2018. Anything received after that time might be too late.
Build results:
total: 134 pass: 134 fail: 0 Qemu test results: total: 158 pass: 158 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Greg Kroah-Hartman
maintainerQuoted 10 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.17.4 release. There are 220 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 Tue Jul 3 16:08:27 UTC 2018. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 134 pass: 134 fail: 0 Qemu test results: total: 158 pass: 158 fail: 0Details are available at http://kerneltests.org/builders.
Thanks for testing all of these and letting me know.
greg k-h